$OpenBSD: patch-Makefile,v 1.1.1.1 2010/10/25 10:14:53 pea Exp $ --- Makefile.orig Sat Aug 1 21:23:43 2009 +++ Makefile Fri Sep 24 16:45:07 2010 @@ -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 -dm 755 $(DESTDIR)/var/db/vnstat install -s -m 755 src/vnstat $(BIN_BSD) install -s -m 755 src/vnstatd $(SBIN_BSD) @@ -137,24 +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 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