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 >
Makefile  |  1997-03-26  |  8KB  |  230 lines

  1. # SCCS info  Makefile 2.6 96/11/11
  2. #
  3. # ========================== COPYRIGHT NOTICE =============================
  4. # This package srialpop is written by and copyright Rudi van Houten
  5. # <R.vanHouten@cc.ruu.nl>, it is tested and used now at ACCU (Ac.Comp.
  6. # Centr.Utrecht, the Netherlands) for several years.
  7. # The package consists of four files:
  8. #     srialpop.c  the C source of the program
  9. #     Makefile    to build and eventually install the package
  10. #     README      an old documentation describing the package
  11. #     INSTALL     a newer document with concise installation instructions
  12. # I grant everybody the right to use the package and eventually
  13. # adapt it to local requirements. Please document your changes in the
  14. # program source with comments explicitely stating that a modification
  15. # to the original package has been made. I don't want to be blamed for
  16. # your errors nor get the praise for your inventions.
  17. # Also everybody has the right to bundle this package with other software
  18. # (e.g. a POP client) on distribution media, but THEN THE UNCHANGED VERSION
  19. # MUST BE DISTRIBUTED, and no extra fee may be charged for the presence
  20. # of srialpop in the bundle. If there is a need to modify srialpop for
  21. # special purposes these modification should be made available as a separate
  22. # file (e.g. a diff file to be applied with Larry Wall's patch program).
  23. # I present this package as is, feeling it can be of use. But no
  24. # guarantees are given about its proper working or behaviour. It has
  25. # been used at ACCU for some years now without troubles, so I think it may
  26. # be bug free. But I cannot be held responsible for any damage or other
  27. # misery resulting from using srialpop.
  28. # ===========================================================================
  29.  
  30. # Makefile to compile srialpop.
  31. # The "make install" will create an environment for pseudo user ${SRIALPOP}
  32. # as described in README and INSTALL.
  33. # That installation will place the program in the directory defined
  34. # with symbol DEST, default the home directory of the user ${SRIALPOP}.
  35. # Also a .hushlogin, .cshrc, .login and .profile are created there
  36. # and a file .forward will be removed. The username ${SRIALPOP} will be
  37. # placed in /etc/ftpusers to disable ftp access.
  38. # The user ${SRIALPOP} is asumed to be configured to login with
  39. # the program srialpop as "loginshell".
  40. #
  41. # If that scheme isn't adopted you can use a "make instbin" to simply
  42. # place the program srialpop in the directory defined by ${HOMEBIN}.
  43. #
  44. #########################################################################
  45.  
  46. #DEST=        /home/srialpop
  47. DEST=        /usr/people/local/srialpop
  48. SRIALPOP=    srialpop
  49. GROUP=        mailusr
  50. HOMEBIN=    ${HOME}/bin
  51.  
  52. # >>>>>>>>>>>>>>>>>>>>
  53. # for the meaning of the definitions within DEFS see below
  54. DEFS= -DLOGGING=LOGBSD43 -DFLOWRTSCTS \
  55.     -DRMPOPMSG=\"/usr/local/bin/rmpopmsg\"    # in use at ACCU
  56.  
  57. # Next two lines are probably good definitions on many systems,
  58. # don't change it here if these do not apply on your system but
  59. # add a section for your particular system below to override
  60. # these values.
  61. # (and mail me these additions please R.vanHouten@cc.ruu.nl.)
  62. CFLAGS= ${DEFS} -O
  63. LDFLAGS=
  64.  
  65. # The symbol DEFS can be defined to influence some properties
  66. # of the program srialpop, it will be evaluated with CFLAGS.
  67. # The follwing definitions can be included in DEFS:
  68. # -DEXTRATTYFLAGS    On some systems it can be needed to enable or
  69. #            disable some tty-flags I didn't consider.
  70. #            This can be done by defining the symbol
  71. #            EXTRATTYFLAGS and writing code in routine
  72. #            extrattyflags.
  73. # -DFLOWRTSCTS        Use hardware flow control (RTS/CTS).
  74. #            This can not be done with old BSD sgtty.h.
  75. # -DFLOWXONXOFF        use software flow control (XON/XOFF, ^S/^Q).
  76. # -DLOGGING=ONFILE    Produce logging on the file srialpop.log
  77. # -DLOGGING-LOGBSD42    Produce logging using the BSD4.2 syslog daemon
  78. # -DLOGGING=LOGBSD43    Produce logging using the BSD4.3 syslog daemon
  79. #            If none of these is defined no log is written.
  80. # -DNO_SMTP             Don't allow access to SMTP service, mail can
  81. #                       only be sent with the "XTND XMIT" extension to
  82. #                       POP3.
  83. #
  84. # Values that are supplied with the DEFS symbol will override the
  85. # defaults. coded in the srialpop.c source file
  86. #
  87. # For the timeout the default is:
  88. #    -DTIMEOUT=300
  89. # if syslog is used. The defaults are:
  90. #    -DLOGLEVEL=LOG_INFO -DLOGFACILITY=LOG_LOCAL0
  91. #
  92. # These values can be redefined in the definition of DEFS above.
  93. #
  94.  
  95. # the default set works for SunOS-4.1.3 (and probably 4.1.2 too).
  96.  
  97. # also IBM's AIX-3.2 works with the default set
  98. # but define FLOWXONXOFF, not FLOWRTSCTS.
  99. DEFS= -DLOGGING=LOGBSD43 -DFLOWXONXOFF \
  100.     -DRMPOPMSG=\"/usr/local/bin/rmpopmsg\"    # in use at ACCU
  101.  
  102. # use this on Digital's Alpha OSF/1 
  103. #CFLAGS= ${DEFS} -O3 -std1
  104. #LDFLAGS=
  105.  
  106. # use this on Silicon Graphics systems (IRIX-5.3)
  107. #CFLAGS= ${DEFS} -ansi -O
  108. #LDFLAGS= -lc_s -s
  109.  
  110. # use this on Solaris-2.4 (SunOS-5.4)
  111. #CFLAGS= ${DEFS} -O
  112. #LDFLAGS= -lsocket -lnsl
  113.  
  114. # use this on old SysV.3 with a syslogd locally added
  115. # eg. from John F. Haugh II that looks like BSD-4.3 syslog
  116. # be aware that these systems generally don't support RTS/CTS
  117. #CFLAGS= ${DEFS} -O -I/usr/local/include
  118. #LDFLAGS= -L/usr/local/lib -lsyslog
  119.  
  120.  
  121. #######################################################################
  122. #######################################################################
  123. #######################################################################
  124.  
  125. # ----------------------------------------------------------------------
  126. # I don't expect changes will be needed below here
  127. # ----------------------------------------------------------------------
  128. SHELL=/bin/sh
  129. FILES=        README INSTALL Makefile srialpop.c
  130.  
  131. srialpop:    srialpop.o
  132.         ${CC} $? ${LDFLAGS} -o $@
  133.  
  134. srialpop.o:    hdrs.h
  135.  
  136. hdrs.h:
  137.         @( \
  138.             rm -f hdrs.h; touch hdrs.h; \
  139.             if [ -f /usr/include/unistd.h ]; then \
  140.                 echo '#include <unistd.h>' >>hdrs.h; \
  141.             fi; \
  142.             if [ -f /usr/include/strings.h ]; then \
  143.                 echo '#include <strings.h>' >> hdrs.h; \
  144.             fi; \
  145.             if [ -f /usr/include/termios.h ]; then \
  146.                 echo '#define TERM_H TERMIOS' >> hdrs.h; \
  147.             elif [ -f /usr/include/termio.h ]; then \
  148.                 echo '#define TERM_H TERMIO' >> hdrs.h; \
  149.             elif [ -f /usr/include/sgtty.h ]; then \
  150.                 echo '#define TERM_H SGTTY' >> hdrs.h; \
  151.             else \
  152.                 echo 'No termios.h/termio.h/sgtty.h found'; \
  153.                 echo 'Cannot correctly compile srialpop.c'; \
  154.                 exit; \
  155.             fi; \
  156.             echo "    File hdrs.h created:"; \
  157.             echo ""; \
  158.             cat hdrs.h | while read LINE; \
  159.                 do echo "        $$LINE"; done; \
  160.             echo "" \
  161.         )
  162.  
  163. install:    srialpop
  164.         @grep "^${SRIALPOP}" /etc/passwd >/dev/null 2>&1 \
  165.             || ( \
  166.             echo ""; \
  167.             echo "There is no user ${SRIALPOP} in this system!!!"; \
  168.             echo ".... create one with ${DEST} as home directory"; \
  169.             exit 1; \
  170.               )
  171.         -mkdir ${DEST}
  172.         chown root ${DEST}
  173.         chgrp ${GROUP} ${DEST}
  174.         chmod 711 ${DEST}
  175.         cp srialpop ${DEST}
  176.         strip ${DEST}/srialpop
  177.         chown root ${DEST}/srialpop
  178.         chgrp ${GROUP} ${DEST}/srialpop
  179.         chmod 511 ${DEST}/srialpop
  180.         touch ${DEST}/.hushlogin
  181.         echo "exit" > ${DEST}/.login
  182.         -ln ${DEST}/.login ${DEST}/.cshrc
  183.         -ln ${DEST}/.login ${DEST}/.profile
  184.         chown root ${DEST}/.hushlogin ${DEST}/.login
  185.         chgrp ${GROUP} ${DEST}/.hushlogin ${DEST}/.login
  186.         chmod 444 ${DEST}/.hushlogin ${DEST}/.login
  187.         -rm -f ${DEST}/.forward
  188.         @if [ ! -f /etc/ftpusers ]; then \
  189.             echo "${SRIALPOP}" > /etc/ftpusers; \
  190.             chown root /etc/ftpuser; \
  191.             chmod 600 /etc/ftpusers; \
  192.             echo /etc/ftpusers created; \
  193.             ls -l /etc/ftpusers; \
  194.         else \
  195.             grep ${SRIALPOP} /etc/ftpusers  >/dev/null 2>&1 \
  196.                 || ( \
  197.                 echo "${SRIALPOP}" >> /etc/ftpusers; \
  198.                 echo ${SRIALPOP} added to /etc/ftpusers; \
  199.                    ) \
  200.         fi
  201.         @echo ""
  202.         @echo "If possible, disable the possibility to \"su\" to ${SRIALPOP}"
  203.         @echo ""
  204.         @echo Done....
  205.  
  206. instbin:    srialpop ${HOMEBIN}
  207.         cp srialpop ${HOMEBIN}
  208.         strip ${HOMEBIN}/srialpop
  209.         chmod 511 ${HOMEBIN}/srialpop
  210.  
  211. clean:
  212.         rm -f core srialpop *.o hdrs.h srialpop.shar srialpop.tar
  213.  
  214. shar:        srialpop.shar
  215.  
  216. tar:        srialpop.tar
  217.  
  218. srialpop.shar:    ${FILES}
  219.         shar ${FILES} > srialpop.shar
  220.  
  221. srialpop.tar:    ${FILES}
  222.         tar vfc srialpop.tar ${FILES}
  223.  
  224. ${FILES}:
  225.         sccs get $@
  226.