3af0884572
Initial diff from Gonzalo L. R. (gonzalo at x61.com.ar) ok sthen@
68 lines
2.0 KiB
Plaintext
68 lines
2.0 KiB
Plaintext
$OpenBSD: patch-Makefile,v 1.2 2012/03/09 09:33:03 pea Exp $
|
|
--- Makefile.orig Sun May 29 22:41:34 2011
|
|
+++ Makefile Thu Mar 8 18:17:10 2012
|
|
@@ -4,20 +4,20 @@ SBIN = $(DESTDIR)/usr/sbin
|
|
MAN = $(DESTDIR)/usr/share/man
|
|
|
|
# bin and man dirs for *BSD
|
|
-BIN_BSD = $(DESTDIR)/usr/local/bin
|
|
-SBIN_BSD = $(DESTDIR)/usr/local/sbin
|
|
-MAN_BSD = $(DESTDIR)/usr/local/man
|
|
+BIN_BSD ?= ${PREFIX}/bin
|
|
+SBIN_BSD ?= ${PREFIX}/sbin
|
|
+MAN_BSD ?= ${PREFIX}/man
|
|
|
|
default: vnstat
|
|
|
|
vnstat:
|
|
- +make -C src
|
|
+ +$(MAKE) -C src
|
|
|
|
all:
|
|
- +make -C src all
|
|
+ +$(MAKE) -C src all
|
|
|
|
clean:
|
|
- make -C src clean
|
|
+ $(MAKE) -C src clean
|
|
|
|
install:
|
|
@echo "Installing vnStat..."
|
|
@@ -126,7 +126,6 @@ bsdinstall:
|
|
fi
|
|
|
|
# install binaries
|
|
- install -d -m 755 $(DESTDIR)/var/db/vnstat
|
|
install -s -m 755 src/vnstat $(BIN_BSD)
|
|
install -s -m 755 src/vnstatd $(SBIN_BSD)
|
|
|
|
@@ -137,25 +136,18 @@ bsdinstall:
|
|
|
|
# install default config if such doesn't exist
|
|
@if [ ! -f $(DESTDIR)/etc/vnstat.conf ]; \
|
|
- then echo "Installing config to $(DESTDIR)/etc/vnstat.conf"; \
|
|
- install -d -m 755 $(DESTDIR)/etc; \
|
|
- install -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \
|
|
- sed -e 's/lib/db/g' $(DESTDIR)/etc/vnstat.conf >$(DESTDIR)/etc/vnstat.conf.bsd; \
|
|
- mv -f $(DESTDIR)/etc/vnstat.conf.bsd $(DESTDIR)/etc/vnstat.conf; \
|
|
+ then echo "Installing config to ${PREFIX}/share/exemples/vnstat/vnstat.conf"; \
|
|
+ install -d ${PREFIX}/share/examples/vnstat/; \
|
|
+ install -m 644 cfg/vnstat.conf ${PREFIX}/share/examples/vnstat/vnstat.conf; \
|
|
fi
|
|
|
|
# update man page
|
|
install -m 644 man/vnstat.1 $(MAN_BSD)/man1
|
|
install -m 644 man/vnstatd.1 $(MAN_BSD)/man1
|
|
install -m 644 man/vnstat.conf.5 $(MAN_BSD)/man5
|
|
- gzip -f9 $(MAN_BSD)/man1/vnstat.1
|
|
- gzip -f9 $(MAN_BSD)/man1/vnstatd.1
|
|
- gzip -f9 $(MAN_BSD)/man5/vnstat.conf.5
|
|
@if [ -f "src/vnstati" ]; \
|
|
then echo install -m 644 man/vnstati.1 $(MAN_BSD)/man1; \
|
|
install -m 644 man/vnstati.1 $(MAN_BSD)/man1; \
|
|
- echo gzip -f9 $(MAN_BSD)/man1/vnstati.1; \
|
|
- gzip -f9 $(MAN_BSD)/man1/vnstati.1; \
|
|
fi
|
|
|
|
# remove vnstat.conf.1 is such exists in the wrong place
|