Contents of /trunk/extras/postfix/postfix-2.5.1-r1.smage2
Parent Directory | Revision Log
Revision 2 -
(show annotations)
(download)
Fri Oct 10 13:29:42 2008 UTC (16 years, 1 month ago) by niro
File size: 5508 byte(s)
Fri Oct 10 13:29:42 2008 UTC (16 years, 1 month ago) by niro
File size: 5508 byte(s)
import repo
1 | # $Header$ |
2 | |
3 | PNAME="postfix" |
4 | PVER="2.5.1" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="net-mail" |
8 | STATE="unstable" |
9 | |
10 | DESCRIPTION="Postfix is a Mail Transport Agent (MTA), supporting LDAP, SMTP AUTH (SASL), TLS." |
11 | HOMEPAGE="http://www.postfix.org/" |
12 | |
13 | DEPEND=">= net-mail/mail-base-files-0.1 |
14 | >= net-mail/mailwrapper-0.2.1 |
15 | >= sys-libs/pam-0.99 |
16 | >= dev-libs/openssl-0.9.8 |
17 | >= dev-libs/cyrus-sasl-2 |
18 | >= net-nds/openldap-2.4 |
19 | >= dev-db/mysql5-5 |
20 | >= sys-libs/db-4.6 |
21 | >= dev-libs/libpcre-7.4" |
22 | |
23 | SRCFILE="${PNAME}-${PVER}.tar.gz" |
24 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
25 | |
26 | sminclude mtools |
27 | |
28 | SRC_URI=( |
29 | ftp://ftp.porcupine.org/mirrors/postfix-release/official/${SRCFILE} |
30 | mirror://${PNAME}/${SRCFILE} |
31 | mirror://${PNAME}/postfix.rc |
32 | mirror://${PNAME}/postfix.pam |
33 | doins "${FILESDIR}/mailer.conf" |
34 | newins "${FILESDIR}/smtp.pass" saslpass |
35 | smtp.sasl |
36 | ) |
37 | |
38 | src_prepare() |
39 | { |
40 | munpack ${SRCFILE} || die |
41 | cd ${SRCDIR} |
42 | |
43 | # fix default alias db location |
44 | sed -i "/^#define ALIAS_DB_MAP/s|hash:/etc/aliases|hash:/etc/mail/aliases|" src/util/sys_defs.h || die |
45 | |
46 | # fix default install pathes |
47 | sed -i "s:/usr/local/:/usr/:g" conf/master.cf || die |
48 | } |
49 | |
50 | src_compile() |
51 | { |
52 | cd ${SRCDIR} |
53 | |
54 | local CCARGS |
55 | local AUXLIBS |
56 | |
57 | # default pathes |
58 | CCARGS="${CCARGS} -DDEF_DAEMON_DIR=\\\"/usr/$(mlibdir)/postfix\\\"" |
59 | CCARGS="${CCARGS} -DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\"" |
60 | CCARGS="${CCARGS} -DDEF_README_DIR=\\\"/usr/share/doc/${PNAME}-${PVER}/readme\\\"" |
61 | CCARGS="${CCARGS} -DDEF_HTML_DIR=\\\"/usr/share/doc/${PNAME}-${PVER}/html\\\"" |
62 | |
63 | # generic flags |
64 | CCARGS="${CCARGS} -DHAS_PCRE" |
65 | AUXLIBS="${AUXLIBS} ${LDFLAGS} -lpcre -lcrypt -lpthread" |
66 | |
67 | # largefile support |
68 | CCARGS="${CCARGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" |
69 | |
70 | # pam support |
71 | AUXLIBS="${AUXLIBS} -lpam" |
72 | # mysql support |
73 | CCARGS="${CCARGS} -DHAS_MYSQL -I/usr/include/mysql" |
74 | AUXLIBS="${AUXLIBS} -lmysqlclient -lm -lz" |
75 | |
76 | # ldap support |
77 | CCARGS="${CCARGS} -DHAS_LDAP" |
78 | AUXLIBS="${AUXLIBS} -lldap -llber" |
79 | |
80 | # ssl/tls support |
81 | CCARGS="${CCARGS} -DUSE_TLS" |
82 | AUXLIBS="${AUXLIBS} -lssl -lcrypto" |
83 | |
84 | # sasl2 support |
85 | CCARGS="${CCARGS} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" |
86 | AUXLIBS="${AUXLIBS} -lsasl2" |
87 | |
88 | # configure |
89 | make DEBUG="" OPT="${CFLAGS}" CCARGS="${CCARGS}" AUXLIBS="${AUXLIBS}" makefiles || die |
90 | mmake || die |
91 | } |
92 | |
93 | src_install() |
94 | { |
95 | |
96 | sh postfix-install \ |
97 | -non-interactive \ |
98 | install_root="${BINDIR}" \ |
99 | config_directory="/usr/share/doc/${PNAME}-${PVER}/defaults" \ |
100 | readme_directory="/usr/share/doc/${PNAME}-${PVER}/readme" \ |
101 | || die |
102 | |
103 | # mailwrapper stuff |
104 | mv ${BINDIR}/usr/sbin/sendmail{,.postfix} || die |
105 | mv ${BINDIR}/usr/bin/rmail{,.postfix} || die |
106 | mv ${BINDIR}/usr/share/man/man1/sendmail{,-postfix}.1 || die |
107 | mv ${BINDIR}/usr/share/man/man1/newaliases{,-postfix}.1 || die |
108 | mv ${BINDIR}/usr/share/man/man1/mailq{,-postfix}.1 || die |
109 | mv ${BINDIR}/usr/share/man/man5/aliases{,-postfix}.5 || die |
110 | |
111 | # regular ebuild |
112 | insinto /etc/mail |
113 | doins "${FILESDIR}/mailer.conf" |
114 | |
115 | # install auxiliary tools |
116 | minstallexec auxiliary/rmail/rmail || die |
117 | minstallexec auxiliary/qshape/qshape.pl || die |
118 | minstallexec bin/smtp-source || die |
119 | minstallexec bin/smtp-sink || die |
120 | minstallexec bin/qmqp-source || die |
121 | minstallexec bin/qmqp-sink || die |
122 | minstallman man/man1/smtp-source.1 || die |
123 | minstallman man/man1/smtp-sink.1 || die |
124 | minstallman man/man1/qmqp-source.1 || die |
125 | minstallman man/man1/qmqp-sink.1 || die |
126 | |
127 | # clean up and install needed diretories |
128 | rm -Rf ${BINDIR}/var || die |
129 | mkeepdir /var/spool/postfix || die |
130 | mkeepdir /etc/postfix || die |
131 | |
132 | # install and generate a default configuration with maildir support |
133 | mv ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/defaults/{*.cf,post*-*} ${BINDIR}/etc/postfix || die |
134 | ${BINDIR}/usr/sbin/postconf -c ${BINDIR}/etc/postfix -e home_mailbox=.maildir/ || die |
135 | |
136 | minstallfile -s smtp.pass /etc/postfix/saslpass || die |
137 | minstallrc postfix.rc postfix || die |
138 | minstallpam postfix.pam postfix || die |
139 | |
140 | minstalldir /etc/sasl2 || die |
141 | minstallfile -s smtp.sasl /etc/sasl2/smtpd.conf || die |
142 | |
143 | # fix permissions |
144 | mchown root:postdrop /usr/sbin/post{drop,queue} || die |
145 | mchmod 02711 /usr/sbin/post{drop,queue} || die |
146 | mchmod 600 /etc/postfix/saslpass || die |
147 | |
148 | mv ${SRCDIR}/examples ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/ || die |
149 | minstalldocs *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES* || die |
150 | minstallhtml html/* || die |
151 | } |
152 | |
153 | |
154 | |
155 | |
156 | |
157 | |
158 | |
159 | |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | |
166 | |
167 | |
168 | |
169 | |
170 | |
171 | |
172 | |
173 | |
174 | |
175 | |
176 | |
177 | |
178 | |
179 | |
180 | |
181 | |
182 | |
183 | cd ${SRCDIR} |
184 | mmake DESTDIR=${BINDIR} install || die |
185 | |
186 | # install our initscript |
187 | minstallrc dovecot.rc dovecot || die |
188 | |
189 | # install ssl-cert creation script and config |
190 | minstalldir /etc/dovecot/ssl || die |
191 | minstallfile doc/dovecot-openssl.cnf /etc/dovecot/ssl/ || die |
192 | minstallexec doc/mkcert.sh /usr/libexec/dovecot/ || die |
193 | |
194 | # remove unwanted docs |
195 | rm -rf ${BINDIR}/usr/share/doc/dovecot || die |
196 | |
197 | minstalldocs AUTHORS ChangeLog COPYING* NEWS README TODO || die |
198 | minstalldocs dovecot-example.conf || die |
199 | } |
200 | |
201 | preinstall() |
202 | { |
203 | # adding proftpd user |
204 | ${MLIBDIR}/mgroupadd -o "-g 207" postfix |
205 | ${MLIBDIR}/mgroupadd -o "-g 208" postdrop |
206 | ${MLIBDIR}/museradd -o "-u 207 -g postfix -G mail -d /var/spool/postfix -s /bin/false" postfix |
207 | } |
208 | |
209 | postinstall() |
210 | { |
211 | # generate a self-signed ssl-cert |
212 | if [[ ! -f /etc/dovecot/ssl/dovecot.pem ]] |
213 | then |
214 | SSLDIR=/etc/dovecot/ssl \ |
215 | OPENSSLCONFIG=/etc/dovecot/ssl/dovecot-openssl.cnf \ |
216 | /usr/libexec/dovecot/mkcert.sh &> /dev/null |
217 | fi |
218 | |
219 | # rebuild ssl-parametes |
220 | if [[ ! -f /var/run/dovecot/login/ssl-parameters.dat ]] |
221 | then |
222 | dovecot --build-ssl-parameters &> /dev/null |
223 | fi |
224 | |
225 | mstartservice dovecot |
226 | } |
227 | |
228 | postremove() |
229 | { |
230 | mstopservice dovecot |
231 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |