home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.qualcomm.com
/
2014.06.ftp.qualcomm.com.tar
/
ftp.qualcomm.com
/
eudora
/
servers
/
unix
/
srialpop.shar
/
Makefile
< prev
next >
Wrap
Makefile
|
1997-03-26
|
8KB
|
230 lines
# SCCS info Makefile 2.6 96/11/11
#
# ========================== COPYRIGHT NOTICE =============================
# This package srialpop is written by and copyright Rudi van Houten
# <R.vanHouten@cc.ruu.nl>, it is tested and used now at ACCU (Ac.Comp.
# Centr.Utrecht, the Netherlands) for several years.
#
# The package consists of four files:
# srialpop.c the C source of the program
# Makefile to build and eventually install the package
# README an old documentation describing the package
# INSTALL a newer document with concise installation instructions
#
# I grant everybody the right to use the package and eventually
# adapt it to local requirements. Please document your changes in the
# program source with comments explicitely stating that a modification
# to the original package has been made. I don't want to be blamed for
# your errors nor get the praise for your inventions.
#
# Also everybody has the right to bundle this package with other software
# (e.g. a POP client) on distribution media, but THEN THE UNCHANGED VERSION
# MUST BE DISTRIBUTED, and no extra fee may be charged for the presence
# of srialpop in the bundle. If there is a need to modify srialpop for
# special purposes these modification should be made available as a separate
# file (e.g. a diff file to be applied with Larry Wall's patch program).
#
# I present this package as is, feeling it can be of use. But no
# guarantees are given about its proper working or behaviour. It has
# been used at ACCU for some years now without troubles, so I think it may
# be bug free. But I cannot be held responsible for any damage or other
# misery resulting from using srialpop.
# ===========================================================================
# Makefile to compile srialpop.
# The "make install" will create an environment for pseudo user ${SRIALPOP}
# as described in README and INSTALL.
# That installation will place the program in the directory defined
# with symbol DEST, default the home directory of the user ${SRIALPOP}.
# Also a .hushlogin, .cshrc, .login and .profile are created there
# and a file .forward will be removed. The username ${SRIALPOP} will be
# placed in /etc/ftpusers to disable ftp access.
# The user ${SRIALPOP} is asumed to be configured to login with
# the program srialpop as "loginshell".
#
# If that scheme isn't adopted you can use a "make instbin" to simply
# place the program srialpop in the directory defined by ${HOMEBIN}.
#
#########################################################################
#DEST= /home/srialpop
DEST= /usr/people/local/srialpop
SRIALPOP= srialpop
GROUP= mailusr
HOMEBIN= ${HOME}/bin
# >>>>>>>>>>>>>>>>>>>>
# for the meaning of the definitions within DEFS see below
DEFS= -DLOGGING=LOGBSD43 -DFLOWRTSCTS \
-DRMPOPMSG=\"/usr/local/bin/rmpopmsg\" # in use at ACCU
# Next two lines are probably good definitions on many systems,
# don't change it here if these do not apply on your system but
# add a section for your particular system below to override
# these values.
# (and mail me these additions please R.vanHouten@cc.ruu.nl.)
CFLAGS= ${DEFS} -O
LDFLAGS=
# The symbol DEFS can be defined to influence some properties
# of the program srialpop, it will be evaluated with CFLAGS.
# The follwing definitions can be included in DEFS:
# -DEXTRATTYFLAGS On some systems it can be needed to enable or
# disable some tty-flags I didn't consider.
# This can be done by defining the symbol
# EXTRATTYFLAGS and writing code in routine
# extrattyflags.
# -DFLOWRTSCTS Use hardware flow control (RTS/CTS).
# This can not be done with old BSD sgtty.h.
# -DFLOWXONXOFF use software flow control (XON/XOFF, ^S/^Q).
# -DLOGGING=ONFILE Produce logging on the file srialpop.log
# -DLOGGING-LOGBSD42 Produce logging using the BSD4.2 syslog daemon
# -DLOGGING=LOGBSD43 Produce logging using the BSD4.3 syslog daemon
# If none of these is defined no log is written.
# -DNO_SMTP Don't allow access to SMTP service, mail can
# only be sent with the "XTND XMIT" extension to
# POP3.
#
# Values that are supplied with the DEFS symbol will override the
# defaults. coded in the srialpop.c source file
#
# For the timeout the default is:
# -DTIMEOUT=300
# if syslog is used. The defaults are:
# -DLOGLEVEL=LOG_INFO -DLOGFACILITY=LOG_LOCAL0
#
# These values can be redefined in the definition of DEFS above.
#
# the default set works for SunOS-4.1.3 (and probably 4.1.2 too).
# also IBM's AIX-3.2 works with the default set
# but define FLOWXONXOFF, not FLOWRTSCTS.
DEFS= -DLOGGING=LOGBSD43 -DFLOWXONXOFF \
-DRMPOPMSG=\"/usr/local/bin/rmpopmsg\" # in use at ACCU
# use this on Digital's Alpha OSF/1
#CFLAGS= ${DEFS} -O3 -std1
#LDFLAGS=
# use this on Silicon Graphics systems (IRIX-5.3)
#CFLAGS= ${DEFS} -ansi -O
#LDFLAGS= -lc_s -s
# use this on Solaris-2.4 (SunOS-5.4)
#CFLAGS= ${DEFS} -O
#LDFLAGS= -lsocket -lnsl
# use this on old SysV.3 with a syslogd locally added
# eg. from John F. Haugh II that looks like BSD-4.3 syslog
# be aware that these systems generally don't support RTS/CTS
#CFLAGS= ${DEFS} -O -I/usr/local/include
#LDFLAGS= -L/usr/local/lib -lsyslog
#######################################################################
#######################################################################
#######################################################################
# ----------------------------------------------------------------------
# I don't expect changes will be needed below here
# ----------------------------------------------------------------------
SHELL=/bin/sh
FILES= README INSTALL Makefile srialpop.c
srialpop: srialpop.o
${CC} $? ${LDFLAGS} -o $@
srialpop.o: hdrs.h
hdrs.h:
@( \
rm -f hdrs.h; touch hdrs.h; \
if [ -f /usr/include/unistd.h ]; then \
echo '#include <unistd.h>' >>hdrs.h; \
fi; \
if [ -f /usr/include/strings.h ]; then \
echo '#include <strings.h>' >> hdrs.h; \
fi; \
if [ -f /usr/include/termios.h ]; then \
echo '#define TERM_H TERMIOS' >> hdrs.h; \
elif [ -f /usr/include/termio.h ]; then \
echo '#define TERM_H TERMIO' >> hdrs.h; \
elif [ -f /usr/include/sgtty.h ]; then \
echo '#define TERM_H SGTTY' >> hdrs.h; \
else \
echo 'No termios.h/termio.h/sgtty.h found'; \
echo 'Cannot correctly compile srialpop.c'; \
exit; \
fi; \
echo " File hdrs.h created:"; \
echo ""; \
cat hdrs.h | while read LINE; \
do echo " $$LINE"; done; \
echo "" \
)
install: srialpop
@grep "^${SRIALPOP}" /etc/passwd >/dev/null 2>&1 \
|| ( \
echo ""; \
echo "There is no user ${SRIALPOP} in this system!!!"; \
echo ".... create one with ${DEST} as home directory"; \
exit 1; \
)
-mkdir ${DEST}
chown root ${DEST}
chgrp ${GROUP} ${DEST}
chmod 711 ${DEST}
cp srialpop ${DEST}
strip ${DEST}/srialpop
chown root ${DEST}/srialpop
chgrp ${GROUP} ${DEST}/srialpop
chmod 511 ${DEST}/srialpop
touch ${DEST}/.hushlogin
echo "exit" > ${DEST}/.login
-ln ${DEST}/.login ${DEST}/.cshrc
-ln ${DEST}/.login ${DEST}/.profile
chown root ${DEST}/.hushlogin ${DEST}/.login
chgrp ${GROUP} ${DEST}/.hushlogin ${DEST}/.login
chmod 444 ${DEST}/.hushlogin ${DEST}/.login
-rm -f ${DEST}/.forward
@if [ ! -f /etc/ftpusers ]; then \
echo "${SRIALPOP}" > /etc/ftpusers; \
chown root /etc/ftpuser; \
chmod 600 /etc/ftpusers; \
echo /etc/ftpusers created; \
ls -l /etc/ftpusers; \
else \
grep ${SRIALPOP} /etc/ftpusers >/dev/null 2>&1 \
|| ( \
echo "${SRIALPOP}" >> /etc/ftpusers; \
echo ${SRIALPOP} added to /etc/ftpusers; \
) \
fi
@echo ""
@echo "If possible, disable the possibility to \"su\" to ${SRIALPOP}"
@echo ""
@echo Done....
instbin: srialpop ${HOMEBIN}
cp srialpop ${HOMEBIN}
strip ${HOMEBIN}/srialpop
chmod 511 ${HOMEBIN}/srialpop
clean:
rm -f core srialpop *.o hdrs.h srialpop.shar srialpop.tar
shar: srialpop.shar
tar: srialpop.tar
srialpop.shar: ${FILES}
shar ${FILES} > srialpop.shar
srialpop.tar: ${FILES}
tar vfc srialpop.tar ${FILES}
${FILES}:
sccs get $@