# W A R N I N G -- DO NOT EDIT THIS FILE -- W A R N I N G # # postfix.spec # # This file was generated automatically from /usr/src/redhat/SOURCES/postfix.spec.in. # If you want to build postfix with other options see make-postfix.spec in # the same directory for instructions. # -- # $Id: postfix.spec.in,v 2.305.2.13.2.7 2008/03/09 09:46:05 sjmudd Exp $ # # File used to generate the distribution-specific postfix.spec file. # If you need to make changes to postfix.spec, make them to postfix.spec.in # and regenerate the spec file. # # See make-postfix.spec in %{_sourcedir} for more information. # # This spec file was built on distribution: rhel-5.0 # # Information imported from postfix.spec.in: DO NOT CHANGE IT BY HAND # # mysql_paths - paths where locally installed MySQL resides (or 0) # - if using this option mysql_paths should be as # follows: : # e.g.: /usr/mysql/include:/usr/mysql/lib # - The order is important and only 2 directories may # be given. # requires_db - used to add dbX dependencies in the package # smtpd_multiline_greeting - my patch to allow multiline banner # mps - man page suffix, .gz except Mandrake >= 8 which uses .bz2 # with_cdb - include CDB support by Michael Tokarev # # with_dovecot - include DOVECOT SASL authentication # with_ldap - include LDAP support # with_mysql - include support for www.mysql.com's MySQL rpms # with_mysql_redhat - include support for RedHat's MySQL rpms # with_pcre - include pcre support # with_pgsql - include Postgres database support # with_sasl - include Cyrus SASL/AUTH support (0 to disable sasl, # 1 for sasl v1, or 2 for sasl v2, sasl_library is # the sasl library to link against, distribution dependent) # with_tls - include TLS support # with_tlsfix - include TLS fix # - needed for rh6.2, rh9 and rhel3 # with_vda - add virtual delivery agent patch # with_sqlite - include SQLITE support # # Please send bugfixes and comments to the packager. # # distribution which the spec file was built from %define distribution rhel-5.0 # distribution which we are building Postfix on # - call my script once to speed up build process %define distro_info %(sh $(rpm --eval '%{_sourcedir}')/postfix-get-distribution --distro-info) %define build_dist_full %(echo "%distro_info" | cut -d" " -f5) %define build_name %(echo "%distro_info" | cut -d" " -f1) %define build_major %(echo "%distro_info" | cut -d" " -f3) %define build_minor %(echo "%distro_info" | cut -d" " -f4) %define build_dist %{build_name}-%{build_major}.%{build_minor} %define mps %(test "%{build_name}" = mandrake -a "%{build_major}" -ge 8 && echo .bz2 || echo .gz) %define mysql_paths 0 %define mysql_local %(test "%{mysql_paths}" != 0 && echo 1 || echo 0) %define mysql_include %(echo "%{mysql_paths}" | cut -d: -f1) %define mysql_lib %(echo "%{mysql_paths}" | cut -d: -f2) # determine PCRE library based on distribution name %define pcre_requires %(test %{build_dist} = mandrake && echo libpcre0 || echo pcre) # determine SASL library based on distribution name %define sasl_library %(test %{build_dist} = mandrake && echo libsasl-devel || echo cyrus-sasl-devel) %define requires_db 4 %define requires_zlib 1 %define smtpd_multiline_greeting 1 # alternatives priority can now be changed in one place. # - this used to be 30 but RH seems to have defined other higher values # and some users need another value. # Don't change this unless you really think you need to. %define with_alt_prio 30 %define with_cdb 0 %define with_ldap 1 %define with_mysql 0 %define with_mysql_redhat 1 %define with_pcre 1 %define with_pgsql 1 %define with_sasl 2 %define with_dovecot 1 %define with_tls 1 %define with_tlsfix 2 %define with_vda 1 %define with_sqlite 0 # support the conditional builds via rpm's --with debug %define debug %{?_with_debug:1}%{?!_with_debug:0} # patch and version information %define V_vda 2.8.0 %define V_postfinger 1.30 # If set to 1 if official version, 0 if snapshot %define official 1 %define V_postfix 2.8.5 %define rel 1.cdb.pcre.pgsql.mysql.sasl2.vda.sqlite.rhel5 %if %{official} %define V_tarball %{V_postfix} %define ftp_dir official %else %define V_release_date RC2 %define V_tarball %{V_postfix}-%{V_release_date} %define ftp_dir experimental %endif # rpm does not accept '-' in version strings so replace them with a '.' # - (only affects snapshots) %define V_package %(echo %{V_tarball} | sed 's/-/./g') # rpm-workaround: # # We can NOT use %{_docdir}/%{name}-%{version} for installing the docs # from the 'install' section as RPM kindly removes this directory after # we have installed files to it. (standard part of 'doc' processing!) # #define docdir %{_docdir}/%{name}-%{version} %define docdir %{_docdir}/%{name}-%{V_package}-documentation %define readme_dir %{docdir}/readme %define html_dir %{docdir}/html %define examples_dir %{docdir}/examples %define newaliases_path %{_bindir}/newaliases.postfix %define mailq_path %{_bindir}/mailq.postfix %define rmail_path %{_bindir}/rmail.postfix %define sendmail_path %{_sbindir}/sendmail.postfix # Don't use %{_libdir} as it gives the wrong directory on x86_64 servers %define usrlib_sendmail /usr/lib/sendmail.postfix %define initdir /etc/rc.d/init.d %define whinge /usr/bin/logger -p mail.info -t postfix/rpm %define die_cmd die(){ %whinge "$*"; exit 1; } Name: postfix Group: System Environment/Daemons URL: http://www.postfix.org License: IBM Public License PreReq: chkconfig, initscripts, shadow-utils PreReq: /etc/init.d, /sbin/service, chkconfig >= 1.3 Epoch: 2 Provides: MTA smtpd smtpdaemon Provides: %{_sbindir}/sendmail %{_bindir}/mailq %{_bindir}/newaliases %{_bindir}/rmail Provides: %{_mandir}/man1/newaliases.1.%{mps} %{_mandir}/man5/newaliases.5.%{mps} Version: %{V_package} Release: %{rel} Packager: Simon J Mudd Summary: Postfix Mail Transport Agent Vendor: Built on %{build_dist_full} (%{build_dist}) Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/%{ftp_dir}/postfix-%{V_tarball}.tar.gz Source1: make-postfix.rpm Source2: postfix-get-distribution Source3: postfix-etc-init.d-postfix Source4: postfix-chroot.sh Source5: postfix-aliases Source7: postfix.spec.in Source8: make-postfix.spec Source10: README-Postfix-SASL-RedHat.txt Source16: http://postfix.wl0.org/ftp/postfinger/postfinger-%{V_postfinger} # Sources >= 100 are config files Source100: postfix-sasl.conf Source101: postfix-pam.conf Source102: postfix-saslauthd.conf # Obligatory Patches Patch3: postfix-files.patch Patch5: postfix-makedefs.patch # Optional patches # FIXME: There is also a 64-bit patch (not included) for 2.5.4 Patch4: http://vda.sourceforge.net/VDA/postfix-vda-%{V_vda}.patch.gz # Multiline Greeting ptch Patch99: ftp://ftp.wl0.org/SOURCES/postfix-2.8.1-multiline-greeting.patch BuildRoot: %{_tmppath}/%{name}-%{V_package}-buildroot # Determine packaging requirements BuildRequires: /usr/bin/cc, gawk, sed, ed, patch, rpm >= 4 Requires: gawk, sed, ed %if %{requires_db} Requires: db%{requires_db} BuildRequires: db%{requires_db}-devel %endif %if %{with_cdb} Requires: tinycdb BuildRequires: tinycdb %endif %if %{with_ldap} Requires: openldap >= 1.2.9 BuildRequires: openldap-devel >= 1.2.9 %endif %if %{with_pcre} Requires: %{pcre_requires} BuildRequires: %{pcre_requires}, %{pcre_requires}-devel %endif # Needed by some Mysql and some TLS packages %if %{requires_zlib} Requires: zlib BuildRequires: zlib-devel %endif %if %{with_mysql_redhat} Requires: mysql BuildRequires: mysql, mysql-devel %endif %if %{mysql_local} BuildRequires: %{mysql_include}/mysql.h Requires: %{mysql_lib}/libmysqlclient.so %endif %if %{with_mysql} Requires: MySQL-shared BuildRequires: MySQL-shared, MySQL-devel %endif %if %{with_pgsql} Requires: postgresql-libs BuildRequires: postgresql-devel %endif %if %{with_sasl} Requires: cyrus-sasl BuildRequires: cyrus-sasl, %{sasl_library} %endif # Postfix compiled with Dovecot support only works with dovecot >= 1 # - however requiring the dovecot rpm to be installed when it may # not be used means that there will be NO explicit dependency # added to the rpm. %if %{with_dovecot} #Requires: dovecot >= 1 NOT REQUIRED / DO NOT ADD %endif %if %{with_tls} Requires: openssl BuildRequires: openssl-devel %endif %if %{with_sqlite} Requires: sqlite BuildRequires: sqlite-devel %endif %description Postfix is a Mail Transport Agent (MTA), intended to be an alternative to the widely-used sendmail. This package includes optional support for LDAP, pcre, mysql, SMTP AUTH (SASL) and TLS. See http://www.redhat.com/support/docs/faqs/RH-postfix-FAQ/book1.html, a slightly outdated FAQ, which covers the steps involved in installing and configuring postfix. The binary and source rpms I produce are currently available at http://postfix.WL0.org, ftp://ftp.WL0.org and the mirrors which can be found at the following URL: http://postfix.WL0.org/en/mirrors/ This package/specfile was built from postfix.spec.in. To see the build options used to build this package see the file %{_sysconfdir}/postfix/postfix.spec.cf To use postfix with alternative options download the source package and rebuild the binary package following the instructions in the source package or on my web page. %prep umask 022 %{die_cmd} # check custom MYSQL path values are sensible to avoid problems # with people mixing include and lib directories if [ "%{mysql_paths}" != 0 ]; then exit_error() { cat <<-EOF ************************************************************************* CUSTOM MYSQL configuration error mysql_paths=%mysql_paths (0=Not used) mysql_local=%mysql_local (0=Not used,1=used) mysql_include=%mysql_include (include directory) mysql_lib=%mysql_lib (lib directory) ERROR: $1 If you don't want to use a custom mysql installation set mysql_paths to 0. ************************************************************************* EOF exit 1 } [ $(echo "%{mysql_paths}" | awk -F: '{ print NF }') = 2 ] || \ exit_error "mysql_paths should be of the form /pathto/mysql/include:/pathto/mysql/lib, with only 2 directories" echo "%{mysql_include}" | grep -q "/lib" && \ 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)" echo "%{mysql_lib}" | grep -q "/include" && \ 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)" fi # Warn if the distribution this spec file was made for isn't the same as # the current distribution, using a script in the SOURCES directory. # This will be removed and built into the spec file later. distribution=$(sh $(rpm --eval '%{_sourcedir}')/postfix-get-distribution) if [ "${distribution}" != "%{distribution}" ]; then cat < rmail.postfix ed conf/master.cf < if pkg-config openssl; then CCARGS="${CCARGS} -DUSE_TLS $(pkg-config --cflags openssl)" AUXLIBS="${AUXLIBS} $(pkg-config --libs openssl)" else # # CHECK THIS - these lines may no longer be needed (required for external TLS patch) # [ "%{with_tlsfix}" = 1 ] && LIBS=-ldl [ "%{with_tlsfix}" = 2 ] && CCARGS="${CCARGS} -I/usr/kerberos/include" CCARGS="${CCARGS} -DUSE_TLS -I/usr/include/openssl" AUXLIBS="${AUXLIBS} -lssl -lcrypto" fi %else # explicitly disable TLS otherwise will be built on machine if # openssl is available CCARGS="${CCARGS} -DNO_TLS" %endif # Required by some TLS implementations (RHEL 3 and RH9) and also some MySQL # packages %if %{requires_zlib} AUXLIBS="${AUXLIBS} -lz" %endif export CCARGS AUXLIBS make tidy make -f Makefile.init makefiles unset CCARGS AUXLIBS # -Wno-comment needed due to large number of warnings on RHEL5 # suggestion by Eric Hoeve RPM_OPT_FLAGS="$(rpm --eval '%{optflags}' | %{__perl} -pe 's/(-g|\{|\})//g')" 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" %pre umask 022 # create postfix user and group, and maildrop group if necessary. # Use perl rather than looking in /etc/passwd or /etc/group as this works # in a wider NIS or LDAP environment /usr/bin/getent group postdrop >/dev/null || { %whinge "Adding postdrop group to system" %{_sbindir}/groupadd -r postdrop } /usr/bin/getent group postfix >/dev/null || { %whinge "Adding postfix group to system" %{_sbindir}/groupadd -r postfix } /usr/bin/getent passwd postfix >/dev/null || { %whinge "Adding postfix user to system" %{_sbindir}/useradd -d %{_var}/spool/postfix -s /bin/true -g postfix -G mail -M -r postfix } # Add postfix user to the mail group. This is needed for people using cyrus, # linked by unix sockets (amongst other things). test -z "$(id postfix | awk '{print $3}' | sed -e 's/groups=//' | grep mail)" && { %whinge "Adding postfix user to mail group" %{_sbindir}/usermod -G mail postfix } # check for a new install and see if a non package installed Postfix might # exist. Attempt to avoid overwriting the source config and provide a warning. if [ "$1" = 0 ]; then timenow=$(date +%Y%m%d-%H%M%) pretext="This is a new Postfix RPM installation" [ -f %{_sysconfdir}/postfix ] && { [ -n "$pretext" ] && %whinge "$pretext" && pretext= %whinge "Detected a possible previous non-RPM install in %{_sysconfdir}/postfix." %whinge "- going to move it out of the way to %{_sysconfdir}/postfix.$timenow." mv %{_sysconfdir}/postfix %{_sysconfdir}/postfix.$timenow } [ -d %{initdir}/postfix ] && { [ -n "$pretext" ] && %whinge "$pretext" && pretext= %whinge "Detected a possible previous non-RPM startup script %{initdir}/postfix." %whinge "- going to move it out of the way to %{initdir}/postfix.$timenow." mv %{initdir}/postfix %{initdir}/postfix.$timenow } fi exit 0 %install umask 022 [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ] && { rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT} } %{?!debug:strip -R .comment --strip-unneeded bin/* libexec/*} # rename man pages which may conflict with sendmail's mv man/man1/mailq.1 man/man1/mailq.postfix.1 mv man/man1/newaliases.1 man/man1/newaliases.postfix.1 mv man/man1/sendmail.1 man/man1/sendmail.postfix.1 mv man/man5/aliases.5 man/man5/aliases.postfix.5 # install postfix into build root sh postfix-install -non-interactive \ install_root=${RPM_BUILD_ROOT} \ config_directory=%{_sysconfdir}/postfix \ daemon_directory=%{_libexecdir}/postfix \ command_directory=%{_sbindir} \ queue_directory=%{_var}/spool/postfix \ sendmail_path=%{sendmail_path} \ newaliases_path=%{newaliases_path} \ mailq_path=%{mailq_path} \ mail_owner=postfix \ setgid_group=postdrop \ html_directory=%{html_dir} \ manpage_directory=%{_mandir} \ readme_directory=%{readme_dir} || exit 1 # To be compatible with later versions of RH sendmail/postfix packages # make /usr/lib/sendmail.postfix point to /usr/sbin/sendmail.postfix. # The alternatives then point /usr/lib/sendmail to /usr/lib/sendmail.postfix. # This *is* all a bit silly ... install -d -m755 $RPM_BUILD_ROOT/usr/lib ln -sf ../sbin/sendmail.postfix $RPM_BUILD_ROOT%{usrlib_sendmail} # RPM compresses man pages automatically. Edit postfix-files to avoid # confusing post-install. ed ${RPM_BUILD_ROOT}%{_libexecdir}/postfix/postfix-files <${RPM_BUILD_ROOT}%{docdir}/SEE_ALSO %{_docdir}/%{name}-%{version} may contain other documentation files. EOF # added for convenience ln -sf %{html_dir} ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/html ln -sf %{readme_dir} ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/readme ln -sf %{examples_dir} ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/examples # Install the smtpd.conf file for SASL support. %if %{with_sasl} mkdir -p ${RPM_BUILD_ROOT}%{sasl_lib_dir} install -m 644 %SOURCE100 ${RPM_BUILD_ROOT}%{sasl_lib_dir}/smtpd.conf mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d install -m 644 %SOURCE101 ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/smtp.postfix mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig install -m 644 %SOURCE102 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/saslauthd.postfix %endif # Include README.rpm explaining where the documentation can be found and # also pointing out how to get updated copies of my package cat < ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/README.rpm README.rpm ========== Documentation ------------- Postfix documentation should be available in the directory %{docdir}/. I have also added a symbolic link to the readme_files and html directories from %{_sysconfdir}/postfix. The main Postfix web site is http://www.postfix.org. Packages -------- Newer versions of source and standard binary packages may be available from http://ftp.WL0.org or the mirrors listed at http://postfix.WL0.org. Look in the appropriate directory according to your distribution. Mailing List ------------ I host a mailing list to announce new packages as they are released. If you are interested in subscribing take a look at http://postfix.WL0.org/en/lists/. Previous announcements are archived. Chrooting --------- The chroot behaviour of my packages has changed over time. Current packages will NOT turn on the chroot environment in Postfix. Older versions did the opposite. If you upgrade from an older version of my package the chroot behaviour will NOT be changed. (Check %{_sysconfdir}/postfix/master.cf for details.) I have provided a simple script postfix-chroot.sh which attempts to cover most situations and should enable you to disable or enable the chroot on your system with little effort. Package Build Options --------------------- This package can be built on several Linux distributions and with several optional features. %{_sysconfdir}/postfix/postfix.spec.cf contains the information used to build this version of the rpm. It can also be used to build a new rpm with the same options. Enjoy! Simon J Mudd, EOF # generate postfix.spec.cf # - used to build a newer version of the rpm with the same parameters # as the current package. # - provides build instructions cat - %{_sourcedir}/postfix.spec.cf < ${RPM_BUILD_ROOT}%{_sysconfdir}/postfix/postfix.spec.cf # # This file contains the following information: # # - configuration options used to build the installed postfix rpm # - generated when the binary rpm was built # # - Postfix RPM build instructions # - for upgrading the installed rpm with the same options # - for building the rpm with other options # # 1. CONFIGURATION OPTIONS OF INSTALLED BINARY RPM # # Package built on: %{build_dist_full} (%{build_dist}) POSTFIX_ALT_PRIO=%{with_alt_prio} POSTFIX_CDB=%{with_cdb} POSTFIX_DB=%{requires_db} POSTFIX_DOVECOT=%{with_dovecot} POSTFIX_LDAP=%{with_ldap} POSTFIX_MYSQL=%{with_mysql} POSTFIX_MYSQL_PATHS=%{mysql_paths} POSTFIX_MYSQL_REDHAT=%{with_mysql_redhat} POSTFIX_PCRE=%{with_pcre} POSTFIX_PGSQL=%{with_pgsql} POSTFIX_SASL=%{with_sasl} POSTFIX_SMTPD_MULTILINE_GREETING=%{smtpd_multiline_greeting} POSTFIX_TLS=%{with_tls} POSTFIX_VDA=%{with_vda} POSTFIX_SQLITE=%{with_sqlite} # export values to child processes export POSTFIX_MYSQL POSTFIX_MYSQL_PATHS POSTFIX_MYSQL_REDHAT \\ POSTFIX_LDAP POSTFIX_PCRE POSTFIX_PGSQL \\ POSTFIX_SASL POSTFIX_TLS POSTFIX_VDA \\ POSTFIX_SMTPD_MULTILINE_GREETING POSTFIX_DB \\ POSTFIX_INCLUDE_DB POSTFIX_SQLITE \\ POSTFIX_CDB POSTFIX_ALT_PRIO POSTFIX_DOVECOT # other options used in the build (but not explicitly changeable by the user) are: # - debug=%{?_with_debug:1}%{?!_with_debug:0} # - pcre_requires=%{pcre_requires}, # - requires_zlib=%{requires_zlib}, # - sasl_library=%{sasl_library} # - tlsfix=%{with_tlsfix} # # %{_sysconfdir}/postfix/makedefs.out is also produced by the build and may be of # interest if you are building Postfix by hand. EOF %post umask 022 chkconfig --add postfix # Upgrade configuration as necessary sh %{_libexecdir}/postfix/post-install upgrade-package \ config_directory=%{_sysconfdir}/postfix \ daemon_directory=%{_libexecdir}/postfix \ command_directory=%{_sbindir} \ mail_owner=postfix \ setgid_group=postdrop \ html_directory=%{html_dir} \ manpage_directory=%{_mandir} \ readme_directory=%{readme_dir} \ sendmail_path=%{sendmail_path} \ newaliases_path=%{newaliases_path} \ mailq_path=%{mailq_path} \ || : %{_sbindir}/postalias %{_sysconfdir}/postfix/aliases %{_sbindir}/postfix check || : # Add submission to services if not found, required for rh <= 7.0 if ! grep -q ^submission %{_sysconfdir}/services then cat <>%{_sysconfdir}/services submission 587/tcp msa # mail message submission submission 587/udp msa # mail message submission EOF fi # Add smtps to services if not found if ! grep -q ^smtps %{_sysconfdir}/services then cat <>%{_sysconfdir}/services smtps 465/tcp # SMTP over SSL (TLS) EOF fi # If using sasl create %{_sysconfdir}/sysconfig/saslauthd if necessary # - this file is provided in some (but not all) cyrus-sasl packages # - RHEL3 provides this file in cyrus-sasl >= 2.1.18-2 %if %{with_sasl} [ -f %{_sysconfdir}/sysconfig/saslauthd ] || { grep -v "^# NOTE: " %{_sysconfdir}/sysconfig/saslauthd.postfix > %{_sysconfdir}/sysconfig/saslauthd chmod 644 %{_sysconfdir}/sysconfig/saslauthd %{whinge} "creating new %{_sysconfdir}/sysconfig/saslauthd from local Postfix copy" } %endif # Add comments to the /etc/dovecot.conf configuration file if it exists # showing how to configure with Postfix if needed. If postfix is mentioned # in the dovecot configuration file then DO NOTHING. DOVECOT_CONF=/etc/dovecot.conf if [ -f $DOVECOT_CONF ] && ! grep -q postfix $DOVECOT_CONF; then # Check if auth default is configured and add a COMMENTED SECTION # taken from the SASL_README file. if grep -q 'auth default' $DOVECOT_CONF; then ed $DOVECOT_CONF <<-EOF_END || exit 1 /auth default { a # Postfix - suggested configuration taken from SASL_README (2.3.2). # mechanisms = plain login # socket listen { # client { # path = /var/spool/postfix/private/auth # mode = 0660 # user = postfix # group = postfix # } # } . w q EOF_END else # Add the whole section at the end. cat <<-EOF_END >> $DOVECOT_CONF # Postfix - suggested configuration taken from SASL_README (2.3.2). #auth default { # mechanisms = plain login # passdb pam { # } # userdb passwd { # } # socket listen { # client { # path = /var/spool/postfix/private/auth # mode = 0660 # user = postfix # group = postfix # } # } #} EOF_END fi fi # Apply the alternatives scripts ONLY if installing (not upgrading) to # ensure a link exists from %{_sbindir}/sendmail to # %{sendmail_path} (and other files). # # If performing an upgrade this MUST be done in the trigger scripts. # (old postfix packages, pre-alternatives have a /usr/sbin/sendmail and this # gets removed _AFTER_ the %post stage when the old package is removed) [ "$1" = 1 ] || exit 0 # See changelog for explanation of mta-sendmailman entry. %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{sendmail_path} %{with_alt_prio} \ --slave %{_bindir}/mailq mta-mailq %{mailq_path} \ --slave %{_bindir}/newaliases mta-newaliases %{newaliases_path} \ --slave %{_bindir}/rmail mta-rmail %{rmail_path} \ --slave /usr/lib/sendmail mta-sendmail %{usrlib_sendmail} \ --slave %{_mandir}/man8/sendmail.8%{mps} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{mps} \ --slave %{_mandir}/man1/mailq.1%{mps} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{mps} \ --slave %{_mandir}/man1/newaliases.1%{mps} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{mps} \ --slave %{_mandir}/man5/aliases.5%{mps} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{mps} \ --initscript postfix exit 0 %triggerpostun -- sendmail # If removing sendmail and not using alternatives: replace with postfix equivalents %whinge "%{V_postfix}-%{rel} triggerpostun -- sendmail: final number of sendmail packages=$2" [ $2 = 0 ] || exit 0 # See changelog for explanation of mta-sendmailman entry. %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{sendmail_path} %{with_alt_prio} \ --slave %{_bindir}/mailq mta-mailq %{mailq_path} \ --slave %{_bindir}/newaliases mta-newaliases %{newaliases_path} \ --slave %{_bindir}/rmail mta-rmail %{rmail_path} \ --slave /usr/lib/sendmail mta-sendmail %{usrlib_sendmail} \ --slave %{_mandir}/man8/sendmail.8%{mps} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{mps} \ --slave %{_mandir}/man1/mailq.1%{mps} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{mps} \ --slave %{_mandir}/man1/newaliases.1%{mps} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{mps} \ --slave %{_mandir}/man5/aliases.5%{mps} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{mps} \ --initscript postfix exit 0 # ensure the trigger exit status is 0 %triggerpostun -- postfix # If upgrading postfix some versions are pre-alternatives and use # /usr/sbin/sendmail. After uninstalling the old package this file will be # missing and we need to link to the new postfix sendmail binary. %whinge "%{V_postfix}-%{rel} triggerpostun -- postfix: final number of Postfix packages=$2" [ $2 -gt 0 ] || exit 0 # See changelog for explanation of mta-sendmailman entry. %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{sendmail_path} %{with_alt_prio} \ --slave %{_bindir}/mailq mta-mailq %{mailq_path} \ --slave %{_bindir}/newaliases mta-newaliases %{newaliases_path} \ --slave %{_bindir}/rmail mta-rmail %{rmail_path} \ --slave /usr/lib/sendmail mta-sendmail %{usrlib_sendmail} \ --slave %{_mandir}/man8/sendmail.8%{mps} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{mps} \ --slave %{_mandir}/man1/mailq.1%{mps} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{mps} \ --slave %{_mandir}/man1/newaliases.1%{mps} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{mps} \ --slave %{_mandir}/man5/aliases.5%{mps} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{mps} \ --initscript postfix exit 0 # ensure the trigger exit status is 0 %preun umask 022 # remove the directory and depth levels of subdirectories queue_hash_depth_remove () { local dir=$1 local depth=$2 local new_depth local a [ -d "$dir" ] && { if [ "$depth" -gt 0 ]; then new_depth=$(($depth - 1)) for a in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do test -d $dir/$a && queue_hash_depth_remove $dir/$a $new_depth done fi rm -f $dir/* rmdir $dir || %whinge "WARNING: preun - unable to remove directory %{_var}/spool/postfix/$dir" } } # remove the rest of the queue directory structure queue_directory_remove () { # remove the hashed directories depth=$(postconf -h hash_queue_depth) for dir in $(postconf -h hash_queue_names | sed -e 's/,/\n/g; s/ //g'); do queue_hash_depth_remove $dir $depth done # now remove the other directories for dir in corrupt hold maildrop pid private public saved; do queue_hash_depth_remove $dir 0 done } # No more postfix packages left so prepare to finish package removal. # _In theory_ there is no chroot environment now, so there is no need to # clean it out. # However it may be prudent later to add back a call to # /etc/postfix/postfix-chroot.sh disable # just to make sure, but won't do this yet. (If you think I should let # me know). if [ "$1" = 0 ]; then service postfix stop >/dev/null 2>&1 chkconfig --del postfix %{_sbindir}/alternatives --remove mta %{sendmail_path} # userdel also deletes the user's group %{_sbindir}/userdel postfix || %whinge "WARNING: failed to remove user postfix" %{_sbindir}/groupdel postdrop || %whinge "WARNING: failed to remove group postdrop" cd %{_var}/spool/postfix && queue_directory_remove fi exit 0 %postun umask 022 if [ "$1" -ge 1 ]; then service postfix condrestart || : # don't use readlink as this is not available on rh73 mta=`[ -L /etc/alternatives/mta ] && ls -la /etc/alternatives/mta | awk '{ print $11 }'` if [ "$mta" = "%{sendmail_path}" ]; then %{_sbindir}/alternatives --set mta %{sendmail_path} fi fi exit 0 %clean umask 022 [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ] && { rm -rf ${RPM_BUILD_ROOT} } || : %files %defattr(-, root, root) %if %{with_sasl} %config(noreplace) %{sasl_lib_dir}/smtpd.conf %config(noreplace) %{_sysconfdir}/pam.d/smtp.postfix %config(noreplace) %{_sysconfdir}/sysconfig/saslauthd.postfix %endif %verify(not md5 size mtime) %config %dir %{_sysconfdir}/postfix %attr(0644, root, root) %{_sysconfdir}/postfix/LICENSE %attr(0644, root, root) %{_sysconfdir}/postfix/TLS_LICENSE %attr(0444, root, root) %config %{_sysconfdir}/postfix/makedefs.out %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/main.cf %attr(0644, root, root) %{_sysconfdir}/postfix/main.cf.default %attr(0644, root, root) %{_sysconfdir}/postfix/bounce.cf.default %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/master.cf %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/access %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/aliases %attr(0644, root, root) %verify(not md5 size mtime) %ghost %{_sysconfdir}/postfix/aliases.db %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/canonical %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/generic %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/header_checks %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/relocated %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/transport %attr(0644, root, root) %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/postfix/virtual %attr(0755, root, root) %config %{_libexecdir}/postfix/postfix-script %attr(0755, root, root) %{_libexecdir}/postfix/postfix-wrapper %attr(0755, root, root) %{_libexecdir}/postfix/postmulti-script %attr(0755, root, root) %config %{_libexecdir}/postfix/post-install %attr(0644, root, root) %{_libexecdir}/postfix/postfix-files %attr(0644, root, root) %{_libexecdir}/postfix/main.cf %attr(0644, root, root) %{_libexecdir}/postfix/master.cf %attr(0644, root, root) %{_sysconfdir}/postfix/README.rpm %attr(0644, root, root) %{_sysconfdir}/postfix/postfix.spec.cf # convenience links %{_sysconfdir}/postfix/html %{_sysconfdir}/postfix/readme %{_sysconfdir}/postfix/examples %attr(0755, root, root) %{_sysconfdir}/postfix/postfix-chroot.sh %attr(0755, root, root) %config %{initdir}/postfix %dir %verify(not md5 size mtime) %{_var}/spool/postfix # For correct directory permissions check postfix-install script %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/active %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/bounce %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/corrupt %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/defer %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/deferred %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/flush %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/hold %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/incoming %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/private %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/spool/postfix/saved %dir %attr(0730, postfix, postdrop) %verify(not md5 size mtime) %{_var}/spool/postfix/maildrop %dir %attr(0710, postfix, postdrop) %verify(not md5 size mtime) %{_var}/spool/postfix/public %dir %attr(0755, root, root) %verify(not md5 size mtime) %{_var}/spool/postfix/pid %dir %attr(0700, postfix, root) %verify(not md5 size mtime) %{_var}/lib/postfix %doc %{docdir}/LICENSE %doc %{docdir}/IPv6-ChangeLog %doc %{docdir}/AAAREADME %doc %{docdir}/COMPATIBILITY %doc %{docdir}/COPYRIGHT %doc %{docdir}/HISTORY %doc %{docdir}/PORTING %doc %{docdir}/RELEASE_NOTES %doc %{docdir}/RELEASE_NOTES-1.0 %doc %{docdir}/RELEASE_NOTES-1.1 %doc %{docdir}/RELEASE_NOTES-2.0 %doc %{docdir}/RELEASE_NOTES-2.1 %doc %{docdir}/RELEASE_NOTES-2.2 %doc %{docdir}/RELEASE_NOTES-2.3 %doc %{docdir}/RELEASE_NOTES-2.4 %doc %{docdir}/RELEASE_NOTES-2.5 %doc %{docdir}/RELEASE_NOTES-2.6 %doc %{docdir}/RELEASE_NOTES-2.7 #%doc %{docdir}/RELEASE_NOTES-2.8 %doc %{docdir}/SEE_ALSO %doc %{docdir}/TLS_ACKNOWLEDGEMENTS %doc %{docdir}/TLS_CHANGES %doc %{docdir}/TLS_LICENSE %doc %{docdir}/TLS_TODO #%doc %{docdir}/WISHLIST %doc %{docdir}/US_PATENT_6321267 %doc %dir %{readme_dir} %doc %{readme_dir}/* %doc %dir %{html_dir} %doc %{html_dir}/* %doc %dir %{examples_dir} %doc %dir %{examples_dir}/chroot-setup %dir %dir %{examples_dir}/qmail-local %dir %dir %{examples_dir}/smtpd-policy %doc %{examples_dir}/chroot-setup/* %doc %{examples_dir}/qmail-local/* %doc %{examples_dir}/smtpd-policy/* %dir %attr(0755, root, root) %verify(not md5 size mtime) %{_libexecdir}/postfix %{_libexecdir}/postfix/anvil %{_libexecdir}/postfix/bounce %{_libexecdir}/postfix/cleanup %{_libexecdir}/postfix/discard %{_libexecdir}/postfix/error %{_libexecdir}/postfix/flush %{_libexecdir}/postfix/lmtp %{_libexecdir}/postfix/local %{_libexecdir}/postfix/master %{_libexecdir}/postfix/nqmgr %{_libexecdir}/postfix/oqmgr %{_libexecdir}/postfix/pickup %{_libexecdir}/postfix/pipe %{_libexecdir}/postfix/proxymap %{_libexecdir}/postfix/qmgr %{_libexecdir}/postfix/qmqpd # including as installed by Wietse even with -DNO_TLS ? %{_libexecdir}/postfix/scache %{_libexecdir}/postfix/showq %{_libexecdir}/postfix/smtp %{_libexecdir}/postfix/smtpd %{_libexecdir}/postfix/spawn # including as installed by Wietse even with -DNO_TLS ? %{_libexecdir}/postfix/tlsmgr %{_libexecdir}/postfix/trivial-rewrite %{_libexecdir}/postfix/verify %{_libexecdir}/postfix/virtual # 2.9.0 feature dnsblog postscreen tlsproxy %{_libexecdir}/postfix/dnsblog %{_libexecdir}/postfix/postscreen %{_libexecdir}/postfix/tlsproxy %{_sbindir}/postalias %{_sbindir}/postcat %{_sbindir}/postconf %attr(2755,root,postdrop) %{_sbindir}/postdrop %attr(2755,root,postdrop) %{_sbindir}/postqueue %{_sbindir}/postfix %{_sbindir}/postkick %{_sbindir}/postlock %{_sbindir}/postlog %{_sbindir}/postmap %{_sbindir}/postmulti %{_sbindir}/postsuper %{_sbindir}/smtp-sink %{_sbindir}/smtp-source %{_sbindir}/qmqp-source %{sendmail_path} %{mailq_path} %{newaliases_path} %{usrlib_sendmail} %attr(0755, root, root) %{rmail_path} %attr(0755, root, root) %{_bindir}/postfinger %attr(0755, root, root) %{_sbindir}/qshape %{_mandir}/*/* ############################################################################## # List of changes made to this package. # # Although old entries from the changelog have been removed most of them # are available from my CVS repository of changes made to this file. # %changelog * Tue Feb 23 2010 Simon J Mudd 2.7.0-1 - update to 2.7.0 based on work by Hari Hendaryanto see http://www.kutukupret.com/2010/02/08/compiling-postfix-2-7-0-as-rpm-package/ * Wed Sep 02 2009 Simon J Mudd 2.6.5-1 - upgrade to 2.6.5 * Sun May 24 2009 Simon J Mudd 2.6.1-1 - upgrade to 2.6.1 * Sun May 24 2009 Simon J Mudd 2.6.0-1 - upgrade to 2.6.0