Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 111 lines (85 sloc) 3.009 kb
86e4d16 Add the DragonFly Mail Agent dma(8) to the base.
Matthias Schmidt authored
1 #
0eaf058 corecode flip the polarity of the compatibility macros to HAVE_*
authored
2 # Depending on your operating system, you might want to influence
3 # the conditional inclusion of some helper functions:
4 #
5 # Define HAVE_* (in caps) if your system already provides:
6 # reallocf
7 # strlcpy
8 # getprogname
f8352d6 corecode use the plain makefile as default
authored
9 #
10
120f1fd mohag Make Makefile and README consistent with INSTALL
mohag authored
11 SH?= sh
12
13 version= $(shell ${SH} get-version.sh)
14 debversion= $(shell ${SH} get-version.sh | sed -Ee 's/^v//;s/[.]([[:digit:]]+)[.](g[[:xdigit:]]+)$$/+\1+\2/')
d062346 corecode add a version tag
authored
15
f8352d6 corecode use the plain makefile as default
authored
16 CC?= gcc
17 CFLAGS?= -O -pipe
18 LDADD?= -lssl -lcrypto -lresolv
19
d84c3da corecode access config files at CONF_PATH, add makefile target to install conf fi...
authored
20 CFLAGS+= -Wall -DDMA_VERSION='"${version}"' -DLIBEXEC_PATH='"${LIBEXEC}"' -DCONF_PATH='"${CONFDIR}"'
4f5584b corecode compile with -Wall
authored
21
f8352d6 corecode use the plain makefile as default
authored
22 INSTALL?= install -p
350685e corecode install with correct permissions
authored
23 CHGRP?= chgrp
24 CHMOD?= chmod
25
f8352d6 corecode use the plain makefile as default
authored
26 PREFIX?= /usr/local
27 SBIN?= ${PREFIX}/sbin
c1ebccb corecode implement mbox creation via setuid helper
authored
28 LIBEXEC?= ${PREFIX}/lib
d84c3da corecode access config files at CONF_PATH, add makefile target to install conf fi...
authored
29 CONFDIR?= /etc/dma
f8352d6 corecode use the plain makefile as default
authored
30 MAN?= ${PREFIX}/share/man
350685e corecode install with correct permissions
authored
31 VAR?= /var
32 DMASPOOL?= ${VAR}/spool/dma
33 VARMAIL?= ${VAR}/mail
8b503e7 corecode Add symlink for sendmail which is expected by many packages
authored
34 SYMLINK?= -s # or empty to create hard link
f8352d6 corecode use the plain makefile as default
authored
35
36 YACC?= yacc
37 LEX?= lex
8b503e7 corecode Add symlink for sendmail which is expected by many packages
authored
38 LN?= ln
f8352d6 corecode use the plain makefile as default
authored
39
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
43
c1ebccb corecode implement mbox creation via setuid helper
authored
44 all: dma dma-mbox-create
f8352d6 corecode use the plain makefile as default
authored
45
46 clean:
c1ebccb corecode implement mbox creation via setuid helper
authored
47 -rm -f .depend dma dma-mbox-create *.[do]
f8352d6 corecode use the plain makefile as default
authored
48 -rm -f aliases_parse.[ch] aliases_scan.c
c342b76 corecode Makefile: create spool directories in a separate target
authored
49
f8352d6 corecode use the plain makefile as default
authored
50 install: all
d84c3da corecode access config files at CONF_PATH, add makefile target to install conf fi...
authored
51 ${INSTALL} -d ${DESTDIR}${SBIN}
c1ebccb corecode implement mbox creation via setuid helper
authored
52 ${INSTALL} -d ${DESTDIR}${MAN}/man8 ${DESTDIR}${LIBEXEC}
350685e corecode install with correct permissions
authored
53 ${INSTALL} -m 2755 -o root -g mail dma ${DESTDIR}${SBIN}
c1ebccb corecode implement mbox creation via setuid helper
authored
54 ${INSTALL} -m 4754 -o root -g mail dma-mbox-create ${DESTDIR}${LIBEXEC}
f8352d6 corecode use the plain makefile as default
authored
55 ${INSTALL} -m 0644 dma.8 ${DESTDIR}${MAN}/man8/
585bd30 corecode make install: don't chmod/chown all mail files by default
authored
56
8b503e7 corecode Add symlink for sendmail which is expected by many packages
authored
57 sendmail-link:
58 cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma sendmail
59
0c68af7 corecode Makefile: add symlink for mailq
authored
60 mailq-link:
61 cd ${DESTDIR}${SBIN} && ${LN} ${SYMLINK} dma mailq
62
c342b76 corecode Makefile: create spool directories in a separate target
authored
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}
66
585bd30 corecode make install: don't chmod/chown all mail files by default
authored
67 permissions:
350685e corecode install with correct permissions
authored
68 -${CHGRP} mail ${DESTDIR}${VARMAIL}/*
69 -${CHMOD} g+w ${DESTDIR}${VARMAIL}/*
86e4d16 Add the DragonFly Mail Agent dma(8) to the base.
Matthias Schmidt authored
70
d84c3da corecode access config files at CONF_PATH, add makefile target to install conf fi...
authored
71 install-etc:
72 ${INSTALL} -d ${DESTDIR}${CONFDIR}
73 @if [ -e ${DESTDIR}${CONFDIR}/dma.conf ]; then \
74 echo "Not overwriting ${DESTDIR}${CONFDIR}/dma.conf."; \
75 else \
76 echo ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \
77 ${INSTALL} -m 644 -o root -g mail dma.conf ${DESTDIR}${CONFDIR}; \
78 fi
79 @if [ -e ${DESTDIR}${CONFDIR}/auth.conf ]; then \
80 echo "Not overwriting ${DESTDIR}${CONFDIR}/auth.conf."; \
81 else \
82 echo ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \
83 ${INSTALL} -m 640 -o root -g mail auth.conf ${DESTDIR}${CONFDIR}; \
84 fi
85
f8352d6 corecode use the plain makefile as default
authored
86 aliases_parse.c: aliases_parse.y
87 ${YACC} -d -o aliases_parse.c aliases_parse.y
86e4d16 Add the DragonFly Mail Agent dma(8) to the base.
Matthias Schmidt authored
88
f8352d6 corecode use the plain makefile as default
authored
89 aliases_scan.c: aliases_scan.l
90 ${LEX} -t aliases_scan.l > aliases_scan.c
86e4d16 Add the DragonFly Mail Agent dma(8) to the base.
Matthias Schmidt authored
91
f8352d6 corecode use the plain makefile as default
authored
92 .SUFFIXES: .c .o
86e4d16 Add the DragonFly Mail Agent dma(8) to the base.
Matthias Schmidt authored
93
f8352d6 corecode use the plain makefile as default
authored
94 .c.o:
95 ${CC} ${CFLAGS} ${CPPFLAGS} -include dfcompat.h -o $@ -c $<
86e4d16 Add the DragonFly Mail Agent dma(8) to the base.
Matthias Schmidt authored
96
f8352d6 corecode use the plain makefile as default
authored
97 dma: ${OBJS}
d642468 corecode Makefile: put libraries at the end when linking
authored
98 ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
d511b67 corecode add ppa makefile recipe
authored
99
100
c1ebccb corecode implement mbox creation via setuid helper
authored
101 dch:
102 dch --release-heuristic changelog -v ${debversion}
103
104
d511b67 corecode add ppa makefile recipe
authored
105 ppa:
106 @if [ -z '${DEB_DIST}' ]; then echo "please set DEB_DIST to build"; exit 1; fi
b0d54cf corecode make ppa: force lower version number
authored
107 dch -v "${debversion}~${DEB_DIST}" -D ${DEB_DIST} "${DEB_DIST} build" -b
d511b67 corecode add ppa makefile recipe
authored
108 debuild -S -sa
109 ver=$$(dpkg-parsechangelog -n1 | awk '$$1 == "Version:" { print $$2 }'); \
8a86d0e corecode make ppa: proper name
authored
110 dput ppa:corecode/dma ../dma_$${ver}_source.changes
Something went wrong with that request. Please try again.