--- Makefile.orig 2005-11-07 00:38:22 UTC +++ Makefile @@ -12,12 +12,12 @@ # Compilation/installation vars (global for all following sections) | #===================================================================== # -CC = gcc -PREFIX = /usr/local -X11PREFIX = /usr/X11R6 +CC ?= gcc +PREFIX = %%PREFIX%% +X11PREFIX = ${LOCALBASE} INCX11 = $(X11PREFIX)/include LIBX11 = $(X11PREFIX)/lib -INCFORMS = $(X11PREFIX)/include +INCFORMS = $(X11PREFIX)/include/X11 LIBFORMS = $(X11PREFIX)/lib MODEM_DEV = modem MODEM_PATH = /dev/$(MODEM_DEV) @@ -29,26 +29,26 @@ # Normal (i.e. SuSE-[6789].x) vars; for SuSE-5.x use the lines which # DO NOT include -lcrypt for EXTRALIBS and -DGLIBC2 for EXTRADEFS. #------------------------------------------------------------------- -BINX11 = $(X11PREFIX)/bin -USRLOCAL = $(PREFIX)/bin -SBINDIR = /usr/sbin -VARRUN = /var/run -USRLIBPPP = /etc/ppp -OPTSDIR = /etc/ppp -MANDIR = $(X11PREFIX)/man/man1 -ETCPPP = /etc/ppp -INSTPPPDIR = $(ETCPPP) -PPPDLCKDIR = /var/lock -DESTDIR = -GROUP = uucp -CCFLAGS = -Wall -O -EXTRADEFS = -DMODEM_DEVICE=\"$(MODEM_PATH)\" -DGLIBC2 -DHAVE_STRERROR +#BINX11 = $(X11PREFIX)/bin +#USRLOCAL = $(PREFIX)/bin +#SBINDIR = /usr/sbin +#VARRUN = /var/run +#USRLIBPPP = /etc/ppp +#OPTSDIR = /etc/ppp +#MANDIR = $(X11PREFIX)/man/man1 +#ETCPPP = /etc/ppp +#INSTPPPDIR = $(ETCPPP) +#PPPDLCKDIR = /var/lock +#DESTDIR = +#GROUP = uucp +#CCFLAGS = -Wall -O +#EXTRADEFS = -DMODEM_DEVICE=\"$(MODEM_PATH)\" -DGLIBC2 -DHAVE_STRERROR #EXTRADEFS = -DMODEM_DEVICE=\"$(MODEM_PATH)\" -EXTRALIBS = -lcrypt +#EXTRALIBS = -lcrypt #EXTRALIBS = -LINKX11 = -LINKFORMS = -L$(LIBFORMS) -lforms -INSTALL = install +#LINKX11 = +#LINKFORMS = -L$(LIBFORMS) -lforms +#INSTALL = install # # Debian vars (if your Debian distribution is relatively # old and does not use glibc2, use the lines which DO NOT @@ -208,29 +208,29 @@ # # FreeBSD vars #------------- -#BINX11 = $(X11PREFIX)/bin -#USRLOCAL = $(BINX11) -#SBINDIR = /usr/sbin -#VARRUN = /var/run -#USRLIBPPP = $(PREFIX)/libexec -#MANDIR = $(PREFIX)/man/man1 -#ETCPPP = /etc/ppp -#OPTSDIR = $(ETCPPP) -#INSTPPPDIR = $(ETCPPP) -#PPPDLCKDIR = /var/spool/lock -#DESTDIR = -#NAMEFORMS = xforms -#GROUP = dialer -#CHAT_PATH = /usr/bin -#PPPD_PATH = /usr/sbin -#CCFLAGS = -Wall -O -#EXTRALIBS = -lcipher -#LINKX11 = -Wl,-R$(LIBX11) -#LINKFORMS = -L$(LIBFORMS) -lxforms -#INSTALL = /usr/bin/install -##MODEM_DEV = cuaa0 -#EXTRADEFS = -DMODEM_DEVICE=\"$(MODEM_PATH)\" -DHAVE_STRERROR \ -# -DCHAT_PATH=\"$(CHAT_PATH)\" -DPPPD_PATH=\"$(PPPD_PATH)\" +BINX11 = $(X11PREFIX)/bin +USRLOCAL = $(BINX11) +SBINDIR = /usr/sbin +VARRUN = /var/run +USRLIBPPP = $(PREFIX)/libexec +MANDIR = $(PREFIX)/man/man1 +ETCPPP = ${PREFIX}/etc/ppp +OPTSDIR = $(ETCPPP) +INSTPPPDIR = $(ETCPPP) +PPPDLCKDIR = /var/spool/lock +DESTDIR = +GROUP = dialer +CHAT_PATH = /usr/bin +PPPD_PATH = /usr/sbin +CCFLAGS ?= -Wall -O -DUSE_OPENSSL +EXTRALIBS = -lcrypto +LINKX11 = -Wl,-R$(LIBX11) +LINKFORMS = -L$(LIBFORMS) -lforms +INSTALL = /usr/bin/install +MODEM_DEV = cuaa0 +MODEM_DEVS = cuaa0 cuaa1 cuaa2 cuaa3 umodem +EXTRADEFS = -DMODEM_DEVICE=\"$(MODEM_PATH)\" -DHAVE_STRERROR \ + -DCHAT_PATH=\"$(CHAT_PATH)\" -DPPPD_PATH=\"$(PPPD_PATH)\" # #===================================================================== # Program configuration options | @@ -352,32 +352,32 @@ $(CC) $(CCOPTS) -o xispid xispid.c xisp.1: xisp.man - sed -e s,@ETCPPP@,$(DESTDIR)$(ETCPPP),g \ - -e s,@USRLIBPPP@,$(DESTDIR)$(USRLIBPPP),g \ - -e s,@USRLOCAL@,$(DESTDIR)$(USRLOCAL),g < xisp.man > xisp.1 + sed -e s,@ETCPPP@,$(ETCPPP),g \ + -e s,@USRLIBPPP@,$(USRLIBPPP),g \ + -e s,@USRLOCAL@,$(USRLOCAL),g < xisp.man > xisp.1 install: xisp xispdial xisprccv xispterm xispid xisp.1 if [ ! -d $(DESTDIR)$(BINX11) ]; then \ $(INSTALL) -d $(DESTDIR)$(BINX11); fi - $(INSTALL) -g $(GROUP) -m 750 -o $(XISPUSER) -s \ + $(INSTALL) -m 750 -s \ xisp $(DESTDIR)$(BINX11)/xisp if [ $(XISPUSER) != root ]; then \ chmod 4750 $(DESTDIR)$(BINX11)/xisp; fi if [ ! -d $(DESTDIR)$(USRLIBPPP) ]; then \ $(INSTALL) -d $(DESTDIR)$(USRLIBPPP); fi - $(INSTALL) -g $(GROUP) -m 750 -o $(XISPUSER) -s \ + $(INSTALL) -m 750 -s \ xispdial $(DESTDIR)$(USRLIBPPP)/xispdial if [ $(XISPUSER) != root ]; then \ chmod 4750 $(DESTDIR)$(USRLIBPPP)/xispdial; fi - $(INSTALL) -g $(GROUP) -m 750 -o root -s \ + $(INSTALL) -m 750 -s \ xispterm $(DESTDIR)$(USRLIBPPP)/xispterm if [ ! -d $(DESTDIR)$(USRLOCAL) ]; then \ $(INSTALL) -d $(DESTDIR)$(USRLOCAL); fi - $(INSTALL) -g $(GROUP) -m 750 -o $(XISPUSER) -s \ + $(INSTALL) -m 750 -s \ xisprccv $(DESTDIR)$(USRLOCAL)/xisprccv if [ $(XISPUSER) != root ]; then \ chmod 4750 $(DESTDIR)$(USRLOCAL)/xisprccv; fi - $(INSTALL) -g $(GROUP) -m 750 -o root -s \ + $(INSTALL) -m 750 -s \ xispid $(DESTDIR)$(USRLOCAL)/xispid # if [ ! -d $(DESTDIR)$(OPTSDIR) ]; then \ # $(INSTALL) -d $(DESTDIR)$(OPTSDIR); fi @@ -385,44 +385,53 @@ # options.xisp $(DESTDIR)$(OPTSDIR)/options.xisp if [ ! -d $(DESTDIR)$(MANDIR) ]; then \ $(INSTALL) -d $(DESTDIR)$(MANDIR); fi - $(INSTALL) -g $(GROUP) -m 644 -o root \ + $(INSTALL) -m 644 \ xisp.1 $(DESTDIR)$(MANDIR)/xisp.1 sed -e s/__XISPGROUP/$(GROUP)/ \ - -e sM__XISPIDM/$(DESTDIR)$(USRLOCAL)/xispidM \ + -e sM__XISPIDM$(USRLOCAL)/xispidM \ < ip-up.xisp > ip-up.install sed -e s/__XISPGROUP/$(GROUP)/ \ - -e sM__XISPIDM/$(DESTDIR)$(USRLOCAL)/xispidM \ + -e sM__XISPIDM$(USRLOCAL)/xispidM \ < ip-down.xisp > ip-down.install if [ ! -d $(DESTDIR)$(INSTPPPDIR) ]; then \ $(INSTALL) -d $(DESTDIR)$(INSTPPPDIR); fi if [ -f $(DESTDIR)$(INSTPPPDIR)/ip-up ]; then \ mv -f $(DESTDIR)$(INSTPPPDIR)/ip-up \ $(DESTDIR)$(INSTPPPDIR)/ip-up.bak; fi - $(INSTALL) -g $(GROUP) -m 750 -o root \ - ip-up.install $(DESTDIR)$(INSTPPPDIR)/ip-up + $(INSTALL) -m 750 \ + ip-up.install $(DESTDIR)$(INSTPPPDIR)/ip-up.xisp if [ -f $(DESTDIR)$(INSTPPPDIR)/ip-down ]; then \ mv -f $(DESTDIR)$(INSTPPPDIR)/ip-down \ $(DESTDIR)$(INSTPPPDIR)/ip-down.bak; fi - $(INSTALL) -g $(GROUP) -m 750 -o root \ - ip-down.install $(DESTDIR)$(INSTPPPDIR)/ip-down + $(INSTALL) -m 750 \ + ip-down.install $(DESTDIR)$(INSTPPPDIR)/ip-down.xisp rm -f ip-up.install ip-down.install - sed -e sM__DEVICEM$(MODEM_PATH)M \ - < xisp.peers.device > xisp_$(MODEM_DEV) - sed -e sM__DIALER_PATHM$(DESTDIR)$(USRLIBPPP)M \ + for i in $(MODEM_DEVS); do \ + sed -e sM__DEVICEM/dev/$${i}M \ + < xisp.peers.device > xisp_$${i}; \ + done + sed -e sM__DIALER_PATHM$(USRLIBPPP)M \ < xisp.peers.dialer > xisp_dialer if [ ! -d $(DESTDIR)$(INSTPPPDIR)/peers ]; then \ $(INSTALL) -d $(DESTDIR)$(INSTPPPDIR)/peers; fi - if [ -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$(MODEM_DEV) ]; then \ - mv -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$(MODEM_DEV) \ - $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$(MODEM_DEV).bak; fi - $(INSTALL) -g $(GROUP) -m 640 -o root \ - xisp_$(MODEM_DEV) $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$(MODEM_DEV) + for i in $(MODEM_DEVS); do \ + if [ -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$${i} ]; then \ + mv -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$${i} \ + $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$${i}.bak; fi; \ + done + for i in $(MODEM_DEVS); do \ + $(INSTALL) -m 640 \ + xisp_$$i $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$${i}; \ + done if [ -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_dialer ]; then \ mv -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_dialer \ $(DESTDIR)$(INSTPPPDIR)/peers/xisp_dialer.bak; fi - $(INSTALL) -g $(GROUP) -m 640 -o root \ + $(INSTALL) -m 640 \ xisp_dialer $(DESTDIR)$(INSTPPPDIR)/peers/xisp_dialer - rm -f xisp_$(MODEM_DEV) xisp_dialer + for i in $(MODEM_DEVS); do \ + rm -f xisp_$${i}; \ + done + rm -f xisp_dialer clean: rm -f *.o xisp xispdial xisprccv xispterm xispid xisp.xpm xisp.1 @@ -434,10 +443,12 @@ $(DESTDIR)$(USRLOCAL)/xisprccv \ $(DESTDIR)$(USRLOCAL)/xispid \ $(DESTDIR)$(MANDIR)/xisp.1 \ - $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$(MODEM_DEV) \ - $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$(MODEM_DEV).bak \ $(DESTDIR)$(INSTPPPDIR)/peers/xisp_dialer \ $(DESTDIR)$(INSTPPPDIR)/peers/xisp_dialer.bak + for i in $(MODEM_DEVS); do \ + rm -f $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$${i} \ + $(DESTDIR)$(INSTPPPDIR)/peers/xisp_$${i}.bak; \ + done mv -f $(DESTDIR)$(INSTPPPDIR)/ip-up \ $(DESTDIR)$(INSTPPPDIR)/ip-up.xisp if [ -f $(DESTDIR)$(INSTPPPDIR)/ip-up.bak ]; then \