1 dnl $Id: Makefile.m4,v 8.91.2.4 2002/09/09 02:48:54 gshapiro Exp $
2 include(confBUILDTOOLSDIR`/M4/switch.m4')
4 define(`confREQUIRE_LIBSM', `true')
5 bldPRODUCT_START(`executable', `sendmail')
6 define(`bldBIN_TYPE', `G')
7 define(`bldINSTALL_DIR', `')
8 define(`bldSOURCES', `main.c alias.c arpadate.c bf.c collect.c conf.c control.c convtime.c daemon.c deliver.c domain.c envelope.c err.c headers.c macro.c map.c mci.c milter.c mime.c parseaddr.c queue.c readcf.c recipient.c sasl.c savemail.c sfsasl.c shmticklib.c sm_resolve.c srvrsmtp.c stab.c stats.c sysexits.c timers.c tls.c trace.c udb.c usersmtp.c util.c version.c ')
9 PREPENDDEF(`confENVDEF', `confMAPDEF')
11 bldPUSH_SMLIB(`smutil')
13 dnl hack: /etc/mail is not defined as "location of .cf" in the build system
14 define(`bldTARGET_INST_DEP', ifdef(`confINST_DEP', `confINST_DEP',
15 `${DESTDIR}/etc/mail/submit.cf ${DESTDIR}${MSPQ}'))dnl
16 define(`bldTARGET_LINKS', ifdef(`confLINKS', `confLINKS',
17 `${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat')
20 # location of sendmail statistics file (usually /etc/mail/ or /var/log)
21 STDIR= ifdef(`confSTDIR', `confSTDIR', `/etc/mail')
23 # statistics file name
24 STFILE= ifdef(`confSTFILE', `confSTFILE', `statistics')
25 MSPSTFILE=ifdef(`confMSP_STFILE', `confMSP_STFILE', `sm-client.st')
27 # full path to installed statistics file (usually ${STDIR}/statistics)
28 STPATH= ${STDIR}/${STFILE}
30 # location of sendmail helpfile file (usually /etc/mail)
31 HFDIR= ifdef(`confHFDIR', `confHFDIR', `/etc/mail')
33 # full path to installed help file (usually ${HFDIR}/helpfile)
34 HFFILE= ${HFDIR}/ifdef(`confHFFILE', `confHFFILE', `helpfile')
36 ifdef(`confSMSRCADD', `APPENDDEF(`confSRCADD', `confSMSRCADD')')
37 ifdef(`confSMOBJADD', `APPENDDEF(`confOBJADD', `confSMOBJADD')')
39 bldPUSH_TARGET(`statistics')
40 divert(bldTARGETS_SECTION)
42 ${CP} /dev/null statistics
44 ${DESTDIR}/etc/mail/submit.cf:
45 @echo "Please read INSTALL if anything fails while installing the binary."
46 @echo "${DESTDIR}/etc/mail/submit.cf will be installed now."
47 cd ${SRCDIR}/cf/cf && make install-submit-cf
49 MSPQ=ifdef(`confMSP_QUEUE_DIR', `confMSP_QUEUE_DIR', `/var/spool/clientmqueue')
52 @echo "Please read INSTALL if anything fails while installing the binary."
53 @echo "You must have setup a new user ${MSPQOWN} and a new group ${GBINGRP}"
54 @echo "as explained in sendmail/SECURITY."
55 mkdir -p ${DESTDIR}${MSPQ}
56 chown ${MSPQOWN} ${DESTDIR}${MSPQ}
57 chgrp ${GBINGRP} ${DESTDIR}${MSPQ}
58 chmod 0770 ${DESTDIR}${MSPQ}
62 ifdef(`confSETUSERID_INSTALL', `bldPUSH_INSTALL_TARGET(`install-set-user-id')')
63 ifdef(`confMTA_INSTALL', `bldPUSH_INSTALL_TARGET(`install-sm-mta')')
64 ifdef(`confNO_HELPFILE_INSTALL',, `bldPUSH_INSTALL_TARGET(`install-hf')')
65 ifdef(`confNO_STATISTICS_INSTALL',, `bldPUSH_INSTALL_TARGET(`install-st')')
66 divert(bldTARGETS_SECTION)
68 install-set-user-id: bldCURRENT_PRODUCT ifdef(`confNO_HELPFILE_INSTALL',, `install-hf') ifdef(`confNO_STATISTICS_INSTALL',, `install-st') ifdef(`confNO_MAN_BUILD',, `install-docs')
69 ${INSTALL} -c -o ${S`'BINOWN} -g ${S`'BINGRP} -m ${S`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}
70 for i in ${sendmailTARGET_LINKS}; do \
72 ${LN} ${LNOPTS} ${M`'BINDIR}/sendmail $$i; \
75 define(`confMTA_LINKS', `${DESTDIR}${UBINDIR}/newaliases ${DESTDIR}${UBINDIR}/mailq ${DESTDIR}${UBINDIR}/hoststat ${DESTDIR}${UBINDIR}/purgestat')
76 install-sm-mta: bldCURRENT_PRODUCT
77 ${INSTALL} -c -o ${M`'BINOWN} -g ${M`'BINGRP} -m ${M`'BINMODE} bldCURRENT_PRODUCT ${DESTDIR}${M`'BINDIR}/sm-mta
78 for i in confMTA_LINKS; do \
80 ${LN} ${LNOPTS} ${M`'BINDIR}/sm-mta $$i; \
84 if [ ! -d ${DESTDIR}${HFDIR} ]; then mkdir -p ${DESTDIR}${HFDIR}; else :; fi
85 ${INSTALL} -c -o ${UBINOWN} -g ${UBINGRP} -m 444 helpfile ${DESTDIR}${HFFILE}
87 install-st: statistics
88 if [ ! -d ${DESTDIR}${STDIR} ]; then mkdir -p ${DESTDIR}${STDIR}; else :; fi
89 ${INSTALL} -c -o ${SBINOWN} -g ${UBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics ${DESTDIR}${STPATH}
91 install-submit-st: statistics ${DESTDIR}${MSPQ}
92 ${INSTALL} -c -o ${MSPQOWN} -g ${GBINGRP} -m ifdef(`confSTMODE', `confSTMODE', `0600') statistics ${DESTDIR}${MSPQ}/${MSPSTFILE}
97 bldPRODUCT_START(`manpage', `sendmail')
98 define(`bldSOURCES', `sendmail.8 aliases.5 mailq.1 newaliases.1')