Advertisement
fakessh

postfix.spec

Oct 3rd, 2011
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.66 KB | None | 0 0
  1. # W A R N I N G -- DO NOT EDIT THIS FILE -- W A R N I N G
  2. #
  3. # postfix.spec
  4. #
  5. # This file was generated automatically from /usr/src/redhat/SOURCES/postfix.spec.in.
  6. # If you want to build postfix with other options see make-postfix.spec in
  7. # the same directory for instructions.
  8. # --
  9. # $Id: postfix.spec.in,v 2.305.2.13.2.7 2008/03/09 09:46:05 sjmudd Exp $
  10. #
  11. # File used to generate the distribution-specific postfix.spec file.
  12. # If you need to make changes to postfix.spec, make them to postfix.spec.in
  13. # and regenerate the spec file.
  14. #
  15. # See make-postfix.spec in %{_sourcedir} for more information.
  16. #
  17. # This spec file was built on distribution: rhel-5.0
  18. #
  19. # Information imported from postfix.spec.in: DO NOT CHANGE IT BY HAND
  20. #
  21. # mysql_paths - paths where locally installed MySQL resides (or 0)
  22. # - if using this option mysql_paths should be as
  23. # follows: </pathto/mysql/include>:</pathto/mysql/lib>
  24. # e.g.: /usr/mysql/include:/usr/mysql/lib
  25. # - The order is important and only 2 directories may
  26. # be given.
  27. # requires_db - used to add dbX dependencies in the package
  28. # smtpd_multiline_greeting - my patch to allow multiline banner
  29. # mps - man page suffix, .gz except Mandrake >= 8 which uses .bz2
  30. # with_cdb - include CDB support by Michael Tokarev
  31. # with_dovecot - include DOVECOT SASL authentication
  32. # with_ldap - include LDAP support
  33. # with_mysql - include support for www.mysql.com's MySQL rpms
  34. # with_mysql_redhat - include support for RedHat's MySQL rpms
  35. # with_pcre - include pcre support
  36. # with_pgsql - include Postgres database support
  37. # with_sasl - include Cyrus SASL/AUTH support (0 to disable sasl,
  38. # 1 for sasl v1, or 2 for sasl v2, sasl_library is
  39. # the sasl library to link against, distribution dependent)
  40. # with_tls - include TLS support
  41. # with_tlsfix - include TLS fix
  42. # - needed for rh6.2, rh9 and rhel3
  43. # with_vda - add virtual delivery agent patch
  44. # with_sqlite - include SQLITE support
  45. #
  46. # Please send bugfixes and comments to the packager.
  47. #
  48. # distribution which the spec file was built from
  49. %define distribution rhel-5.0
  50.  
  51. # distribution which we are building Postfix on
  52. # - call my script once to speed up build process
  53. %define distro_info %(sh $(rpm --eval '%{_sourcedir}')/postfix-get-distribution --distro-info)
  54. %define build_dist_full %(echo "%distro_info" | cut -d" " -f5)
  55. %define build_name %(echo "%distro_info" | cut -d" " -f1)
  56. %define build_major %(echo "%distro_info" | cut -d" " -f3)
  57. %define build_minor %(echo "%distro_info" | cut -d" " -f4)
  58. %define build_dist %{build_name}-%{build_major}.%{build_minor}
  59. %define mps %(test "%{build_name}" = mandrake -a "%{build_major}" -ge 8 && echo .bz2 || echo .gz)
  60.  
  61. %define mysql_paths 0
  62. %define mysql_local %(test "%{mysql_paths}" != 0 && echo 1 || echo 0)
  63. %define mysql_include %(echo "%{mysql_paths}" | cut -d: -f1)
  64. %define mysql_lib %(echo "%{mysql_paths}" | cut -d: -f2)
  65. # determine PCRE library based on distribution name
  66. %define pcre_requires %(test %{build_dist} = mandrake && echo libpcre0 || echo pcre)
  67. # determine SASL library based on distribution name
  68. %define sasl_library %(test %{build_dist} = mandrake && echo libsasl-devel || echo cyrus-sasl-devel)
  69. %define requires_db 4
  70. %define requires_zlib 1
  71. %define smtpd_multiline_greeting 1
  72.  
  73. # alternatives priority can now be changed in one place.
  74. # - this used to be 30 but RH seems to have defined other higher values
  75. # and some users need another value.
  76. # Don't change this unless you really think you need to.
  77. %define with_alt_prio 30
  78.  
  79. %define with_cdb 0
  80. %define with_ldap 1
  81. %define with_mysql 0
  82. %define with_mysql_redhat 1
  83. %define with_pcre 1
  84. %define with_pgsql 1
  85. %define with_sasl 2
  86. %define with_dovecot 1
  87. %define with_tls 1
  88. %define with_tlsfix 2
  89. %define with_vda 1
  90. %define with_sqlite 0
  91.  
  92. # support the conditional builds via rpm's --with debug
  93. %define debug %{?_with_debug:1}%{?!_with_debug:0}
  94.  
  95. # patch and version information
  96. %define V_vda 2.8.0
  97. %define V_postfinger 1.30
  98.  
  99. # If set to 1 if official version, 0 if snapshot
  100. %define official 1
  101. %define V_postfix 2.8.5
  102. %define rel 1.cdb.pcre.pgsql.mysql.sasl2.vda.sqlite.rhel5
  103. %if %{official}
  104. %define V_tarball %{V_postfix}
  105. %define ftp_dir official
  106. %else
  107. %define V_release_date RC2
  108. %define V_tarball %{V_postfix}-%{V_release_date}
  109. %define ftp_dir experimental
  110. %endif
  111. # rpm does not accept '-' in version strings so replace them with a '.'
  112. # - (only affects snapshots)
  113. %define V_package %(echo %{V_tarball} | sed 's/-/./g')
  114.  
  115. # rpm-workaround:
  116. #
  117. # We can NOT use %{_docdir}/%{name}-%{version} for installing the docs
  118. # from the 'install' section as RPM kindly removes this directory after
  119. # we have installed files to it. (standard part of 'doc' processing!)
  120. #
  121. #define docdir %{_docdir}/%{name}-%{version}
  122. %define docdir %{_docdir}/%{name}-%{V_package}-documentation
  123. %define readme_dir %{docdir}/readme
  124. %define html_dir %{docdir}/html
  125. %define examples_dir %{docdir}/examples
  126.  
  127. %define newaliases_path %{_bindir}/newaliases.postfix
  128. %define mailq_path %{_bindir}/mailq.postfix
  129. %define rmail_path %{_bindir}/rmail.postfix
  130. %define sendmail_path %{_sbindir}/sendmail.postfix
  131. # Don't use %{_libdir} as it gives the wrong directory on x86_64 servers
  132. %define usrlib_sendmail /usr/lib/sendmail.postfix
  133.  
  134. %define initdir /etc/rc.d/init.d
  135.  
  136. %define whinge /usr/bin/logger -p mail.info -t postfix/rpm
  137. %define die_cmd die(){ %whinge "$*"; exit 1; }
  138.  
  139. Name: postfix
  140. Group: System Environment/Daemons
  141. URL: http://www.postfix.org
  142. License: IBM Public License
  143. PreReq: chkconfig, initscripts, shadow-utils
  144. PreReq: /etc/init.d, /sbin/service, chkconfig >= 1.3
  145. Epoch: 2
  146.  
  147. Provides: MTA smtpd smtpdaemon
  148. Provides: %{_sbindir}/sendmail %{_bindir}/mailq %{_bindir}/newaliases %{_bindir}/rmail
  149. Provides: %{_mandir}/man1/newaliases.1.%{mps} %{_mandir}/man5/newaliases.5.%{mps}
  150.  
  151. Version: %{V_package}
  152. Release: %{rel}
  153. Packager: Simon J Mudd <[email protected]>
  154. Summary: Postfix Mail Transport Agent
  155. Vendor: Built on %{build_dist_full} (%{build_dist})
  156. Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/%{ftp_dir}/postfix-%{V_tarball}.tar.gz
  157. Source1: make-postfix.rpm
  158. Source2: postfix-get-distribution
  159. Source3: postfix-etc-init.d-postfix
  160. Source4: postfix-chroot.sh
  161. Source5: postfix-aliases
  162. Source7: postfix.spec.in
  163. Source8: make-postfix.spec
  164. Source10: README-Postfix-SASL-RedHat.txt
  165. Source16: http://postfix.wl0.org/ftp/postfinger/postfinger-%{V_postfinger}
  166.  
  167. # Sources >= 100 are config files
  168. Source100: postfix-sasl.conf
  169. Source101: postfix-pam.conf
  170. Source102: postfix-saslauthd.conf
  171.  
  172. # Obligatory Patches
  173. Patch3: postfix-files.patch
  174. Patch5: postfix-makedefs.patch
  175.  
  176. # Optional patches
  177. # FIXME: There is also a 64-bit patch (not included) for 2.5.4
  178. Patch4: http://vda.sourceforge.net/VDA/postfix-vda-%{V_vda}.patch.gz
  179.  
  180. # Multiline Greeting ptch
  181. Patch99: ftp://ftp.wl0.org/SOURCES/postfix-2.8.1-multiline-greeting.patch
  182.  
  183. BuildRoot: %{_tmppath}/%{name}-%{V_package}-buildroot
  184.  
  185. # Determine packaging requirements
  186. BuildRequires: /usr/bin/cc, gawk, sed, ed, patch, rpm >= 4
  187. Requires: gawk, sed, ed
  188.  
  189. %if %{requires_db}
  190. Requires: db%{requires_db}
  191. BuildRequires: db%{requires_db}-devel
  192. %endif
  193.  
  194. %if %{with_cdb}
  195. Requires: tinycdb
  196. BuildRequires: tinycdb
  197. %endif
  198.  
  199. %if %{with_ldap}
  200. Requires: openldap >= 1.2.9
  201. BuildRequires: openldap-devel >= 1.2.9
  202. %endif
  203.  
  204. %if %{with_pcre}
  205. Requires: %{pcre_requires}
  206. BuildRequires: %{pcre_requires}, %{pcre_requires}-devel
  207. %endif
  208.  
  209. # Needed by some Mysql and some TLS packages
  210. %if %{requires_zlib}
  211. Requires: zlib
  212. BuildRequires: zlib-devel
  213. %endif
  214.  
  215. %if %{with_mysql_redhat}
  216. Requires: mysql
  217. BuildRequires: mysql, mysql-devel
  218. %endif
  219.  
  220. %if %{mysql_local}
  221. BuildRequires: %{mysql_include}/mysql.h
  222. Requires: %{mysql_lib}/libmysqlclient.so
  223. %endif
  224.  
  225. %if %{with_mysql}
  226. Requires: MySQL-shared
  227. BuildRequires: MySQL-shared, MySQL-devel
  228. %endif
  229.  
  230. %if %{with_pgsql}
  231. Requires: postgresql-libs
  232. BuildRequires: postgresql-devel
  233. %endif
  234.  
  235. %if %{with_sasl}
  236. Requires: cyrus-sasl
  237. BuildRequires: cyrus-sasl, %{sasl_library}
  238. %endif
  239.  
  240. # Postfix compiled with Dovecot support only works with dovecot >= 1
  241. # - however requiring the dovecot rpm to be installed when it may
  242. # not be used means that there will be NO explicit dependency
  243. # added to the rpm.
  244. %if %{with_dovecot}
  245. #Requires: dovecot >= 1 NOT REQUIRED / DO NOT ADD
  246. %endif
  247.  
  248. %if %{with_tls}
  249. Requires: openssl
  250. BuildRequires: openssl-devel
  251. %endif
  252.  
  253. %if %{with_sqlite}
  254. Requires: sqlite
  255. BuildRequires: sqlite-devel
  256. %endif
  257.  
  258. %description
  259. Postfix is a Mail Transport Agent (MTA), intended to be an alternative
  260. to the widely-used sendmail. This package includes optional support for
  261. LDAP, pcre, mysql, SMTP AUTH (SASL) and TLS.
  262.  
  263. See http://www.redhat.com/support/docs/faqs/RH-postfix-FAQ/book1.html,
  264. a slightly outdated FAQ, which covers the steps involved in installing
  265. and configuring postfix.
  266.  
  267. The binary and source rpms I produce are currently available at
  268. http://postfix.WL0.org, ftp://ftp.WL0.org
  269. and the mirrors which can be found at the following URL:
  270. http://postfix.WL0.org/en/mirrors/
  271.  
  272. This package/specfile was built from postfix.spec.in.
  273. To see the build options used to build this package see the file %{_sysconfdir}/postfix/postfix.spec.cf
  274.  
  275. To use postfix with alternative options download the source package and
  276. rebuild the binary package following the instructions in the source
  277. package or on my web page.
  278.  
  279. %prep
  280. umask 022
  281.  
  282. %{die_cmd}
  283.  
  284. # check custom MYSQL path values are sensible to avoid problems
  285. # with people mixing include and lib directories
  286. if [ "%{mysql_paths}" != 0 ]; then
  287. exit_error() {
  288. cat <<-EOF
  289. *************************************************************************
  290. CUSTOM MYSQL configuration error
  291. mysql_paths=%mysql_paths (0=Not used)
  292. mysql_local=%mysql_local (0=Not used,1=used)
  293. mysql_include=%mysql_include (include directory)
  294. mysql_lib=%mysql_lib (lib directory)
  295. ERROR: $1
  296. If you don't want to use a custom mysql installation set
  297. mysql_paths to 0.
  298. *************************************************************************
  299. EOF
  300. exit 1
  301. }
  302. [ $(echo "%{mysql_paths}" | awk -F: '{ print NF }') = 2 ] || \
  303. exit_error "mysql_paths should be of the form /pathto/mysql/include:/pathto/mysql/lib, with only 2 directories"
  304. echo "%{mysql_include}" | grep -q "/lib" && \
  305. exit_error "The first path in mysql_paths appears to be a library path: it should be an include path (e.g. /usr/local/include)"
  306. echo "%{mysql_lib}" | grep -q "/include" && \
  307. exit_error "The second path in mysql_paths appears to be an include path: it should be a library path (e.g. /usr/local/lib)"
  308. fi
  309.  
  310. # Warn if the distribution this spec file was made for isn't the same as
  311. # the current distribution, using a script in the SOURCES directory.
  312. # This will be removed and built into the spec file later.
  313.  
  314. distribution=$(sh $(rpm --eval '%{_sourcedir}')/postfix-get-distribution)
  315.  
  316. if [ "${distribution}" != "%{distribution}" ]; then
  317. cat <<ENDTEXT
  318. ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
  319.  
  320. This postfix.spec file may not work correctly.
  321. It was built for %{distribution}, while you are running ${distribution}.
  322.  
  323. Please rebuild postfix.spec for your distribution by following the
  324. instructions in postfix.spec.cf.
  325.  
  326. If this procedure does not allow you to produce a working package, please
  327. let me know.
  328.  
  329. ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR
  330. ENDTEXT
  331. exit 1
  332. fi
  333.  
  334. %setup -q -n postfix-%{V_tarball}
  335.  
  336. # Apply obligatory patches
  337. %patch3 -p1 -b .alternatives
  338. %patch5 -p1 -b .notls
  339.  
  340. # Apply optional patches
  341. %if %{with_vda}
  342. test -e %{_sourcedir}/postfix-vda-%{V_vda}.patch.gz && \
  343. gzip -dc %{_sourcedir}/postfix-vda-%{V_vda}.patch.gz | patch -p1 -b --suffix .vda -s || \
  344. die "POSTFIX RPM: %{_sourcedir}/postfix-vda-%{V_vda}.patch.gz not found or patch failed"
  345. %endif
  346.  
  347. %if %{smtpd_multiline_greeting}
  348. %patch99 -p1 -b .multiline
  349. %endif
  350.  
  351. # Modify master.cf: rmail --> rmail.postfix
  352. ed conf/master.cf <<EOF || exit 1
  353. H
  354. ,s/rmail/rmail.postfix/
  355. w
  356. q
  357. EOF
  358.  
  359. %build
  360. umask 022
  361.  
  362. CCARGS=""
  363. AUXLIBS=
  364.  
  365. %ifarch s390 s390x ppc
  366. CCARGS="${CCARGS} -fsigned-char"
  367. %endif
  368.  
  369. %if %{with_cdb}
  370. CCARGS="${CCARGS} -DHAS_CDB"
  371. AUXLIBS="${AUXLIBS} -lcdb"
  372. %endif
  373.  
  374. %if %{with_ldap}
  375. CCARGS="${CCARGS} -DHAS_LDAP"
  376. AUXLIBS="${AUXLIBS} -L/usr/%{_lib} -lldap -llber"
  377. %endif
  378.  
  379. %if %{with_pcre}
  380. # -I option required for pcre 3.4 (and later?)
  381. CCARGS="${CCARGS} -DHAS_PCRE -I/usr/include/pcre"
  382. AUXLIBS="${AUXLIBS} -lpcre"
  383. %else
  384. # we need to explicitly disable pcre unless asked for, otherwise it will
  385. # be included if present on the build system. This may cause problems.
  386. CCARGS="${CCARGS} -DNO_PCRE"
  387. %endif
  388.  
  389. # Postfix compiles without needing zlib on RedHat's mysql package, but
  390. # requires zlib when using MySQL's package or if using a locally installed
  391. # MySQL binary.
  392. %if %{with_mysql} || %{with_mysql_redhat}
  393. CCARGS="${CCARGS} -DHAS_MYSQL -I/usr/include/mysql"
  394. AUXLIBS="${AUXLIBS} -L/usr/%{_lib}/mysql -lmysqlclient -lm"
  395. %endif
  396.  
  397. %if %{mysql_local}
  398. CCARGS="${CCARGS} -DHAS_MYSQL -I%{mysql_include}"
  399. AUXLIBS="${AUXLIBS} -L%{mysql_lib} -lmysqlclient -lm"
  400. %endif
  401.  
  402. %if %{with_pgsql}
  403. CCARGS="${CCARGS} -DHAS_PGSQL -I/usr/include/pgsql"
  404. AUXLIBS="${AUXLIBS} -lpq -lcrypt"
  405. %endif
  406.  
  407. %if %{with_sqlite}
  408. CCARGS="${CCARGS} -DHAS_SQLITE -I/usr/include"
  409. AUXLIBS="${AUXLIBS} -lsqlite3"
  410. %endif
  411.  
  412. %if %{with_sasl}
  413. if [ "%{with_sasl}" -le 1 ]; then
  414. %define sasl_lib_dir %{_libdir}/sasl
  415. CCARGS="${CCARGS} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL"
  416. AUXLIBS="${AUXLIBS} -L%{sasl_lib_dir} -lsasl"
  417. else
  418. %define sasl_lib_dir %{_libdir}/sasl2
  419. CCARGS="${CCARGS} -I/usr/include/sasl -DUSE_SASL_AUTH -DUSE_CYRUS_SASL"
  420. AUXLIBS="${AUXLIBS} -L%{sasl_lib_dir} -lsasl2"
  421. fi
  422. %endif
  423.  
  424. # Provide support for Dovecot SASL
  425. %if %{with_dovecot}
  426. CCARGS="${CCARGS} -DUSE_SASL_AUTH"
  427. # make dovecot the default IFF we don't include SASL
  428. if [ "%{with_sasl}" = 0 ]; then
  429. CCARGS="${CCARGS} -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
  430. fi
  431. %endif
  432.  
  433. %if %{with_tls}
  434. # See http://www.openldap.org/lists/openldap-devel/200105/msg00008.html
  435. # - rh6.2 needs LIBS=-ldl to build correctly.
  436. # - reported by Jauder Ho <[email protected]>
  437. if pkg-config openssl; then
  438. CCARGS="${CCARGS} -DUSE_TLS $(pkg-config --cflags openssl)"
  439. AUXLIBS="${AUXLIBS} $(pkg-config --libs openssl)"
  440. else
  441. #
  442. # CHECK THIS - these lines may no longer be needed (required for external TLS patch)
  443. #
  444. [ "%{with_tlsfix}" = 1 ] && LIBS=-ldl
  445. [ "%{with_tlsfix}" = 2 ] && CCARGS="${CCARGS} -I/usr/kerberos/include"
  446. CCARGS="${CCARGS} -DUSE_TLS -I/usr/include/openssl"
  447. AUXLIBS="${AUXLIBS} -lssl -lcrypto"
  448. fi
  449. %else
  450. # explicitly disable TLS otherwise will be built on machine if
  451. # openssl is available
  452. CCARGS="${CCARGS} -DNO_TLS"
  453. %endif
  454.  
  455. # Required by some TLS implementations (RHEL 3 and RH9) and also some MySQL
  456. # packages
  457. %if %{requires_zlib}
  458. AUXLIBS="${AUXLIBS} -lz"
  459. %endif
  460.  
  461. export CCARGS AUXLIBS
  462. make tidy
  463. make -f Makefile.init makefiles
  464. unset CCARGS AUXLIBS
  465. # -Wno-comment needed due to large number of warnings on RHEL5
  466. # suggestion by Eric Hoeve <[email protected]>
  467. RPM_OPT_FLAGS="$(rpm --eval '%{optflags}' | %{__perl} -pe 's/(-g|\{|\})//g')"
  468. make DEBUG="%{?_with_debug:-g}" OPT="$RPM_OPT_FLAGS -fsigned-char -Wno-comment -Wno-missing-braces -Wno-unused-variable -Wno-unused-value -Wno-unused-function -Wno-uninitialized"
  469.  
  470. %pre
  471. umask 022
  472.  
  473. # create postfix user and group, and maildrop group if necessary.
  474. # Use perl rather than looking in /etc/passwd or /etc/group as this works
  475. # in a wider NIS or LDAP environment
  476.  
  477. /usr/bin/getent group postdrop >/dev/null || {
  478. %whinge "Adding postdrop group to system"
  479. %{_sbindir}/groupadd -r postdrop
  480. }
  481.  
  482. /usr/bin/getent group postfix >/dev/null || {
  483. %whinge "Adding postfix group to system"
  484. %{_sbindir}/groupadd -r postfix
  485. }
  486.  
  487. /usr/bin/getent passwd postfix >/dev/null || {
  488. %whinge "Adding postfix user to system"
  489. %{_sbindir}/useradd -d %{_var}/spool/postfix -s /bin/true -g postfix -G mail -M -r postfix
  490. }
  491.  
  492. # Add postfix user to the mail group. This is needed for people using cyrus,
  493. # linked by unix sockets (amongst other things).
  494. test -z "$(id postfix | awk '{print $3}' | sed -e 's/groups=//' | grep mail)" && {
  495. %whinge "Adding postfix user to mail group"
  496. %{_sbindir}/usermod -G mail postfix
  497. }
  498.  
  499. # check for a new install and see if a non package installed Postfix might
  500. # exist. Attempt to avoid overwriting the source config and provide a warning.
  501. if [ "$1" = 0 ]; then
  502. timenow=$(date +%Y%m%d-%H%M%)
  503. pretext="This is a new Postfix RPM installation"
  504. [ -f %{_sysconfdir}/postfix ] && {
  505. [ -n "$pretext" ] && %whinge "$pretext" && pretext=
  506. %whinge "Detected a possible previous non-RPM install in %{_sysconfdir}/postfix."
  507. %whinge "- going to move it out of the way to %{_sysconfdir}/postfix.$timenow."
  508. mv %{_sysconfdir}/postfix %{_sysconfdir}/postfix.$timenow
  509. }
  510. [ -d %{initdir}/postfix ] && {
  511. [ -n "$pretext" ] && %whinge "$pretext" && pretext=
  512. %whinge "Detected a possible previous non-RPM startup script %{initdir}/postfix."
  513. %whinge "- going to move it out of the way to %{initdir}/postfix.$timenow."
  514. mv %{initdir}/postfix %{initdir}/postfix.$timenow
  515. }
  516. fi
  517.  
  518. exit 0
  519.  
  520. %install
  521. umask 022
  522.  
  523. [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ] && {
  524. rm -rf ${RPM_BUILD_ROOT}
  525. mkdir -p ${RPM_BUILD_ROOT}
  526. }
  527.  
  528. %{?!debug:strip -R .comment --strip-unneeded bin/* libexec/*}
  529.  
  530. # rename man pages which may conflict with sendmail's
  531. mv man/man1/mailq.1 man/man1/mailq.postfix.1
  532. mv man/man1/newaliases.1 man/man1/newaliases.postfix.1
  533. mv man/man1/sendmail.1 man/man1/sendmail.postfix.1
  534. mv man/man5/aliases.5 man/man5/aliases.postfix.5
  535.  
  536. # install postfix into build root
  537. sh postfix-install -non-interactive \
  538. install_root=${RPM_BUILD_ROOT} \
  539. config_directory=%{_sysconfdir}/postfix \
  540. daemon_directory=%{_libexecdir}/postfix \
  541. command_directory=%{_sbindir} \
  542. queue_directory=%{_var}/spool/postfix \
  543. sendmail_path=%{sendmail_path} \
  544. newaliases_path=%{newaliases_path} \
  545. mailq_path=%{mailq_path} \
  546. mail_owner=postfix \
  547. setgid_group=postdrop \
  548. html_directory=%{html_dir} \
  549. manpage_directory=%{_mandir} \
  550. readme_directory=%{readme_dir} || exit 1
  551.  
  552. # To be compatible with later versions of RH sendmail/postfix packages
  553. # make /usr/lib/sendmail.postfix point to /usr/sbin/sendmail.postfix.
  554. # The alternatives then point /usr/lib/sendmail to /usr/lib/sendmail.postfix.
  555. # This *is* all a bit silly ...
  556.  
  557. install -d -m755 $RPM_BUILD_ROOT/usr/lib
  558. ln -sf ../sbin/sendmail.postfix $RPM_BUILD_ROOT%{usrlib_sendmail}
  559.  
  560. # RPM compresses man pages automatically. Edit postfix-files to avoid
  561. # confusing post-install.
  562. ed ${RPM_BUILD_ROOT}%{_libexecdir}/postfix/postfix-files <<EOF || exit 1
  563. H
  564. ,s/\(\/man[158]\/.*\.[158]\):/\1%{mps}:/
  565. w
  566. q
  567. EOF
  568.  
  569. # Change alias_maps and alias_database default directory to use
  570. # %{_sysconfdir}/postfix
  571. bin/postconf -c ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix -e \
  572. "alias_maps = hash:%{_sysconfdir}/postfix/aliases" \
  573. "alias_database = hash:%{_sysconfdir}/postfix/aliases" \
  574. || exit 1
  575.  
  576. # Change default smtpd_sasl... parameters for dovecot
  577. # - override postfix default behaviour IFF not using cyrus sasl.
  578. # - main.cf can still be adjusted manually after installation if required.
  579. %if %{with_dovecot}
  580. if [ "%{with_sasl}" = 0 ]; then
  581. bin/postconf -c ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix -e \
  582. "smtpd_sasl_type = dovecot" \
  583. "smtpd_sasl_path = private/auth" \
  584. || exit 1
  585. fi
  586. %endif
  587. # Fix a typo in some of the documentation.
  588. perl -pi -e "s/DEF_SASL_SERVER_TYPE/DEF_SERVER_SASL_TYPE/g" */SASL_README*
  589.  
  590. # Install Sys V init script
  591. mkdir -p ${RPM_BUILD_ROOT}%{initdir}
  592. install -c %{_sourcedir}/postfix-etc-init.d-postfix \
  593. ${RPM_BUILD_ROOT}%{initdir}/postfix
  594.  
  595. install -c auxiliary/rmail/rmail ${RPM_BUILD_ROOT}%{rmail_path}
  596. install -c auxiliary/qshape/qshape.pl ${RPM_BUILD_ROOT}/%{_sbindir}/qshape
  597.  
  598. # copy new aliases files and generate a ghost aliases.db file
  599. cp -f %{_sourcedir}/postfix-aliases ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/aliases
  600. chmod 644 ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/aliases
  601.  
  602. touch ${RPM_BUILD_ROOT}/%{_sysconfdir}/postfix/aliases.db
  603.  
  604. for i in active bounce corrupt defer deferred flush incoming private saved \
  605. hold maildrop public pid; do
  606. mkdir -p ${RPM_BUILD_ROOT}%{_var}/spool/postfix/$i
  607. done
  608.  
  609. # install qmqp-source, smtp-sink & smtp-source by hand
  610. for i in qmqp-source smtp-sink smtp-source; do
  611. install -c -m 755 bin/$i ${RPM_BUILD_ROOT}%{_sbindir}/$i
  612. done
  613.  
  614. # install postfinger and postfix-chroot.sh scripts
  615. # - postfix-chroot.sh is placed in /etc/postfix to make it more visible
  616. install -c -m 755 %{_sourcedir}/postfinger-%{V_postfinger} ${RPM_BUILD_ROOT}%{_bindir}/postfinger
  617. install -c -m 755 %{_sourcedir}/postfix-chroot.sh ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/
  618.  
  619. [ -d "${RPM_BUILD_ROOT}%{html_dir}" ] || mkdir -p ${RPM_BUILD_ROOT}%{html_dir}
  620. [ -d "${RPM_BUILD_ROOT}%{readme_dir}" ] || mkdir -p ${RPM_BUILD_ROOT}%{readme_dir}
  621. install -c -m 644 %{_sourcedir}/README-Postfix-SASL-RedHat.txt ${RPM_BUILD_ROOT}%{readme_dir}/
  622. [ -d "${RPM_BUILD_ROOT}%{examples_dir}" ] || mkdir -p ${RPM_BUILD_ROOT}%{examples_dir}
  623. cp -pr examples/* ${RPM_BUILD_ROOT}%{examples_dir}/
  624. # disable execution permissions to avoid rpm generating dependencies
  625. find ${RPM_BUILD_ROOT}%{examples_dir}/ -type f -exec chmod -x {} \;
  626.  
  627. # Install odd documentation files
  628. for file in AAAREADME COMPATIBILITY COPYRIGHT HISTORY PORTING \
  629. RELEASE_NOTES RELEASE_NOTES-1.0 RELEASE_NOTES-1.1 \
  630. RELEASE_NOTES-2.0 RELEASE_NOTES-2.1 RELEASE_NOTES-2.2 \
  631. RELEASE_NOTES-2.3 RELEASE_NOTES-2.4 RELEASE_NOTES-2.5 \
  632. RELEASE_NOTES-2.6 RELEASE_NOTES-2.7 \
  633. TLS_ACKNOWLEDGEMENTS TLS_CHANGES TLS_LICENSE LICENSE \
  634. US_PATENT_6321267 IPv6-ChangeLog TLS_TODO
  635. do
  636. install -c -m 644 $file ${RPM_BUILD_ROOT}%{docdir}/
  637. done
  638. cat <<EOF >${RPM_BUILD_ROOT}%{docdir}/SEE_ALSO
  639. %{_docdir}/%{name}-%{version} may contain other documentation files.
  640. EOF
  641.  
  642. # added for convenience
  643. ln -sf %{html_dir} ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/html
  644. ln -sf %{readme_dir} ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/readme
  645. ln -sf %{examples_dir} ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/examples
  646.  
  647. # Install the smtpd.conf file for SASL support.
  648. %if %{with_sasl}
  649. mkdir -p ${RPM_BUILD_ROOT}%{sasl_lib_dir}
  650. install -m 644 %SOURCE100 ${RPM_BUILD_ROOT}%{sasl_lib_dir}/smtpd.conf
  651. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
  652. install -m 644 %SOURCE101 ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/smtp.postfix
  653. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
  654. install -m 644 %SOURCE102 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/saslauthd.postfix
  655. %endif
  656.  
  657. # Include README.rpm explaining where the documentation can be found and
  658. # also pointing out how to get updated copies of my package
  659. cat <<EOF > ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/README.rpm
  660. README.rpm
  661. ==========
  662.  
  663. Documentation
  664. -------------
  665.  
  666. Postfix documentation should be available in the directory %{docdir}/.
  667. I have also added a symbolic link to the readme_files and html
  668. directories from %{_sysconfdir}/postfix.
  669.  
  670. The main Postfix web site is http://www.postfix.org.
  671.  
  672. Packages
  673. --------
  674.  
  675. Newer versions of source and standard binary packages may be available from
  676. http://ftp.WL0.org or the mirrors listed at http://postfix.WL0.org. Look
  677. in the appropriate directory according to your distribution.
  678.  
  679. Mailing List
  680. ------------
  681.  
  682. I host a mailing list to announce new packages as they are released. If you
  683. are interested in subscribing take a look at
  684. http://postfix.WL0.org/en/lists/. Previous announcements are archived.
  685.  
  686. Chrooting
  687. ---------
  688.  
  689. The chroot behaviour of my packages has changed over time. Current
  690. packages will NOT turn on the chroot environment in Postfix. Older
  691. versions did the opposite. If you upgrade from an older version
  692. of my package the chroot behaviour will NOT be changed. (Check
  693. %{_sysconfdir}/postfix/master.cf for details.)
  694.  
  695. I have provided a simple script postfix-chroot.sh which attempts to
  696. cover most situations and should enable you to disable or enable the
  697. chroot on your system with little effort.
  698.  
  699. Package Build Options
  700. ---------------------
  701.  
  702. This package can be built on several Linux distributions and with several
  703. optional features. %{_sysconfdir}/postfix/postfix.spec.cf contains the
  704. information used to build this version of the rpm. It can also
  705. be used to build a new rpm with the same options.
  706.  
  707. Enjoy!
  708.  
  709. Simon J Mudd, <[email protected]>
  710. EOF
  711.  
  712. # generate postfix.spec.cf
  713. # - used to build a newer version of the rpm with the same parameters
  714. # as the current package.
  715. # - provides build instructions
  716. cat - %{_sourcedir}/postfix.spec.cf <<EOF | sed -e '/^# NOTE:/d' > ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/postfix.spec.cf
  717. #
  718. # This file contains the following information:
  719. #
  720. # - configuration options used to build the installed postfix rpm
  721. # - generated when the binary rpm was built
  722. #
  723. # - Postfix RPM build instructions
  724. # - for upgrading the installed rpm with the same options
  725. # - for building the rpm with other options
  726. #
  727. # 1. CONFIGURATION OPTIONS OF INSTALLED BINARY RPM
  728. #
  729. # Package built on: %{build_dist_full} (%{build_dist})
  730.  
  731. POSTFIX_ALT_PRIO=%{with_alt_prio}
  732. POSTFIX_CDB=%{with_cdb}
  733. POSTFIX_DB=%{requires_db}
  734. POSTFIX_DOVECOT=%{with_dovecot}
  735. POSTFIX_LDAP=%{with_ldap}
  736. POSTFIX_MYSQL=%{with_mysql}
  737. POSTFIX_MYSQL_PATHS=%{mysql_paths}
  738. POSTFIX_MYSQL_REDHAT=%{with_mysql_redhat}
  739. POSTFIX_PCRE=%{with_pcre}
  740. POSTFIX_PGSQL=%{with_pgsql}
  741. POSTFIX_SASL=%{with_sasl}
  742. POSTFIX_SMTPD_MULTILINE_GREETING=%{smtpd_multiline_greeting}
  743. POSTFIX_TLS=%{with_tls}
  744. POSTFIX_VDA=%{with_vda}
  745. POSTFIX_SQLITE=%{with_sqlite}
  746.  
  747. # export values to child processes
  748. export POSTFIX_MYSQL POSTFIX_MYSQL_PATHS POSTFIX_MYSQL_REDHAT \\
  749. POSTFIX_LDAP POSTFIX_PCRE POSTFIX_PGSQL \\
  750. POSTFIX_SASL POSTFIX_TLS POSTFIX_VDA \\
  751. POSTFIX_SMTPD_MULTILINE_GREETING POSTFIX_DB \\
  752. POSTFIX_INCLUDE_DB POSTFIX_SQLITE \\
  753. POSTFIX_CDB POSTFIX_ALT_PRIO POSTFIX_DOVECOT
  754.  
  755. # other options used in the build (but not explicitly changeable by the user) are:
  756. # - debug=%{?_with_debug:1}%{?!_with_debug:0}
  757. # - pcre_requires=%{pcre_requires},
  758. # - requires_zlib=%{requires_zlib},
  759. # - sasl_library=%{sasl_library}
  760. # - tlsfix=%{with_tlsfix}
  761. #
  762. # %{_sysconfdir}/postfix/makedefs.out is also produced by the build and may be of
  763. # interest if you are building Postfix by hand.
  764. EOF
  765.  
  766. %post
  767. umask 022
  768.  
  769. chkconfig --add postfix
  770.  
  771. # Upgrade configuration as necessary
  772. sh %{_libexecdir}/postfix/post-install upgrade-package \
  773. config_directory=%{_sysconfdir}/postfix \
  774. daemon_directory=%{_libexecdir}/postfix \
  775. command_directory=%{_sbindir} \
  776. mail_owner=postfix \
  777. setgid_group=postdrop \
  778. html_directory=%{html_dir} \
  779. manpage_directory=%{_mandir} \
  780. readme_directory=%{readme_dir} \
  781. sendmail_path=%{sendmail_path} \
  782. newaliases_path=%{newaliases_path} \
  783. mailq_path=%{mailq_path} \
  784. || :
  785.  
  786. %{_sbindir}/postalias %{_sysconfdir}/postfix/aliases
  787. %{_sbindir}/postfix check || :
  788.  
  789. # Add submission to services if not found, required for rh <= 7.0
  790. if ! grep -q ^submission %{_sysconfdir}/services
  791. then
  792. cat <<EOF >>%{_sysconfdir}/services
  793. submission 587/tcp msa # mail message submission
  794. submission 587/udp msa # mail message submission
  795. EOF
  796. fi
  797.  
  798. # Add smtps to services if not found
  799. if ! grep -q ^smtps %{_sysconfdir}/services
  800. then
  801. cat <<EOF >>%{_sysconfdir}/services
  802. smtps 465/tcp # SMTP over SSL (TLS)
  803. EOF
  804. fi
  805.  
  806. # If using sasl create %{_sysconfdir}/sysconfig/saslauthd if necessary
  807. # - this file is provided in some (but not all) cyrus-sasl packages
  808. # - RHEL3 provides this file in cyrus-sasl >= 2.1.18-2
  809. %if %{with_sasl}
  810. [ -f %{_sysconfdir}/sysconfig/saslauthd ] || {
  811. grep -v "^# NOTE: " %{_sysconfdir}/sysconfig/saslauthd.postfix > %{_sysconfdir}/sysconfig/saslauthd
  812. chmod 644 %{_sysconfdir}/sysconfig/saslauthd
  813. %{whinge} "creating new %{_sysconfdir}/sysconfig/saslauthd from local Postfix copy"
  814. }
  815. %endif
  816.  
  817. # Add comments to the /etc/dovecot.conf configuration file if it exists
  818. # showing how to configure with Postfix if needed. If postfix is mentioned
  819. # in the dovecot configuration file then DO NOTHING.
  820.  
  821. DOVECOT_CONF=/etc/dovecot.conf
  822. if [ -f $DOVECOT_CONF ] && ! grep -q postfix $DOVECOT_CONF; then
  823. # Check if auth default is configured and add a COMMENTED SECTION
  824. # taken from the SASL_README file.
  825. if grep -q 'auth default' $DOVECOT_CONF; then
  826. ed $DOVECOT_CONF <<-EOF_END || exit 1
  827. /auth default {
  828. a
  829.  
  830. # Postfix - suggested configuration taken from SASL_README (2.3.2).
  831. # mechanisms = plain login
  832. # socket listen {
  833. # client {
  834. # path = /var/spool/postfix/private/auth
  835. # mode = 0660
  836. # user = postfix
  837. # group = postfix
  838. # }
  839. # }
  840.  
  841. .
  842. w
  843. q
  844. EOF_END
  845. else
  846. # Add the whole section at the end.
  847. cat <<-EOF_END >> $DOVECOT_CONF
  848.  
  849. # Postfix - suggested configuration taken from SASL_README (2.3.2).
  850. #auth default {
  851. # mechanisms = plain login
  852. # passdb pam {
  853. # }
  854. # userdb passwd {
  855. # }
  856. # socket listen {
  857. # client {
  858. # path = /var/spool/postfix/private/auth
  859. # mode = 0660
  860. # user = postfix
  861. # group = postfix
  862. # }
  863. # }
  864. #}
  865.  
  866. EOF_END
  867. fi
  868. fi
  869.  
  870. # Apply the alternatives scripts ONLY if installing (not upgrading) to
  871. # ensure a link exists from %{_sbindir}/sendmail to
  872. # %{sendmail_path} (and other files).
  873. #
  874. # If performing an upgrade this MUST be done in the trigger scripts.
  875. # (old postfix packages, pre-alternatives have a /usr/sbin/sendmail and this
  876. # gets removed _AFTER_ the %post stage when the old package is removed)
  877.  
  878. [ "$1" = 1 ] || exit 0
  879.  
  880. # See changelog for explanation of mta-sendmailman entry.
  881. %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{sendmail_path} %{with_alt_prio} \
  882. --slave %{_bindir}/mailq mta-mailq %{mailq_path} \
  883. --slave %{_bindir}/newaliases mta-newaliases %{newaliases_path} \
  884. --slave %{_bindir}/rmail mta-rmail %{rmail_path} \
  885. --slave /usr/lib/sendmail mta-sendmail %{usrlib_sendmail} \
  886. --slave %{_mandir}/man8/sendmail.8%{mps} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{mps} \
  887. --slave %{_mandir}/man1/mailq.1%{mps} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{mps} \
  888. --slave %{_mandir}/man1/newaliases.1%{mps} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{mps} \
  889. --slave %{_mandir}/man5/aliases.5%{mps} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{mps} \
  890. --initscript postfix
  891.  
  892. exit 0
  893.  
  894. %triggerpostun -- sendmail
  895.  
  896. # If removing sendmail and not using alternatives: replace with postfix equivalents
  897. %whinge "%{V_postfix}-%{rel} triggerpostun -- sendmail: final number of sendmail packages=$2"
  898. [ $2 = 0 ] || exit 0
  899.  
  900. # See changelog for explanation of mta-sendmailman entry.
  901. %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{sendmail_path} %{with_alt_prio} \
  902. --slave %{_bindir}/mailq mta-mailq %{mailq_path} \
  903. --slave %{_bindir}/newaliases mta-newaliases %{newaliases_path} \
  904. --slave %{_bindir}/rmail mta-rmail %{rmail_path} \
  905. --slave /usr/lib/sendmail mta-sendmail %{usrlib_sendmail} \
  906. --slave %{_mandir}/man8/sendmail.8%{mps} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{mps} \
  907. --slave %{_mandir}/man1/mailq.1%{mps} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{mps} \
  908. --slave %{_mandir}/man1/newaliases.1%{mps} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{mps} \
  909. --slave %{_mandir}/man5/aliases.5%{mps} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{mps} \
  910. --initscript postfix
  911. exit 0 # ensure the trigger exit status is 0
  912.  
  913. %triggerpostun -- postfix
  914.  
  915. # If upgrading postfix some versions are pre-alternatives and use
  916. # /usr/sbin/sendmail. After uninstalling the old package this file will be
  917. # missing and we need to link to the new postfix sendmail binary.
  918. %whinge "%{V_postfix}-%{rel} triggerpostun -- postfix: final number of Postfix packages=$2"
  919. [ $2 -gt 0 ] || exit 0
  920.  
  921. # See changelog for explanation of mta-sendmailman entry.
  922. %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{sendmail_path} %{with_alt_prio} \
  923. --slave %{_bindir}/mailq mta-mailq %{mailq_path} \
  924. --slave %{_bindir}/newaliases mta-newaliases %{newaliases_path} \
  925. --slave %{_bindir}/rmail mta-rmail %{rmail_path} \
  926. --slave /usr/lib/sendmail mta-sendmail %{usrlib_sendmail} \
  927. --slave %{_mandir}/man8/sendmail.8%{mps} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{mps} \
  928. --slave %{_mandir}/man1/mailq.1%{mps} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{mps} \
  929. --slave %{_mandir}/man1/newaliases.1%{mps} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{mps} \
  930. --slave %{_mandir}/man5/aliases.5%{mps} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{mps} \
  931. --initscript postfix
  932. exit 0 # ensure the trigger exit status is 0
  933.  
  934. %preun
  935. umask 022
  936.  
  937. # remove the directory and depth levels of subdirectories
  938.  
  939. queue_hash_depth_remove () {
  940. local dir=$1
  941. local depth=$2
  942. local new_depth
  943. local a
  944. [ -d "$dir" ] && {
  945. if [ "$depth" -gt 0 ]; then
  946. new_depth=$(($depth - 1))
  947. for a in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do
  948. test -d $dir/$a && queue_hash_depth_remove $dir/$a $new_depth
  949. done
  950. fi
  951. rm -f $dir/*
  952. rmdir $dir || %whinge "WARNING: preun - unable to remove directory %{_var}/spool/postfix/$dir"
  953. }
  954. }
  955.  
  956. # remove the rest of the queue directory structure
  957. queue_directory_remove () {
  958. # remove the hashed directories
  959. depth=$(postconf -h hash_queue_depth)
  960. for dir in $(postconf -h hash_queue_names | sed -e 's/,/\n/g; s/ //g'); do
  961. queue_hash_depth_remove $dir $depth
  962. done
  963.  
  964. # now remove the other directories
  965. for dir in corrupt hold maildrop pid private public saved; do
  966. queue_hash_depth_remove $dir 0
  967. done
  968. }
  969.  
  970. # No more postfix packages left so prepare to finish package removal.
  971. # _In theory_ there is no chroot environment now, so there is no need to
  972. # clean it out.
  973. # However it may be prudent later to add back a call to
  974. # /etc/postfix/postfix-chroot.sh disable
  975. # just to make sure, but won't do this yet. (If you think I should let
  976. # me know).
  977. if [ "$1" = 0 ]; then
  978. service postfix stop >/dev/null 2>&1
  979. chkconfig --del postfix
  980.  
  981. %{_sbindir}/alternatives --remove mta %{sendmail_path}
  982.  
  983. # userdel also deletes the user's group
  984. %{_sbindir}/userdel postfix || %whinge "WARNING: failed to remove user postfix"
  985. %{_sbindir}/groupdel postdrop || %whinge "WARNING: failed to remove group postdrop"
  986.  
  987. cd %{_var}/spool/postfix && queue_directory_remove
  988. fi
  989.  
  990. exit 0
  991.  
  992. %postun
  993. umask 022
  994. if [ "$1" -ge 1 ]; then
  995. service postfix condrestart || :
  996. # don't use readlink as this is not available on rh73
  997. mta=`[ -L /etc/alternatives/mta ] && ls -la /etc/alternatives/mta | awk '{ print $11 }'`
  998. if [ "$mta" = "%{sendmail_path}" ]; then
  999. %{_sbindir}/alternatives --set mta %{sendmail_path}
  1000. fi
  1001. fi
  1002. exit 0
  1003.  
  1004. %clean
  1005. umask 022
  1006. [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ] && {
  1007. rm -rf ${RPM_BUILD_ROOT}
  1008. } || :
  1009.  
  1010. %files
  1011. %defattr(-, root, root)
  1012.  
  1013. %if %{with_sasl}
  1014. %config(noreplace) %{sasl_lib_dir}/smtpd.conf
  1015. %config(noreplace) %{_sysconfdir}/pam.d/smtp.postfix
  1016. %config(noreplace) %{_sysconfdir}/sysconfig/saslauthd.postfix
  1017. %endif
  1018.  
  1019. %verify(not md5 size mtime) %config %dir %{_sysconfdir}/postfix
  1020. %attr(0644, root, root) %{_sysconfdir}/postfix/LICENSE
  1021. %attr(0644, root, root) %{_sysconfdir}/postfix/TLS_LICENSE
  1022. %attr(0444, root, root) %config %{_sysconfdir}/postfix/makedefs.out
  1023. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/main.cf
  1024. %attr(0644, root, root) %{_sysconfdir}/postfix/main.cf.default
  1025. %attr(0644, root, root) %{_sysconfdir}/postfix/bounce.cf.default
  1026. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/master.cf
  1027. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/access
  1028. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/aliases
  1029. %attr(0644, root, root) %verify(not md5 size mtime) %ghost %{_sysconfdir}/postfix/aliases.db
  1030. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/canonical
  1031. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/generic
  1032. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/header_checks
  1033. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/relocated
  1034. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/transport
  1035. %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/virtual
  1036.  
  1037. %attr(0755, root, root) %config %{_libexecdir}/postfix/postfix-script
  1038. %attr(0755, root, root) %{_libexecdir}/postfix/postfix-wrapper
  1039. %attr(0755, root, root) %{_libexecdir}/postfix/postmulti-script
  1040. %attr(0755, root, root) %config %{_libexecdir}/postfix/post-install
  1041. %attr(0644, root, root) %{_libexecdir}/postfix/postfix-files
  1042. %attr(0644, root, root) %{_libexecdir}/postfix/main.cf
  1043. %attr(0644, root, root) %{_libexecdir}/postfix/master.cf
  1044.  
  1045. %attr(0644, root, root) %{_sysconfdir}/postfix/README.rpm
  1046. %attr(0644, root, root) %{_sysconfdir}/postfix/postfix.spec.cf
  1047.  
  1048. # convenience links
  1049. %{_sysconfdir}/postfix/html
  1050. %{_sysconfdir}/postfix/readme
  1051. %{_sysconfdir}/postfix/examples
  1052.  
  1053. %attr(0755, root, root) %{_sysconfdir}/postfix/postfix-chroot.sh
  1054.  
  1055. %attr(0755, root, root) %config %{initdir}/postfix
  1056.  
  1057. %dir %verify(not md5 size mtime) %{_var}/spool/postfix
  1058.  
  1059. # For correct directory permissions check postfix-install script
  1060. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/active
  1061. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/bounce
  1062. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/corrupt
  1063. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/defer
  1064. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/deferred
  1065. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/flush
  1066. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/hold
  1067. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/incoming
  1068. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/private
  1069. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/saved
  1070. %dir %attr(0730, postfix, postdrop) %verify(not md5 size mtime) %{_var}/spool/postfix/maildrop
  1071. %dir %attr(0710, postfix, postdrop) %verify(not md5 size mtime) %{_var}/spool/postfix/public
  1072. %dir %attr(0755, root, root) %verify(not md5 size mtime) %{_var}/spool/postfix/pid
  1073. %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/lib/postfix
  1074.  
  1075. %doc %{docdir}/LICENSE
  1076. %doc %{docdir}/IPv6-ChangeLog
  1077. %doc %{docdir}/AAAREADME
  1078. %doc %{docdir}/COMPATIBILITY
  1079. %doc %{docdir}/COPYRIGHT
  1080. %doc %{docdir}/HISTORY
  1081. %doc %{docdir}/PORTING
  1082. %doc %{docdir}/RELEASE_NOTES
  1083. %doc %{docdir}/RELEASE_NOTES-1.0
  1084. %doc %{docdir}/RELEASE_NOTES-1.1
  1085. %doc %{docdir}/RELEASE_NOTES-2.0
  1086. %doc %{docdir}/RELEASE_NOTES-2.1
  1087. %doc %{docdir}/RELEASE_NOTES-2.2
  1088. %doc %{docdir}/RELEASE_NOTES-2.3
  1089. %doc %{docdir}/RELEASE_NOTES-2.4
  1090. %doc %{docdir}/RELEASE_NOTES-2.5
  1091. %doc %{docdir}/RELEASE_NOTES-2.6
  1092. %doc %{docdir}/RELEASE_NOTES-2.7
  1093. #%doc %{docdir}/RELEASE_NOTES-2.8
  1094. %doc %{docdir}/SEE_ALSO
  1095. %doc %{docdir}/TLS_ACKNOWLEDGEMENTS
  1096. %doc %{docdir}/TLS_CHANGES
  1097. %doc %{docdir}/TLS_LICENSE
  1098. %doc %{docdir}/TLS_TODO
  1099. #%doc %{docdir}/WISHLIST
  1100. %doc %{docdir}/US_PATENT_6321267
  1101.  
  1102. %doc %dir %{readme_dir}
  1103. %doc %{readme_dir}/*
  1104. %doc %dir %{html_dir}
  1105. %doc %{html_dir}/*
  1106. %doc %dir %{examples_dir}
  1107. %doc %dir %{examples_dir}/chroot-setup
  1108. %dir %dir %{examples_dir}/qmail-local
  1109. %dir %dir %{examples_dir}/smtpd-policy
  1110. %doc %{examples_dir}/chroot-setup/*
  1111. %doc %{examples_dir}/qmail-local/*
  1112. %doc %{examples_dir}/smtpd-policy/*
  1113.  
  1114. %dir %attr(0755, root, root) %verify(not md5 size mtime) %{_libexecdir}/postfix
  1115. %{_libexecdir}/postfix/anvil
  1116. %{_libexecdir}/postfix/bounce
  1117. %{_libexecdir}/postfix/cleanup
  1118. %{_libexecdir}/postfix/discard
  1119. %{_libexecdir}/postfix/error
  1120. %{_libexecdir}/postfix/flush
  1121. %{_libexecdir}/postfix/lmtp
  1122. %{_libexecdir}/postfix/local
  1123. %{_libexecdir}/postfix/master
  1124. %{_libexecdir}/postfix/nqmgr
  1125. %{_libexecdir}/postfix/oqmgr
  1126. %{_libexecdir}/postfix/pickup
  1127. %{_libexecdir}/postfix/pipe
  1128. %{_libexecdir}/postfix/proxymap
  1129. %{_libexecdir}/postfix/qmgr
  1130. %{_libexecdir}/postfix/qmqpd
  1131. # including as installed by Wietse even with -DNO_TLS ?
  1132. %{_libexecdir}/postfix/scache
  1133. %{_libexecdir}/postfix/showq
  1134. %{_libexecdir}/postfix/smtp
  1135. %{_libexecdir}/postfix/smtpd
  1136. %{_libexecdir}/postfix/spawn
  1137. # including as installed by Wietse even with -DNO_TLS ?
  1138. %{_libexecdir}/postfix/tlsmgr
  1139. %{_libexecdir}/postfix/trivial-rewrite
  1140. %{_libexecdir}/postfix/verify
  1141. %{_libexecdir}/postfix/virtual
  1142. # 2.9.0 feature dnsblog postscreen tlsproxy
  1143. %{_libexecdir}/postfix/dnsblog
  1144. %{_libexecdir}/postfix/postscreen
  1145. %{_libexecdir}/postfix/tlsproxy
  1146.  
  1147. %{_sbindir}/postalias
  1148. %{_sbindir}/postcat
  1149. %{_sbindir}/postconf
  1150. %attr(2755,root,postdrop) %{_sbindir}/postdrop
  1151. %attr(2755,root,postdrop) %{_sbindir}/postqueue
  1152. %{_sbindir}/postfix
  1153. %{_sbindir}/postkick
  1154. %{_sbindir}/postlock
  1155. %{_sbindir}/postlog
  1156. %{_sbindir}/postmap
  1157. %{_sbindir}/postmulti
  1158. %{_sbindir}/postsuper
  1159.  
  1160. %{_sbindir}/smtp-sink
  1161. %{_sbindir}/smtp-source
  1162. %{_sbindir}/qmqp-source
  1163.  
  1164. %{sendmail_path}
  1165. %{mailq_path}
  1166. %{newaliases_path}
  1167. %{usrlib_sendmail}
  1168. %attr(0755, root, root) %{rmail_path}
  1169. %attr(0755, root, root) %{_bindir}/postfinger
  1170. %attr(0755, root, root) %{_sbindir}/qshape
  1171.  
  1172. %{_mandir}/*/*
  1173.  
  1174. ##############################################################################
  1175. # List of changes made to this package.
  1176. #
  1177. # Although old entries from the changelog have been removed most of them
  1178. # are available from my CVS repository of changes made to this file.
  1179. #
  1180.  
  1181. %changelog
  1182.  
  1183. * Tue Feb 23 2010 Simon J Mudd <[email protected]> 2.7.0-1
  1184. - update to 2.7.0 based on work by Hari Hendaryanto <[email protected]>
  1185. see http://www.kutukupret.com/2010/02/08/compiling-postfix-2-7-0-as-rpm-package/
  1186.  
  1187. * Wed Sep 02 2009 Simon J Mudd <[email protected]> 2.6.5-1
  1188. - upgrade to 2.6.5
  1189.  
  1190. * Sun May 24 2009 Simon J Mudd <[email protected]> 2.6.1-1
  1191. - upgrade to 2.6.1
  1192.  
  1193. * Sun May 24 2009 Simon J Mudd <[email protected]> 2.6.0-1
  1194. - upgrade to 2.6.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement