openbsd-ports/comms/xcept/patches/patch-ceptd_Makefile
pvalchev bcb9e8d8e9 This ridiculous port installs the daemon 'ceptd' as setuid root and advises
to be run as root via inetd, while it really only needs access to the modem
It also needs INSTALL/DEINSTALL scripts to handle the configuration files,
etc.  Try to bring it to a usable state, and advise the user to run it
as follows:

xcept   stream  tcp     nowait  xcept   ${PREFIX}/libexec/ceptd ceptd

After creating a 'xcept' user belonging in group 'dialer'.  And, no
longer install this setuid root, which is really not needed.

XXX The user creation and the configuration files installation should
be automatic, but this will have to do for now and help the users.
2002-10-01 06:51:05 +00:00

143 lines
4.7 KiB
Plaintext

$OpenBSD: patch-ceptd_Makefile,v 1.2 2002/10/01 06:51:06 pvalchev Exp $
--- ceptd/Makefile.orig Wed Jun 15 09:10:59 1994
+++ ceptd/Makefile Fri Sep 27 02:18:23 2002
@@ -1,21 +1,24 @@
# directories:
OWNER= root
-GROUP= sys
-EXECMODE= 6750
-
-BINDIR= /usr/local/bin# directory for the executable ceptd
-MANDIR= /usr/local/man/manl# directory for the ceptds manpage
-ETCDIR= /usr/local/etc# directory for 'init file' and 'users file'
+GROUP= bin
+EXECMODE= 0555
+MANMODE= 0644
+
+BINDIR= ${PREFIX}/libexec# directory for the executable ceptd
+MANDIR= ${PREFIX}/man/man8# directory for the ceptds manpage
+ETCDIR= ${SYSCONFDIR}# directory for 'init file' and 'users file'
# defaults for the ceptd :
-DEFAULTINITFILENAME= $(ETCDIR)/init.cept# modems default init file
-DEFAULTUSERSFILENAME= $(ETCDIR)/users.cept# file with allowed users
-DEFAULTLOGFILENAME= /tmp/log.cept# logfile for user online times
+DEFAULTINITFILENAME= $(ETCDIR)/cept.init# modems default init file
+DEFAULTUSERSFILENAME= $(ETCDIR)/cept.users# file with allowed users
+DEFAULTLOGFILENAME= /var/log/log.cept# logfile for user online times
DEFAULTMODEM= /dev/modem# char. special file for modem
DEFAULTSPEED= 2400# modem baud rate
DEFAULTSOCKETPORT= 20005# socket port for connections
-LOCKDIR= /var/spool/locks# lock dir for uucp-locks
+LOCKDIR= /var/spool/lock# lock dir for uucp-locks
+
+MANPAGE= ceptd.8
# define these flags in $(DEFS):
@@ -54,86 +57,49 @@ DEFS= -DDEFAULTSOCKETPORT=$(DEFAULTSOCKE
-DDEFAULTINITFILENAME=\"$(DEFAULTINITFILENAME)\"\
-DDEFAULTUSERSFILENAME=\"$(DEFAULTUSERSFILENAME)\"\
-DDEFAULTLOGFILENAME=\"$(DEFAULTLOGFILENAME)\"\
- -DSVR4
+ -DBSD
# -DISDN\
# the GNU C-compiler:
-CC = gcc
-CCOPTS = -O
-CCFLAGS = -Wswitch -Wcomment -Wshadow -Wpointer-arith -Wcast-qual\
- -Wtrigraphs# -Wunused
+#CC = gcc
+#CCOPTS = -O
+#CCFLAGS = -Wswitch -Wcomment -Wshadow -Wpointer-arith -Wcast-qual\
+# -Wtrigraphs# -Wunused
# ... the lex is ...
-LEX = flex
+#LEX =flex
##############################################################################
-all: ceptd ceptd.8
+all: ceptd ${MANPAGE}
OBJS = ceptd.o level2.o modeminit.o socket.o term.o lex.yy.o isdn.o
SRC = ceptd.c level2.c modeminit.c socket.c term.c lex.yy.c isdn.c
INC = config.h cept.h ../xcept/protocol.h
-.c.o: makefile config.h cept.h ../xcept/protocol.h
- @echo
- @echo '########################## $@ ########################'
- $(CC) -c $(CCOPTS) $(CCFLAGS) $(DEFS) $*.c
+.c.o: config.h cept.h ../xcept/protocol.h
+ $(CC) -c $(CFLAGS) $(DEFS) $*.c
lex.yy.c: lex_yy
- @echo
- @echo '########################## $@ ########################'
$(LEX) -s -i -p lex_yy
ceptd: $(OBJS)
- @echo
- @echo '########################## $@ ########################'
- $(CC) $(OBJS) -L. -o ceptd -lnsl -lsocket
- @echo "$@ finished"
-
-install: ceptd ceptd.8
- @echo
- @echo '########################## $@ #################################'
- strip ceptd
- mv ceptd $(BINDIR)
- chown $(OWNER) $(BINDIR)/ceptd
- chgrp $(GROUP) $(BINDIR)/ceptd
- chmod $(EXECMODE) $(BINDIR)/ceptd
- mv ceptd.8 $(MANDIR)
- chown $(OWNER) $(MANDIR)/ceptd.8
- chgrp $(GROUP) $(MANDIR)/ceptd.8
- chmod 644 $(MANDIR)/ceptd.8
- @echo
- @echo '**************************************************************'
- @echo '**************************************************************'
- @echo "------>>> Now do the following steps:"
- @echo
- @echo '1)' add the following line to your /etc/inetd.conf file:
- @echo " cept stream tcp nowait $(OWNER)"\
- $(BINDIR)/ceptd ceptd
- @echo
- @echo '2)' add the following line to your /etc/services file:
- @echo " cept $(DEFAULTSOCKETPORT)/tcp ceptd"
- @echo
- @echo '3)' copy the ../etc/users.cept file to $(DEFAULTUSERSFILENAME)\
- and edit it.
- @echo
- @echo '4)' copy the ../etc/init.cept file to $(DEFAULTINITFILENAME)\
- and edit it.
- @echo
- @echo '5)' read the ceptd manual.
- @echo '***************************************************************'
- @echo '***************************************************************'
+ $(CC) $(OBJS) -L. -o ceptd
+
+install: ceptd ${MANPAGE}
+ ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m ${EXECMODE} ceptd ${BINDIR}/ceptd
+ ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m ${MANMODE} ${MANPAGE} ${MANDIR}/${MANPAGE}
-ceptd.8: ceptd.8.template
+${MANPAGE}: ceptd.8.template
sed -e 's|--- The permissions file.|$(DEFAULTUSERSFILENAME)|g'\
-e 's|--- The initalization file.|$(DEFAULTINITFILENAME)|g'\
-e 's|--- The log file.|$(DEFAULTLOGFILENAME)|g'\
- ceptd.8.template > ceptd.8
+ ceptd.8.template >${MANPAGE}
clean:
- rm -f ceptd.8 *.o TAGS ceptd
+ rm -f ${MANPAGE} *.o TAGS ceptd
veryclean:
rm -f ceptd.8 *.o TAGS ceptd lex.yy.c *.zoo