Mac install target for the upnp daemon was trying

to install files that don't exist and launchd
config file had hardcoded paths.
* commented out code that was trying to install
  files/scripts that don't exist
* added a make target for generating launchd
  config file with accurate install paths
* enabled installing man page
This commit is contained in:
Ville Kallioniemi 2011-12-30 23:22:48 -07:00
parent 24065dbaba
commit 7582b0e506
2 changed files with 11 additions and 8 deletions

View File

@ -47,8 +47,8 @@ LIBS =
INSTALL_BINDIR = $(PREFIX)/sbin INSTALL_BINDIR = $(PREFIX)/sbin
INSTALL_ETCDIR = $(PREFIX)/etc/miniupnpd INSTALL_ETCDIR = $(PREFIX)/etc/miniupnpd
# INSTALL_MANDIR = $(PREFIX)/man INSTALL_MANDIR = $(PREFIX)/man/man1
INSTALL_MANDIR = /usr/share/man/man1 #INSTALL_MANDIR = /usr/share/man/man1
all: $(EXECUTABLES) all: $(EXECUTABLES)
@ -57,19 +57,19 @@ clean:
testupnpdescgen.o testgetifstats.o testupnppermissions.o \ testupnpdescgen.o testgetifstats.o testupnppermissions.o \
miniupnpdctl.o testgetifaddr.o config.h miniupnpdctl.o testgetifaddr.o config.h
install: miniupnpd genuuid install: miniupnpd genuuid genlaunchd
$(STRIP) miniupnpd $(STRIP) miniupnpd
$(INSTALL) -d $(INSTALL_BINDIR) $(INSTALL) -d $(INSTALL_BINDIR)
$(INSTALL) miniupnpd $(INSTALL_BINDIR) $(INSTALL) miniupnpd $(INSTALL_BINDIR)
$(INSTALL) -d $(INSTALL_ETCDIR) $(INSTALL) -d $(INSTALL_ETCDIR)
$(INSTALL) ipfw/ipfw_init.sh $(INSTALL_ETCDIR) $(INSTALL) -m 0644 -b miniupnpd.conf $(INSTALL_ETCDIR)
$(INSTALL) ipfw/ipfw_removeall.sh $(INSTALL_ETCDIR)
$(INSTALL) --mode=0644 -b miniupnpd.conf $(INSTALL_ETCDIR)
$(INSTALL) -d $(INSTALL_MANDIR) $(INSTALL) -d $(INSTALL_MANDIR)
$(INSTALL) miniupnpd.1 $(INSTALL_MANDIR) $(INSTALL) miniupnpd.1 $(INSTALL_MANDIR)
# TODO Fix these paths and those within the plist # TODO Fix these paths and those within the plist
$(INSTALL) -d $(PREFIX)/Library/LaunchDaemons $(INSTALL) -d $(PREFIX)/Library/LaunchDaemons
$(INSTALL) mac/org.tuxfamily.miniupnpd.plist $(PREFIX)/Library/LaunchDaemons $(INSTALL) mac/org.tuxfamily.miniupnpd.plist $(PREFIX)/Library/LaunchDaemons
#$(INSTALL) ipfw/ipfw_init.sh $(INSTALL_ETCDIR)
#$(INSTALL) ipfw/ipfw_removeall.sh $(INSTALL_ETCDIR)
# genuuid is using the uuid cli tool available under MacOSX # genuuid is using the uuid cli tool available under MacOSX
UUID != if which uuidgen 2>&1 > /dev/null; then \ UUID != if which uuidgen 2>&1 > /dev/null; then \
@ -84,6 +84,9 @@ genuuid:
sed -e "s/^uuid=[-0-9a-f]*/uuid=$(UUID)/" miniupnpd.conf.before > miniupnpd.conf sed -e "s/^uuid=[-0-9a-f]*/uuid=$(UUID)/" miniupnpd.conf.before > miniupnpd.conf
$(RM) miniupnpd.conf.before $(RM) miniupnpd.conf.before
genlaunchd:
sed -e "s|INSTALLPREFIX|$(PREFIX)|g" mac/org.tuxfamily.miniupnpd.plist.before > mac/org.tuxfamily.miniupnpd.plist
depend: config.h depend: config.h
mkdep $(ALL_OBJS:.o=.c) testupnpdescgen.c testgetifstats.c \ mkdep $(ALL_OBJS:.o=.c) testupnpdescgen.c testgetifstats.c \
testupnppermissions.c miniupnpdctl.c testgetifaddr.c testupnppermissions.c miniupnpdctl.c testgetifaddr.c

View File

@ -7,8 +7,8 @@
<string>org.tuxfamily.miniupnpd</string> <string>org.tuxfamily.miniupnpd</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>/usr/sbin/miniupnpd</string> <string>INSTALLPREFIX/sbin/miniupnpd</string>
<string>-f /etc/miniupnpd/miniupnpd.conf</string> <string>-f INSTALLPREFIX/etc/miniupnpd/miniupnpd.conf</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>
<true/> <true/>