Allow staging as a regular user

This commit is contained in:
Antoine Brodin 2014-08-24 19:33:07 +00:00
parent b704732349
commit 419b268499
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=366006

View file

@ -1,5 +1,5 @@
--- ./Makefile.orig 2013-05-22 03:50:24.000000000 +0200 --- Makefile.orig 2013-05-22 01:50:24 UTC
+++ ./Makefile 2014-02-16 12:29:01.767731648 +0100 +++ Makefile
@@ -39,8 +39,8 @@ @@ -39,8 +39,8 @@
SLIBS= -pthread -lpcap SLIBS= -pthread -lpcap
BINDIR=./bin BINDIR=./bin
@ -25,16 +25,19 @@
# turn on optimisation # turn on optimisation
CFLAGS += -O2 CFLAGS += -O2
@@ -80,9 +80,10 @@ @@ -76,13 +76,10 @@
echo "You must be root to install" && exit 1 ; \ rm -f $(PROGRAM) *.o $(SRCDIR)/*.o *~
fi ;
install:
- @if test "`id -u`" != "0" ; then \
- echo "You must be root to install" && exit 1 ; \
- fi ;
@echo "Installing spp binary" @echo "Installing spp binary"
- $(INSTALL) -c -m 755 $(PROGRAM) /usr/local/bin/ - $(INSTALL) -c -m 755 $(PROGRAM) /usr/local/bin/
+ @strip $(PROGRAM) + $(BSD_INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin/
+ $(INSTALL) -c -m 755 $(PROGRAM) $(DESTDIR)$(PREFIX)/bin/
@echo "Installing manual page" @echo "Installing manual page"
- $(INSTALL) -c -m 644 doc/spp.1 /usr/local/man/man1/ - $(INSTALL) -c -m 644 doc/spp.1 /usr/local/man/man1/
+ $(INSTALL) -c -m 644 doc/spp.1 $(DESTDIR)$(PREFIX)/man/man1/ + $(BSD_INSTALL_MAN) doc/spp.1 $(DESTDIR)$(PREFIX)/man/man1/
# target 'distro' # target 'distro'
# #