makeroot: zero out subsecond component of time= keywords
[freebsd-src.git] / contrib / dma / Makefile
blobaed2ef7246cf834231a2fa517fa2b1063c002ea0
2 # Depending on your operating system, you might want to influence
3 # the conditional inclusion of some helper functions:
5 # Define HAVE_* (in caps) if your system already provides:
6 # reallocf
7 # strlcpy
8 # getprogname
11 SH?= sh
13 version= $(shell ${SH} get-version.sh)
14 debversion= $(shell ${SH} get-version.sh | sed -Ee 's/^v//;s/[.]([[:digit:]]+)[.](g[[:xdigit:]]+)$$/+\1+\2/')
16 CC?= gcc
17 CFLAGS?= -O -pipe
18 LDADD?= -lssl -lcrypto -lresolv
20 CFLAGS+= -Wall -DDMA_VERSION='"${version}"' -DLIBEXEC_PATH='"${LIBEXEC}"' -DCONF_PATH='"${CONFDIR}"'
22 INSTALL?= install -p
23 CHGRP?= chgrp
24 CHMOD?= chmod
26 PREFIX?= /usr/local
27 SBIN?= ${PREFIX}/sbin
28 LIBEXEC?= ${PREFIX}/lib
29 CONFDIR?= /etc/dma
30 MAN?= ${PREFIX}/share/man
31 VAR?= /var
32 DMASPOOL?= ${VAR}/spool/dma
33 VARMAIL?= ${VAR}/mail
34 SYMLINK?= -s # or empty to create hard link
36 YACC?= yacc
37 LEX?= lex
38 LN?= ln
40 OBJS= aliases_parse.o aliases_scan.o base64.o conf.o crypto.o
41 OBJS+= dma.o dns.o local.o mail.o net.o spool.o util.o
42 OBJS+= dfcompat.o
44 all: dma dma-mbox-create
46 clean:
47 -rm -f .depend dma dma-mbox-create *.[do]
48 -rm -f aliases_parse.[ch] aliases_scan.c
50 install: all
51 ${INSTALL} -d ${DESTDIR}${SBIN}
52 ${INSTALL} -d ${DESTDIR}${MAN}/man8 ${DESTDIR}${LIBEXEC}
53 ${INSTALL} -m 2755 -o root -g mail dma ${DESTDIR}${SBIN}
54 ${INSTALL} -m 4754 -o root -g mail dma-mbox-create ${DESTDIR}${LIBEXEC}
55 ${INSTALL} -m 0644 dma.8 ${DESTDIR}${MAN}/man8/
57 sendmail-link:
58 cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma sendmail
60 mailq-link:
61 cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma mailq
63 install-spool-dirs:
64 ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${DMASPOOL}
65 ${INSTALL} -d -m 2775 -o root -g mail ${DESTDIR}${VARMAIL}
67 permissions:
68 -${CHGRP} mail ${DESTDIR}${VARMAIL}/*
69 -${CHMOD} g+w ${DESTDIR}${VARMAIL}/*
70 -${CHMOD} 660 ${DESTDIR}${DMASPOOL}/flush
72 install-etc:
73 ${INSTALL} -d ${DESTDIR}${CONFDIR}
74 @if [ -e ${DESTDIR}${CONFDIR}/dma.conf ]; then \
75 echo "Not overwriting ${DESTDIR}${CONFDIR}/dma.conf."; \
76 else \
77 echo ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \
78 ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \
80 @if [ -e ${DESTDIR}${CONFDIR}/auth.conf ]; then \
81 echo "Not overwriting ${DESTDIR}${CONFDIR}/auth.conf."; \
82 else \
83 echo ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \
84 ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \
87 aliases_parse.c: aliases_parse.y
88 ${YACC} -d -o aliases_parse.c aliases_parse.y
90 aliases_scan.c: aliases_scan.l
91 ${LEX} -t aliases_scan.l > aliases_scan.c
93 .SUFFIXES: .c .o
95 .c.o:
96 ${CC} ${CFLAGS} ${CPPFLAGS} -include dfcompat.h -o $@ -c $<
98 dma: ${OBJS}
99 ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
102 dch:
103 dch --release-heuristic changelog -v ${debversion}
106 ppa:
107 @if [ -z '${DEB_DIST}' ]; then echo "please set DEB_DIST to build"; exit 1; fi
108 dch -v "${debversion}~${DEB_DIST}" -D ${DEB_DIST} "${DEB_DIST} build" -b
109 debuild -S -sa
110 ver=$$(dpkg-parsechangelog -n1 | awk '$$1 == "Version:" { print $$2 }'); \
111 dput ppa:corecode/dma ../dma_$${ver}_source.changes