]>
Commit | Line | Data |
---|---|---|
c41ca9c7 | 1 | # |
6c202c7c | 2 | # Conditional build: |
a675fe53 | 3 | %bcond_without ldap # without LDAP map module |
4 | %bcond_without mysql # without MySQL map module | |
5 | %bcond_without pgsql # without PostgreSQL map module | |
a3d5ff4f | 6 | %bcond_without sqlite # without SQLite map module |
a675fe53 | 7 | %bcond_without sasl # without SMTP AUTH support |
8 | %bcond_without ssl # without SSL/TLS support | |
d2e5a200 | 9 | %bcond_without cdb # without cdb map support |
3980332c | 10 | %if "%{pld_release}" == "th" |
afeeeec7 | 11 | %bcond_without vda # without VDA patch |
3980332c ER |
12 | %else |
13 | %bcond_with vda # with VDA patch | |
a90612af | 14 | %endif |
91c5f300 | 15 | %bcond_with hir # with Beeth's header_if_reject patch |
b21ac01c | 16 | %bcond_with tcp # with unofficial tcp: lookup table |
3980332c ER |
17 | %if "%{pld_release}" == "ac" |
18 | %bcond_with epoll # enable epoll for 2.6 kernels | |
628e466c ER |
19 | # there didn't exist x86_64 2.4 kernel in PLD, so can safely enable epoll |
20 | %ifarch %{x8664} | |
21 | %define with_epoll 1 | |
22 | %endif | |
3980332c | 23 | %else |
8b457b1c | 24 | %bcond_without epoll # disable epoll for 2.4 kernels |
3980332c | 25 | %endif |
628e466c | 26 | |
7d6d2dd3 | 27 | %define vda_ver v11-2.9.1 |
aed7eb18 | 28 | Summary: Postfix Mail Transport Agent |
2fb1717c ER |
29 | Summary(cs.UTF-8): Postfix - program pro přepravu pošty (MTA) |
30 | Summary(es.UTF-8): Postfix - Un MTA (Mail Transport Agent) de alto desempeño | |
31 | Summary(fr.UTF-8): Agent de transport de courrier Postfix | |
32 | Summary(pl.UTF-8): Serwer SMTP Postfix | |
33 | Summary(pt_BR.UTF-8): Postfix - Um MTA (Mail Transport Agent) de alto desempenho | |
34 | Summary(sk.UTF-8): Agent prenosu pošty Postfix | |
aed7eb18 | 35 | Name: postfix |
8b724c22 | 36 | Version: 2.9.4 |
a5d4cb56 | 37 | Release: 3 |
9e330f14 | 38 | Epoch: 2 |
4e46d0a4 | 39 | License: distributable |
cc9ed2a2 | 40 | Group: Networking/Daemons/SMTP |
9e330f14 | 41 | Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}.tar.gz |
8b724c22 | 42 | # Source0-md5: 230bc3c00c051946eccd850058d75f6c |
a6206693 | 43 | Source1: %{name}.aliases |
44 | Source2: %{name}.cron | |
45 | Source3: %{name}.init | |
efbd5023 JB |
46 | Source4: %{name}.sysconfig |
47 | Source5: %{name}.sasl | |
48 | Source6: %{name}.pamd | |
a9621843 | 49 | Source7: http://vda.sourceforge.net/VDA/%{name}-vda-%{vda_ver}.patch |
7d6d2dd3 | 50 | # Source7-md5: a54a21428de5eeae91b4bb670976e37a |
afeeeec7 | 51 | Source8: %{name}-bounce.cf.pl |
53387d60 TP |
52 | # http://postfix.state-of-mind.de/bounce-templates/bounce.de-DE.cf |
53 | Source9: %{name}-bounce.cf.de | |
614bf87e | 54 | Source10: %{name}.monitrc |
d5588fd1 | 55 | Source11: %{name}-vda-bigquota.patch |
ca9e223e JR |
56 | #Source11: http://vda.sourceforge.net/VDA/%{name}-%{vda_ver}-vda-ng-bigquota.patch.gz |
57 | # -ource11-md5: d46103195b43ec5784ea2c166b238f71 | |
39f13daf TO |
58 | Patch0: %{name}-config.patch |
59 | Patch1: %{name}-conf_msg.patch | |
60 | Patch2: %{name}-dynamicmaps.patch | |
8a65cb50 | 61 | Patch3: %{name}-master.cf_cyrus.patch |
d9d74ec2 | 62 | # from http://akson.sgh.waw.pl/~chopin/unix/postfix-2.1.5-header_if_reject.diff |
8a65cb50 | 63 | Patch4: %{name}-header_if_reject.patch |
9af56e83 JR |
64 | Patch5: %{name}-ident.patch |
65 | Patch6: %{name}-lib64.patch | |
66 | Patch7: %{name}-conf.patch | |
67 | Patch8: %{name}-dictname.patch | |
68 | Patch9: %{name}-make-jN.patch | |
1df88c62 | 69 | Patch10: %{name}-link.patch |
a3d5ff4f | 70 | Patch11: %{name}-scache_clnt.patch |
7003f448 | 71 | URL: http://www.postfix.org/ |
a675fe53 | 72 | %{?with_sasl:BuildRequires: cyrus-sasl-devel} |
f5be0c4f | 73 | BuildRequires: db-devel |
435fe1e7 JB |
74 | # getifaddrs() with IPv6 support |
75 | BuildRequires: glibc-devel >= 6:2.3.4 | |
a675fe53 | 76 | %{?with_mysql:BuildRequires: mysql-devel} |
3daed3d7 | 77 | %{?with_ldap:BuildRequires: openldap-devel >= 2.0.12} |
31bc8b8b | 78 | %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7l} |
9e330f14 | 79 | BuildRequires: pcre-devel |
26166c26 | 80 | BuildRequires: perl-base |
a675fe53 | 81 | %{?with_pgsql:BuildRequires: postgresql-devel} |
a90612af | 82 | BuildRequires: rpm >= 4.4.9-56 |
88cb24db | 83 | BuildRequires: rpmbuild(macros) >= 1.268 |
cc227ab6 | 84 | BuildRequires: sed >= 4.0 |
a3d5ff4f | 85 | %{?with_sqlite:BuildRequires: sqlite3-devel} |
a675fe53 | 86 | %{?with_cdb:BuildRequires: tinycdb-devel} |
cc227ab6 | 87 | %{?with_mysql:BuildRequires: zlib-devel} |
6c202c7c | 88 | Requires(post): /bin/hostname |
04eda2b3 ER |
89 | Requires(post,postun): /sbin/ldconfig |
90 | Requires(post,preun): /sbin/chkconfig | |
91 | Requires(postun): /usr/sbin/groupdel | |
92 | Requires(postun): /usr/sbin/userdel | |
36d09b56 | 93 | Requires(pre): /bin/id |
94 | Requires(pre): /usr/bin/getgid | |
95 | Requires(pre): /usr/sbin/groupadd | |
96 | Requires(pre): /usr/sbin/useradd | |
6193959a | 97 | Requires: /sbin/chkconfig |
760324a9 PG |
98 | Requires: diffutils |
99 | Requires: findutils | |
04eda2b3 ER |
100 | Requires: rc-scripts |
101 | Requires: sed | |
760324a9 | 102 | %{?with_cdb:Requires:tinycdb} |
6383ad40 | 103 | Suggests: cyrus-sasl-saslauthd |
36d09b56 | 104 | Provides: group(postfix) |
6c202c7c | 105 | Provides: smtpdaemon |
36d09b56 | 106 | Provides: user(postfix) |
760324a9 | 107 | Obsoletes: smtpdaemon |
1b5a7762 | 108 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
0effd84f AM |
109 | |
110 | %description | |
9d1e23e4 | 111 | Postfix is attempt to provide an alternative to the widely-used |
112 | Sendmail program. Postfix attempts to be fast, easy to administer, and | |
113 | hopefully secure, while at the same time being sendmail compatible | |
5e7152ef | 114 | enough to not upset your users. This version has IPv6 support. |
07119450 | 115 | |
23264879 | 116 | %description -l es.UTF-8 |
d6c39c23 | 117 | Postfix es una alternativa para el mundialmente utilizado sendmail. Si |
23264879 | 118 | desea tener un servidor SMTP *rápido*, debe instalar este paquete. |
d6c39c23 | 119 | |
23264879 JR |
120 | %description -l fr.UTF-8 |
121 | Postfix (voir http://www.postfix.org/) se veut une alternative à | |
07119450 | 122 | sendmail, responsable de l'acheminement de 70% des courriers |
23264879 JR |
123 | électroniques sur Internet. IBM en a suppotré le développement, mais |
124 | ne contrôle pas son évolution. Le but est d'installer Postfix sur le | |
125 | plus grand nombre de systèmes possible. Dans cette optique, il a été | |
126 | écrit pour être totalement sous le contrôle de l'utilisateur. | |
07119450 | 127 | |
23264879 | 128 | %description -l it.UTF-8 |
9e330f14 | 129 | Postfix (http://www.postfix.org/) e' un'alternativa al programma |
07119450 | 130 | sendmail utilizzato per la gestione del 70 per cento della posta |
131 | Internet. | |
132 | ||
133 | Seppur IBM supporti lo sviluppo di Postfix, non controlla la sua | |
134 | evoluzione. | |
135 | ||
136 | Consultate la pagine web http://www.moongroup.com/how-to.phtml nella | |
137 | quale troverete le indicazioni per una corretta installazione e | |
138 | configurazione di questo programma. | |
139 | ||
23264879 JR |
140 | %description -l pl.UTF-8 |
141 | Postfix jest próbą dostarczenia alternatywnego MTA w stosunku do | |
142 | szeroko używanego sendmaila. Postfix w zamierzeniu ma być szybki, | |
143 | łatwy w administrowaniu, bezpieczny oraz ma być na tyle kompatybilny z | |
144 | sendmailem by nie denerwować użytkowników. Ta wersja obsługuje IPv6. | |
07119450 | 145 | |
23264879 JR |
146 | %description -l pt_BR.UTF-8 |
147 | O Postfix é uma alternativa para o mundialmente utilizado sendmail. Se | |
148 | você deseja um servidor SMTP *rápido*, instale este pacote. | |
d6c39c23 | 149 | |
23264879 JR |
150 | %description -l sk.UTF-8 |
151 | Postfix (pozri http://www.postfix.org/) má za cieľ byť alternatívou k | |
152 | široko rozšírenému programu sendmail, zodpovednému za 70% všetkej | |
153 | elektronickej pošty doručenej na Internete. | |
07119450 | 154 | |
23264879 JR |
155 | Aj keď IBM podporovala vývoj Postfixu, zdržiava sa vplyvu na jeho |
156 | vývoj. Cieľom je inštalácia Postfixu na čo najväčšom počte systémov. | |
157 | Do tohoto momentu je softvér poskytovaný bez ovplyvňovania, takže sa | |
158 | môže vyvíjať podľa jeho používateľov. | |
07119450 | 159 | |
23264879 JR |
160 | Určite si prečítajte http://www.moongroup.com/how-to.phtml, kde sú |
161 | popísané kroky potrebné pred a po inštalácii Postfixu. | |
07119450 | 162 | |
9e330f14 | 163 | %package devel |
164 | Summary: Postfix loadable modules development package | |
2fb1717c | 165 | Summary(pl.UTF-8): Pakiet dla programistów ładowanych modułów do postfiksa |
9e330f14 | 166 | Group: Development/Libraries |
68087f44 | 167 | Requires: %{name} = %{epoch}:%{version}-%{release} |
9e330f14 | 168 | |
169 | %description devel | |
170 | Header files to build additional map types for Postfix. | |
171 | ||
23264879 JR |
172 | %description devel -l pl.UTF-8 |
173 | Pliki nagłówkowe do tworzenia dodatkowych typów map dla Postfiksa. | |
9e330f14 | 174 | |
175 | %package dict-ldap | |
176 | Summary: LDAP map support for Postfix | |
2fb1717c | 177 | Summary(pl.UTF-8): Obsługa map LDAP dla Postfiksa |
cc9ed2a2 | 178 | Group: Networking/Daemons/SMTP |
68087f44 | 179 | Requires: %{name} = %{epoch}:%{version}-%{release} |
1dc0bd4f | 180 | Requires: openldap >= 2.3.6 |
9e330f14 | 181 | |
182 | %description dict-ldap | |
183 | This package provides support for LDAP maps in Postfix. | |
184 | ||
23264879 JR |
185 | %description dict-ldap -l pl.UTF-8 |
186 | Ten pakiet dodaje obsługę map LDAP do Postfiksa. | |
9e330f14 | 187 | |
188 | %package dict-mysql | |
189 | Summary: MySQL map support for Postfix | |
2fb1717c | 190 | Summary(pl.UTF-8): Obsługa map MySQL dla Postfiksa |
cc9ed2a2 | 191 | Group: Networking/Daemons/SMTP |
68087f44 | 192 | Requires: %{name} = %{epoch}:%{version}-%{release} |
9e330f14 | 193 | |
194 | %description dict-mysql | |
195 | This package provides support for MySQL maps in Postfix. | |
196 | ||
23264879 JR |
197 | %description dict-mysql -l pl.UTF-8 |
198 | Ten pakiet dodaje obsługę map MySQL do Postfiksa. | |
9e330f14 | 199 | |
9e330f14 | 200 | %package dict-pcre |
201 | Summary: PCRE map support for Postfix | |
2fb1717c | 202 | Summary(pl.UTF-8): Obsługa map PCRE dla Postfiksa |
cc9ed2a2 | 203 | Group: Networking/Daemons/SMTP |
68087f44 | 204 | Requires: %{name} = %{epoch}:%{version}-%{release} |
9e330f14 | 205 | |
206 | %description dict-pcre | |
207 | This package provides support for PCRE maps in Postfix. | |
208 | ||
23264879 JR |
209 | %description dict-pcre -l pl.UTF-8 |
210 | Ten pakiet dodaje obsługę map PCRE do Postfiksa. | |
0effd84f | 211 | |
8016f71d JB |
212 | %package dict-pgsql |
213 | Summary: PostgreSQL map support for Postfix | |
2fb1717c | 214 | Summary(pl.UTF-8): Obsługa map PostgreSQL dla Postfiksa |
cc9ed2a2 | 215 | Group: Networking/Daemons/SMTP |
68087f44 | 216 | Requires: %{name} = %{epoch}:%{version}-%{release} |
8016f71d JB |
217 | |
218 | %description dict-pgsql | |
219 | This package provides support for PostgreSQL maps in Postfix. | |
220 | ||
23264879 JR |
221 | %description dict-pgsql -l pl.UTF-8 |
222 | Ten pakiet dodaje obsługę map PostgreSQL do Postfiksa. | |
8016f71d | 223 | |
a3d5ff4f | 224 | %package dict-sqlite |
225 | Summary: SQLite map support for Postfix | |
226 | Summary(pl.UTF-8): Obsługa map SQLite dla Postfiksa | |
227 | Group: Networking/Daemons/SMTP | |
228 | Requires: %{name} = %{epoch}:%{version}-%{release} | |
229 | ||
230 | %description dict-sqlite | |
231 | This package provides support for SQLite maps in Postfix. | |
232 | ||
233 | %description dict-sqlite -l pl.UTF-8 | |
234 | Ten pakiet dodaje obsługę map SQLite do Postfiksa. | |
235 | ||
fad0c92b ER |
236 | %package qshape |
237 | Summary: qshape - Print Postfix queue domain and age distribution | |
a5051c15 | 238 | Summary(pl.UTF-8): qshape - wypisywanie rozkładu domen i wieku z kolejki Postfiksa |
cc9ed2a2 | 239 | Group: Networking/Daemons/SMTP |
fad0c92b ER |
240 | Requires: %{name} = %{epoch}:%{version}-%{release} |
241 | ||
242 | %description qshape | |
243 | The qshape program helps the administrator understand the Postfix | |
244 | queue message distribution in time and by sender domain or recipient | |
245 | domain. The program needs read access to the queue directories and | |
246 | queue files, so it must run as the superuser or the mail_owner | |
247 | specified in main.cf (typically postfix). | |
248 | ||
a5051c15 JB |
249 | %description qshape -l pl.UTF-8 |
250 | Program qshape pomaga administratorowi zrozumieć rozkład kolejki | |
251 | wiadomości Postfiksa w czasie i w zależności od domeny nadawcy lub | |
252 | adresata. Program wymaga prawa odczytu do katalogów kolejki i plików | |
253 | kolejki, więc musi być uruchamiany przez superużytkownika lub | |
254 | użytkownika mail_owner podanego w main.cf (zwykle nazywającego się | |
255 | postfix). | |
256 | ||
614bf87e | 257 | %package -n monit-rc-%{name} |
eb700fe9 JB |
258 | Summary: monit support for Postfix |
259 | Summary(pl.UTF-8): Wsparcie monita dla Postfiksa | |
260 | Group: Applications/System | |
d3dab295 | 261 | Requires: %{name} = %{epoch}:%{version}-%{release} |
eb700fe9 | 262 | Requires: monit |
614bf87e PG |
263 | |
264 | %description -n monit-rc-%{name} | |
265 | monitrc file for monitoring Postfix. | |
266 | ||
267 | %description -n monit-rc-%{name} -l pl.UTF-8 | |
268 | Plik monitrc do monitorowania serwera Postfix. | |
269 | ||
0effd84f | 270 | %prep |
8a65cb50 | 271 | %setup -q |
c5367ef6 JR |
272 | %if %{with vda} |
273 | cat %{SOURCE7} | %{__patch} -p1 -s | |
274 | cat %{SOURCE11} | %{__patch} -p1 -s | |
275 | %endif | |
87c7eadd JR |
276 | |
277 | find -type f | xargs sed -i -e 's|/etc/postfix|/etc/mail|g' | |
278 | ||
54206e36 | 279 | %patch0 -p1 |
cc227ab6 | 280 | %patch1 -p0 |
759823fd | 281 | %patch2 -p1 |
8a65cb50 JB |
282 | %patch3 -p1 |
283 | %{?with_hir:%patch4 -p0} | |
9af56e83 | 284 | %patch5 -p1 |
cc227ab6 | 285 | sed -i '/scache_clnt_create/s/server/var_scache_service/' src/global/scache_clnt.c |
99356d6f | 286 | %if "%{_lib}" == "lib64" |
9af56e83 | 287 | %patch6 -p1 |
d9d74ec2 | 288 | %endif |
9af56e83 | 289 | %patch7 -p1 |
8961886a JR |
290 | %patch8 -p1 |
291 | %patch9 -p1 | |
1df88c62 | 292 | %patch10 -p1 |
a3d5ff4f | 293 | %patch11 -p1 |
0effd84f | 294 | |
b21ac01c | 295 | %if %{with tcp} |
296 | sed -i 's/ifdef SNAPSHOT/if 1/' src/util/dict_open.c | |
297 | %endif | |
298 | ||
0effd84f | 299 | %build |
bbb4eec1 | 300 | %{__make} -f Makefile.init makefiles |
301 | %{__make} tidy | |
8eb680c0 | 302 | CC="%{__cc}" |
303 | export CC | |
bbb4eec1 | 304 | %{__make} \ |
435fe1e7 | 305 | DEBUG="" \ |
32e74bf0 | 306 | OPT="%{rpmcflags} %{rpmcppflags} -D_FILE_OFFSET_BITS=64" \ |
a675fe53 | 307 | %{!?with_ldap:LDAPSO=""} \ |
308 | %{!?with_mysql:MYSQLSO=""} \ | |
309 | %{!?with_pgsql:PGSQLSO=""} \ | |
e247883f | 310 | CCARGS="%{!?with_epoll:-DNO_EPOLL} %{?with_ldap:-DHAS_LDAP} -DHAS_PCRE %{?with_sasl:-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl} %{?with_mysql:-DHAS_MYSQL -I/usr/include/mysql} %{?with_pgsql:-DHAS_PGSQL} %{?with_ssl:-DUSE_TLS} -DMAX_DYNAMIC_MAPS %{?with_cdb:-DHAS_CDB}" \ |
8eb680c0 | 311 | AUXLIBS="-ldb -lresolv %{?with_sasl:-lsasl} %{?with_ssl:-lssl -lcrypto} %{?with_cdb:-lcdb} -lpcre" |
0effd84f AM |
312 | |
313 | %install | |
314 | rm -rf $RPM_BUILD_ROOT | |
614bf87e | 315 | install -d $RPM_BUILD_ROOT/etc/{cron.daily,rc.d/init.d,sysconfig,pam.d,security,monit} \ |
1bf3b45d | 316 | $RPM_BUILD_ROOT%{_sysconfdir}/{mail,sasl} \ |
996fb42e JB |
317 | $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}/postfix,/usr/lib}\ |
318 | $RPM_BUILD_ROOT{%{_includedir}/postfix,%{_mandir}} \ | |
1dc0bd4f ER |
319 | $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,maildrop,private,saved,bounce,defer,incoming,pid,public} \ |
320 | $RPM_BUILD_ROOT%{_var}/lib/postfix | |
8e60c101 | 321 | %{__rm} html/Makefile.in conf/{LICENSE,main.cf.default} |
38f90f82 | 322 | |
2c6fe3cc ER |
323 | install -p bin/* $RPM_BUILD_ROOT%{_sbindir} |
324 | install -p libexec/* $RPM_BUILD_ROOT%{_libdir}/postfix | |
f52f40b7 JB |
325 | ln $RPM_BUILD_ROOT%{_libdir}/postfix/smtp $RPM_BUILD_ROOT%{_libdir}/postfix/lmtp |
326 | ln $RPM_BUILD_ROOT%{_libdir}/postfix/qmgr $RPM_BUILD_ROOT%{_libdir}/postfix/nqmgr | |
2c6fe3cc | 327 | cp -a conf/* $RPM_BUILD_ROOT%{_sysconfdir}/mail |
7ffb4b69 JK |
328 | sed -e's,^daemon_directory = .*,daemon_directory = %{_libdir}/postfix,' \ |
329 | conf/main.cf > $RPM_BUILD_ROOT%{_sysconfdir}/mail/main.cf | |
7003f448 | 330 | |
9e330f14 | 331 | for f in dns global master util ; do |
2c6fe3cc | 332 | cp -a lib/lib${f}.a $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so.1 |
9e330f14 | 333 | ln -sf lib${f}.so.1 $RPM_BUILD_ROOT%{_libdir}/libpostfix-${f}.so |
334 | done | |
2c6fe3cc ER |
335 | install -p lib/dict*.so $RPM_BUILD_ROOT%{_libdir}/postfix |
336 | cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}/postfix | |
9e330f14 | 337 | |
996fb42e | 338 | cp -a man/man* $RPM_BUILD_ROOT%{_mandir} |
8d5f7ded | 339 | |
2c6fe3cc ER |
340 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases |
341 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/postfix | |
1bf3b45d | 342 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/postfix |
2c6fe3cc ER |
343 | cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/postfix |
344 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sasl/smtpd.conf | |
345 | cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/smtp | |
346 | cp -a %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/mail/bounce.cf.pl | |
347 | cp -a %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/mail/bounce.cf.de | |
348 | cp -a %{SOURCE10} $RPM_BUILD_ROOT/etc/monit/%{name}.monitrc | |
349 | install -p auxiliary/rmail/rmail $RPM_BUILD_ROOT%{_bindir}/rmail | |
350 | install -p auxiliary/qshape/qshape.pl $RPM_BUILD_ROOT%{_bindir}/qshape | |
8d5f7ded | 351 | |
cc227ab6 | 352 | ln -sf %{_sbindir}/sendmail $RPM_BUILD_ROOT%{_bindir}/mailq |
353 | ln -sf %{_sbindir}/sendmail $RPM_BUILD_ROOT%{_bindir}/newaliases | |
354 | ln -sf %{_sbindir}/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail | |
8d5f7ded | 355 | |
9d5846cd | 356 | touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/\ |
a6206693 | 357 | {aliases,access,canonical,relocated,transport,virtual}{,.db} |
0effd84f | 358 | |
876f5025 JR |
359 | touch $RPM_BUILD_ROOT/etc/security/blacklist.smtp |
360 | ||
6c202c7c | 361 | > $RPM_BUILD_ROOT/var/spool/postfix/.nofinger |
0effd84f | 362 | |
8e60c101 | 363 | %{__rm} -r $RPM_BUILD_ROOT%{_sysconfdir}/mail/makedefs.out |
364 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/mail/TLS_LICENSE | |
bf21c84b | 365 | |
8e60c101 | 366 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/mail/{postfix-files,postfix-script,post-install} |
f64b2d39 | 367 | |
ce5ea51e JB |
368 | %clean |
369 | rm -rf $RPM_BUILD_ROOT | |
370 | ||
0effd84f | 371 | %pre |
38ee7751 ER |
372 | %groupadd -g 62 postfix |
373 | %groupadd -g 63 maildrop | |
374 | %useradd -u 62 -d /var/spool/postfix -s /bin/false -c "Postfix User" -g postfix postfix | |
92df9354 | 375 | |
0effd84f | 376 | %post |
9e330f14 | 377 | /sbin/ldconfig |
cc227ab6 | 378 | if ! grep -q "^postmaster:" %{_sysconfdir}/mail/aliases; then |
3980332c ER |
379 | echo "Adding Entry for postmaster in %{_sysconfdir}/mail/aliases" >&2 |
380 | echo "postmaster: root" >>%{_sysconfdir}/mail/aliases | |
0effd84f | 381 | fi |
49e87d62 TP |
382 | if [ "$1" = "1" ]; then |
383 | # only on installation, not upgrade; set sane defaults | |
384 | # postfix expects gethostname() to return FQDN, which is obviously wrong | |
385 | if ! grep -qE "^my(domain|hostname)" %{_sysconfdir}/mail/main.cf; then | |
aede23fa | 386 | domain=$(/bin/hostname -d 2>/dev/null) |
d4128a22 | 387 | [ -n "$domain" -a "$domain" != 'localdomain' ] && \ |
aede23fa | 388 | postconf -e mydomain="$domain" |
49e87d62 TP |
389 | fi |
390 | else | |
3980332c | 391 | %{_sbindir}/postfix upgrade-configuration |
13f4eff0 AF |
392 | fi |
393 | ||
3a2ee9d6 | 394 | %{_bindir}/newaliases |
c9643bf8 | 395 | /sbin/chkconfig --add postfix |
3980332c | 396 | %service postfix restart "Postfix Daemon" |
0effd84f | 397 | |
0effd84f | 398 | %preun |
c9643bf8 | 399 | if [ "$1" = "0" ]; then |
88cb24db | 400 | %service postfix stop |
c9643bf8 | 401 | /sbin/chkconfig --del postfix |
402 | fi | |
0effd84f | 403 | |
9d5846cd | 404 | %postun |
9e330f14 | 405 | /sbin/ldconfig |
406 | if [ "$1" = "0" ]; then | |
36d09b56 | 407 | %groupremove maildrop |
408 | %userremove postfix | |
409 | %groupremove postfix | |
c9643bf8 | 410 | fi |
9d5846cd | 411 | |
0effd84f AM |
412 | %files |
413 | %defattr(644,root,root,755) | |
1dc0bd4f | 414 | %doc html COMPATIBILITY HISTORY LICENSE RELEASE_NOTES* TLS_* |
bd7c0cf3 | 415 | %doc README_FILES/*README |
bf21c84b | 416 | %doc examples/smtpd-policy |
0c1674c9 | 417 | %dir %{_sysconfdir}/mail |
9a9b0b98 JB |
418 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/access |
419 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/aliases | |
afeeeec7 | 420 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/bounce.cf.default |
3e10f279 ER |
421 | %lang(de) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/bounce.cf.de |
422 | %lang(pl) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/bounce.cf.pl | |
9a9b0b98 JB |
423 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/canonical |
424 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/generic | |
9a9b0b98 JB |
425 | #%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/regexp_table |
426 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/relocated | |
427 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/transport | |
428 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/virtual | |
429 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/header_checks | |
3ccfe138 | 430 | #%ghost %{_sysconfdir}/mail/*.db |
9a9b0b98 JB |
431 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/dynamicmaps.cf |
432 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/main.cf | |
433 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/master.cf | |
b60ffb26 | 434 | %{_sysconfdir}/mail/postfix-wrapper |
435 | %{_sysconfdir}/mail/postmulti-script | |
1bf3b45d | 436 | %attr(740,root,root) /etc/cron.daily/postfix |
437 | %attr(754,root,root) /etc/rc.d/init.d/postfix | |
9a9b0b98 | 438 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/postfix |
04eda2b3 | 439 | %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp |
876f5025 | 440 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.smtp |
9a9b0b98 | 441 | %{?with_sasl:%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/sasl/smtpd.conf} |
9e330f14 | 442 | %attr(755,root,root) %{_libdir}/libpostfix-*.so.* |
573c93c6 JB |
443 | %attr(755,root,root) %{_bindir}/mailq |
444 | %attr(755,root,root) %{_bindir}/newaliases | |
fad0c92b | 445 | %attr(755,root,root) %{_bindir}/rmail |
9d5846cd | 446 | %attr(755,root,root) %{_sbindir}/s* |
9e330f14 | 447 | %attr(755,root,root) %{_sbindir}/postfix |
6694854c GS |
448 | %attr(755,root,root) %{_sbindir}/postalias |
449 | %attr(755,root,root) %{_sbindir}/postkick | |
9d5846cd AM |
450 | %attr(755,root,root) %{_sbindir}/postl* |
451 | %attr(755,root,root) %{_sbindir}/postc* | |
452 | %attr(755,root,root) %{_sbindir}/postmap | |
b60ffb26 | 453 | %attr(755,root,root) %{_sbindir}/postmulti |
9e330f14 | 454 | %attr(2755,root,maildrop) %{_sbindir}/postqueue |
9d5846cd AM |
455 | %attr(755,root,root) %{_sbindir}/postsuper |
456 | %attr(2755,root,maildrop) %{_sbindir}/postdrop | |
8a65cb50 | 457 | %attr(755,root,root) %{_sbindir}/qmqp-sink |
9e330f14 | 458 | %attr(755,root,root) %{_sbindir}/qmqp-source |
09055bff | 459 | %attr(755,root,root) /usr/lib/sendmail |
9e330f14 | 460 | %dir %{_libdir}/postfix |
98693d0a | 461 | %attr(755,root,root) %{_libdir}/postfix/[!d]* |
8a65cb50 | 462 | %attr(755,root,root) %{_libdir}/postfix/discard |
ce1e2926 | 463 | %attr(755,root,root) %{_libdir}/postfix/dnsblog |
9d5846cd | 464 | %attr(755,root,root) %dir %{_var}/spool/postfix |
150a0aa3 JB |
465 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/active |
466 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/bounce | |
467 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/corrupt | |
468 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/defer | |
469 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/deferred | |
470 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/incoming | |
9d5846cd | 471 | %attr(1730,postfix,maildrop) %dir %{_var}/spool/postfix/maildrop |
150a0aa3 JB |
472 | %attr(755,postfix,root) %dir %{_var}/spool/postfix/pid |
473 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/private | |
474 | %attr(710,postfix,maildrop) %dir %{_var}/spool/postfix/public | |
475 | %attr(700,postfix,root) %dir %{_var}/spool/postfix/saved | |
476 | %attr(644,postfix,root) %{_var}/spool/postfix/.nofinger | |
1dc0bd4f | 477 | %attr(700,postfix,root) %{_var}/lib/postfix |
996fb42e JB |
478 | %{_mandir}/man1/mailq.1* |
479 | %{_mandir}/man1/newaliases.1* | |
480 | %{_mandir}/man1/post*.1* | |
481 | %{_mandir}/man1/qmqp-*.1* | |
482 | %{_mandir}/man1/sendmail.1* | |
483 | %{_mandir}/man1/smtp-*.1* | |
484 | %{_mandir}/man5/access.5* | |
485 | %{_mandir}/man5/aliases.5* | |
486 | %{_mandir}/man5/body_checks.5* | |
487 | %{_mandir}/man5/bounce.5* | |
488 | %{_mandir}/man5/canonical.5* | |
489 | %{_mandir}/man5/cidr_table.5* | |
490 | %{_mandir}/man5/generic.5* | |
491 | %{_mandir}/man5/header_checks.5* | |
492 | %{_mandir}/man5/master.5* | |
4b9e8171 | 493 | %{_mandir}/man5/memcache_table.5* |
996fb42e JB |
494 | %{_mandir}/man5/nisplus_table.5* |
495 | %{_mandir}/man5/postconf.5* | |
b60ffb26 | 496 | %{_mandir}/man5/postfix-wrapper.5* |
996fb42e JB |
497 | %{_mandir}/man5/regexp_table.5* |
498 | %{_mandir}/man5/relocated.5* | |
499 | %{_mandir}/man5/tcp_table.5* | |
500 | %{_mandir}/man5/transport.5* | |
501 | %{_mandir}/man5/virtual.5* | |
502 | %{_mandir}/man8/*.8* | |
9e330f14 | 503 | |
504 | %files devel | |
505 | %defattr(644,root,root,755) | |
506 | %attr(755,root,root) %{_libdir}/libpostfix-*.so | |
507 | %{_includedir}/postfix | |
508 | ||
a675fe53 | 509 | %if %{with ldap} |
9e330f14 | 510 | %files dict-ldap |
511 | %defattr(644,root,root,755) | |
512 | %attr(755,root,root) %{_libdir}/postfix/dict_ldap.so | |
996fb42e | 513 | %{_mandir}/man5/ldap_table.5* |
a853cfe3 | 514 | %endif |
9e330f14 | 515 | |
a675fe53 | 516 | %if %{with mysql} |
9e330f14 | 517 | %files dict-mysql |
518 | %defattr(644,root,root,755) | |
519 | %attr(755,root,root) %{_libdir}/postfix/dict_mysql.so | |
996fb42e | 520 | %{_mandir}/man5/mysql_table.5* |
8acc733a | 521 | %endif |
9e330f14 | 522 | |
523 | %files dict-pcre | |
524 | %defattr(644,root,root,755) | |
525 | %attr(755,root,root) %{_libdir}/postfix/dict_pcre.so | |
996fb42e JB |
526 | #%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/pcre_table |
527 | %{_mandir}/man5/pcre_table.5* | |
8016f71d | 528 | |
a675fe53 | 529 | %if %{with pgsql} |
8016f71d JB |
530 | %files dict-pgsql |
531 | %defattr(644,root,root,755) | |
532 | %attr(755,root,root) %{_libdir}/postfix/dict_pgsql.so | |
996fb42e | 533 | %{_mandir}/man5/pgsql_table.5* |
a853cfe3 | 534 | %endif |
fad0c92b | 535 | |
a3d5ff4f | 536 | %if %{with sqlite} |
537 | %files dict-sqlite | |
538 | %defattr(644,root,root,755) | |
539 | %attr(755,root,root) %{_libdir}/postfix/dict_sqlite.so | |
540 | %{_mandir}/man5/sqlite_table.5* | |
541 | %endif | |
542 | ||
fad0c92b ER |
543 | %files qshape |
544 | %defattr(644,root,root,755) | |
545 | %attr(755,root,root) %{_bindir}/qshape | |
996fb42e | 546 | %{_mandir}/man1/qshape.1* |
614bf87e PG |
547 | |
548 | %files -n monit-rc-%{name} | |
549 | %defattr(644,root,root,755) | |
550 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc |