diff options
-rw-r--r-- | Makefile | 28 | ||||
-rw-r--r-- | contrib/fedora/passt.spec | 4 |
2 files changed, 21 insertions, 11 deletions
@@ -82,7 +82,13 @@ ifeq ($(shell :|$(CC) -fstack-protector-strong -S -xc - -o - >/dev/null 2>&1; ec CFLAGS += -fstack-protector-strong endif -prefix ?= /usr/local +prefix ?= /usr/local +exec_prefix ?= $(prefix) +bindir ?= $(exec_prefix)/bin +datarootdir ?= $(prefix)/share +docdir ?= $(datarootdir)/doc/passt +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 ifeq ($(TARGET_ARCH),X86_64) BIN := passt passt.avx2 pasta pasta.avx2 qrap @@ -126,19 +132,19 @@ clean: passt.pid README.plain.md install: $(BIN) $(MANPAGES) docs - mkdir -p $(DESTDIR)$(prefix)/bin $(DESTDIR)$(prefix)/share/man/man1 - cp -d $(BIN) $(DESTDIR)$(prefix)/bin - cp -d $(MANPAGES) $(DESTDIR)$(prefix)/share/man/man1 - mkdir -p $(DESTDIR)$(prefix)/share/doc/passt - cp -d README.plain.md $(DESTDIR)$(prefix)/share/doc/passt/README.md - cp -d doc/demo.sh $(DESTDIR)$(prefix)/share/doc/passt + mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) + cp -d $(BIN) $(DESTDIR)$(bindir) + cp -d $(MANPAGES) $(DESTDIR)$(man1dir) + mkdir -p $(DESTDIR)$(docdir) + cp -d README.plain.md $(DESTDIR)$(docdir)/README.md + cp -d doc/demo.sh $(DESTDIR)$(docdir) uninstall: $(RM) $(BIN:%=$(DESTDIR)$(prefix)/bin/%) - $(RM) $(MANPAGES:%=$(DESTDIR)$(prefix)/share/man/man1/%) - $(RM) $(DESTDIR)$(prefix)/share/doc/passt/README.md - $(RM) $(DESTDIR)$(prefix)/share/doc/passt/demo.sh - -rmdir $(DESTDIR)$(prefix)/share/doc/passt + $(RM) $(MANPAGES:%=$(DESTDIR)$(man1dir)/%) + $(RM) $(DESTDIR)$(docdir)/README.md + $(RM) $(DESTDIR)$(docdir)/demo.sh + -rmdir $(DESTDIR)$(docdir) pkgs: static tar cf passt.tar -P --xform 's//\/usr\/bin\//' $(BIN) diff --git a/contrib/fedora/passt.spec b/contrib/fedora/passt.spec index 8bbe0d0..87c3e93 100644 --- a/contrib/fedora/passt.spec +++ b/contrib/fedora/passt.spec @@ -51,7 +51,11 @@ This package adds SELinux enforcement to passt(1) and pasta(1). %make_build %install +%if 0%{?suse_version} > 910 +%make_install DESTDIR=%{buildroot} prefix=%{_prefix} docdir=%{_prefix}/share/doc/packages/passt +%else %make_install DESTDIR=%{buildroot} prefix=%{_prefix} +%endif %ifarch x86_64 ln -sr %{buildroot}%{_mandir}/man1/passt.1 %{buildroot}%{_mandir}/man1/passt.avx2.1 ln -sr %{buildroot}%{_mandir}/man1/pasta.1 %{buildroot}%{_mandir}/man1/pasta.avx2.1 |