2007-01-16 00:33:08 +01:00
|
|
|
#
|
2011-02-01 15:11:40 +01:00
|
|
|
# spec file for package postfix
|
2007-01-16 00:33:08 +01:00
|
|
|
#
|
2012-01-11 15:22:18 +01:00
|
|
|
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-16 00:33:08 +01:00
|
|
|
#
|
2008-08-07 01:34:35 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2007-01-16 00:33:08 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2012-01-25 16:13:45 +01:00
|
|
|
|
2007-01-16 00:33:08 +01:00
|
|
|
Name: postfix
|
2009-10-12 16:51:23 +02:00
|
|
|
Summary: A fast, secure, and flexible mailer
|
2012-01-11 15:22:18 +01:00
|
|
|
License: IPL-1.0
|
2007-01-16 00:33:08 +01:00
|
|
|
Group: Productivity/Networking/Email/Servers
|
2012-01-11 15:22:18 +01:00
|
|
|
Version: 2.8.7
|
|
|
|
Release: 0
|
2009-10-12 16:51:23 +02:00
|
|
|
Url: http://www.postfix.org/
|
|
|
|
Source: %{name}-%{version}.tar.bz2
|
|
|
|
Source1: %{name}-SuSE.tar.gz
|
|
|
|
Source2: %{name}-mysql.tar.bz2
|
|
|
|
Source10: rpmlintrc
|
2010-04-13 21:38:42 +02:00
|
|
|
Source11: check_mail_queue
|
2007-01-16 00:33:08 +01:00
|
|
|
Patch: dynamic_maps.patch
|
|
|
|
Patch1: dynamic_maps_pie.patch
|
2007-03-07 22:50:13 +01:00
|
|
|
Patch2: pointer_to_literals.patch
|
|
|
|
Patch3: ipv6_disabled.patch
|
2011-05-15 16:21:14 +02:00
|
|
|
Patch10: %{name}-2.8.3-main.cf.patch
|
2011-05-18 00:52:01 +02:00
|
|
|
Patch11: %{name}-2.8.3-master.cf.patch
|
|
|
|
Patch12: %{name}-2.8.3-post-install.patch
|
2011-07-01 14:45:31 +02:00
|
|
|
Patch20: %{name}-vda-v10-2.8.3.patch
|
2011-10-10 08:27:24 +02:00
|
|
|
Patch21: postfix-2.8.5-ssl-release-buffers.patch
|
2007-01-16 00:33:08 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2009-10-12 16:51:23 +02:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq
|
|
|
|
PreReq: /usr/bin/getent
|
2012-01-11 15:22:51 +01:00
|
|
|
PreReq: /usr/sbin/useradd /usr/sbin/groupadd /usr/sbin/usermod
|
2009-10-12 16:51:23 +02:00
|
|
|
PreReq: /bin/sed /bin/awk /bin/grep
|
2010-02-12 21:17:29 +01:00
|
|
|
PreReq: textutils sh-utils fileutils pcre netcfg
|
2011-05-28 06:25:45 +02:00
|
|
|
%if 0%{?suse_version} > 1130
|
2010-12-08 14:27:54 +01:00
|
|
|
PreReq: sysvinit(syslog) sysvinit(network)
|
2011-05-28 06:25:45 +02:00
|
|
|
%endif
|
2011-05-26 10:24:08 +02:00
|
|
|
Requires: iproute2
|
2009-10-12 16:51:23 +02:00
|
|
|
BuildRequires: db-devel
|
|
|
|
BuildRequires: mysql-devel
|
2012-01-11 15:22:18 +01:00
|
|
|
BuildRequires: openldap2-devel
|
|
|
|
BuildRequires: pcre-devel
|
|
|
|
BuildRequires: postgresql-devel
|
2009-10-12 16:51:23 +02:00
|
|
|
# require pwdutils to make postinstall script check work
|
|
|
|
BuildRequires: pwdutils
|
2011-05-28 06:25:45 +02:00
|
|
|
%if 0%{?suse_version} >= 1100
|
2009-10-12 16:51:23 +02:00
|
|
|
BuildRequires: fdupes
|
2011-05-28 06:25:45 +02:00
|
|
|
%endif
|
2011-11-03 16:56:57 +01:00
|
|
|
%if 0%{?suse_version} > 1140
|
|
|
|
BuildRequires: systemd
|
|
|
|
%{?systemd_requires}
|
|
|
|
%endif
|
|
|
|
|
2007-01-16 00:33:08 +01:00
|
|
|
#
|
2009-10-12 16:51:23 +02:00
|
|
|
Conflicts: sendmail exim
|
|
|
|
Provides: smtp_daemon
|
2007-01-16 00:33:08 +01:00
|
|
|
#
|
|
|
|
# Some defines
|
|
|
|
#
|
2009-10-12 16:51:23 +02:00
|
|
|
%define pf_docdir %{_docdir}/%{name}-doc
|
|
|
|
%define pf_config_directory /etc/%{name}
|
|
|
|
%define pf_daemon_directory /usr/lib/%{name}
|
2007-01-16 00:33:08 +01:00
|
|
|
%define pf_command_directory /usr/sbin
|
2009-10-12 16:51:23 +02:00
|
|
|
%define pf_queue_directory var/spool/%{name}
|
2007-01-16 00:33:08 +01:00
|
|
|
%define pf_sendmail_path /usr/sbin/sendmail
|
|
|
|
%define pf_newaliases_path /usr/bin/newaliases
|
|
|
|
%define pf_mailq_path /usr/bin/mailq
|
|
|
|
%define pf_setgid_group maildrop
|
2008-10-22 18:42:21 +02:00
|
|
|
%define pf_readme_directory %{_docdir}/%{name}-doc/README_FILES
|
|
|
|
%define pf_html_directory %{_docdir}/%{name}-doc/html
|
|
|
|
%define pf_sample_directory %{_docdir}/%{name}-doc/samples
|
2009-10-12 16:51:23 +02:00
|
|
|
%define pf_data_directory /var/lib/%{name}
|
|
|
|
%define pf_uid 51
|
|
|
|
%define pf_gid 51
|
2007-01-16 00:33:08 +01:00
|
|
|
%define maildrop_gid 59
|
2012-01-11 15:22:18 +01:00
|
|
|
%define mail_gid 12
|
2009-10-12 16:51:23 +02:00
|
|
|
%define conf_backup_dir /var/adm/backup/%{name}
|
2007-03-29 18:25:21 +02:00
|
|
|
%define omc_pdir /usr/share/omc/
|
2007-01-18 01:51:49 +01:00
|
|
|
%define omc_dir /usr/share/omc/svcinfo.d/
|
2007-01-16 00:33:08 +01:00
|
|
|
#
|
2009-10-12 16:51:23 +02:00
|
|
|
%define vmusr vmail
|
|
|
|
%define vmgid 303
|
|
|
|
%define vmid 303
|
|
|
|
%define vmdir /srv/maildirs
|
|
|
|
#
|
2007-01-16 00:33:08 +01:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-10-08 16:52:13 +02:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%description
|
|
|
|
Postfix aims to be an alternative to the widely-used sendmail program.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development headers for the postfix package
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
PreReq: %{name} = %{version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Postfix aims to be an alternative to the widely-used sendmail program.
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentations for the postfix package
|
|
|
|
Group: Productivity/Networking/Email/Servers
|
2010-01-21 11:04:31 +01:00
|
|
|
%if 0%{?suse_version} >= 1120
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
2009-10-12 16:51:23 +02:00
|
|
|
|
|
|
|
%description doc
|
|
|
|
Postfix aims to be an alternative to the widely-used sendmail program.
|
|
|
|
This package contains the documentation for %{name}
|
|
|
|
|
|
|
|
%package mysql
|
|
|
|
Summary: Postfix plugin to support MySQL maps
|
|
|
|
Group: Productivity/Networking/Email/Servers
|
|
|
|
PreReq: %{name} = %{version}
|
|
|
|
|
|
|
|
%description mysql
|
|
|
|
Postfix plugin to support MySQL maps. This library will be loaded by
|
|
|
|
starting %{name} if you'll access a postmap which is stored in mysql.
|
|
|
|
|
|
|
|
%package postgresql
|
|
|
|
Summary: Postfix plugin to support PostgreSQL maps
|
|
|
|
Group: Productivity/Networking/Email/Servers
|
|
|
|
PreReq: %{name} = %{version}
|
|
|
|
|
|
|
|
%description postgresql
|
|
|
|
Postfix plugin to support PostgreSQL maps. This library will be loaded
|
|
|
|
by starting %{name} if you'll access a postmap which is stored in
|
|
|
|
PostgreSQL.
|
|
|
|
|
2007-01-16 00:33:08 +01:00
|
|
|
%prep
|
2009-10-12 16:51:23 +02:00
|
|
|
%setup -n %{name}-%{version} -a 1 -a 2
|
|
|
|
%patch -p1
|
2007-08-06 21:56:28 +02:00
|
|
|
%patch1
|
2007-03-07 22:50:13 +01:00
|
|
|
%patch2 -p1
|
|
|
|
%patch3 -p1
|
2009-10-12 16:51:23 +02:00
|
|
|
%patch10 -p1
|
|
|
|
%patch11 -p1
|
2011-05-15 16:21:14 +02:00
|
|
|
%patch12 -p1
|
2011-05-18 00:52:01 +02:00
|
|
|
%patch20 -p1
|
2011-10-10 08:27:24 +02:00
|
|
|
%patch21
|
2007-01-16 00:33:08 +01:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%build
|
|
|
|
export CCARGS="-DHAS_LDAP -DHAS_PCRE -DUSE_SASL_AUTH -I/usr/include/sasl"
|
|
|
|
export CCARGS="$CCARGS -DMAX_DYNAMIC_MAPS"
|
|
|
|
export CCARGS="$CCARGS -DHAS_MYSQL -I/usr/include/mysql"
|
|
|
|
export CCARGS="$CCARGS -DHAS_PGSQL -I/usr/include/pgsql"
|
|
|
|
export CCARGS="$CCARGS -DUSE_CYRUS_SASL"
|
|
|
|
export AUXLIBS="-lldap -llber -lpcre"
|
|
|
|
export AUXLIBS="$AUXLIBS -lsasl2"
|
|
|
|
export AUXLIBS="$AUXLIBS -lssl -lcrypto"
|
|
|
|
export CCARGS="$CCARGS -DUSE_TLS"
|
|
|
|
export CCARGS="$CCARGS $RPM_OPT_FLAGS -Wno-comments"
|
|
|
|
export PIE=-pie
|
|
|
|
make makefiles DEBUG=""
|
|
|
|
cd lib
|
|
|
|
for i in dns global master tls util milter; do
|
2009-10-12 16:51:23 +02:00
|
|
|
ln -sf lib${i}.a lib%{name}-${i}.so.1.0.1;
|
2007-01-16 00:33:08 +01:00
|
|
|
done
|
|
|
|
cd -
|
|
|
|
make LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH}
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%install
|
2009-10-12 16:51:23 +02:00
|
|
|
/usr/sbin/groupadd -g %{pf_gid} -o -r %{name} 2> /dev/null || :
|
2007-01-16 00:33:08 +01:00
|
|
|
/usr/sbin/groupadd -g %{maildrop_gid} -o -r maildrop 2> /dev/null || :
|
2009-10-12 16:51:23 +02:00
|
|
|
/usr/sbin/useradd -r -o -g %{name} -u %{pf_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} %{name} 2> /dev/null || :
|
2012-01-11 15:22:18 +01:00
|
|
|
/usr/sbin/usermod -G %{maildrop_gid},%{mail_gid} {name} 2> /dev/null || :
|
2007-01-16 00:33:08 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
|
|
|
|
install lib/*.1 $RPM_BUILD_ROOT/%{_libdir}
|
|
|
|
for i in $RPM_BUILD_ROOT/%{_libdir}/*.1; do
|
|
|
|
ln -sf ${i##*/} ${i%.*.*}
|
|
|
|
done
|
|
|
|
cd lib
|
|
|
|
for i in libpostfix-*; do
|
|
|
|
ln -sf $i $RPM_BUILD_ROOT/%{_libdir}/${i%so.*}so
|
|
|
|
done
|
|
|
|
cd -
|
|
|
|
ln -sf $(pwd)/lib/dict_* libexec/
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RPM_BUILD_ROOT/%{_libdir}
|
|
|
|
sh postfix-install -non-interactive \
|
|
|
|
install_root=%{buildroot} \
|
|
|
|
config_directory=%{pf_config_directory} \
|
|
|
|
daemon_directory=%{pf_daemon_directory} \
|
|
|
|
command_directory=%{pf_command_directory} \
|
2008-08-07 01:34:35 +02:00
|
|
|
queue_directory=/%{pf_queue_directory} \
|
2007-01-16 00:33:08 +01:00
|
|
|
sendmail_path=%{pf_sendmail_path} \
|
|
|
|
newaliases_path=%{pf_newaliases_path} \
|
|
|
|
mailq_path=%{pf_mailq_path} \
|
|
|
|
manpage_directory=%{_mandir} \
|
|
|
|
setgid_group=%{pf_setgid_group} \
|
2008-02-01 23:38:24 +01:00
|
|
|
readme_directory=%{pf_readme_directory} \
|
|
|
|
data_directory=%{pf_data_directory}
|
2007-01-16 00:33:08 +01:00
|
|
|
ln -sf ../sbin/sendmail $RPM_BUILD_ROOT/usr/lib/sendmail
|
|
|
|
for i in qmqp-source smtp-sink smtp-source; do
|
|
|
|
install -m 755 bin/$i $RPM_BUILD_ROOT/usr/sbin/$i
|
|
|
|
done
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/sbin/conf.d
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/permissions.d
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/sasl2
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{conf_backup_dir}
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{pf_sample_directory}
|
2011-05-04 10:08:55 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{pf_html_directory}
|
2009-10-12 16:51:23 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/include/%{name}
|
2007-01-16 00:33:08 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
|
2009-10-12 16:51:23 +02:00
|
|
|
install -m 644 %{name}-SuSE/smtp $RPM_BUILD_ROOT/etc/pam.d/smtp
|
2007-01-16 00:33:08 +01:00
|
|
|
#mkdir samples
|
2009-10-12 16:51:23 +02:00
|
|
|
install -m 755 %{name}-SuSE/rc.%{name} $RPM_BUILD_ROOT/etc/init.d/%{name}
|
|
|
|
ln -sf ../etc/init.d/%{name} $RPM_BUILD_ROOT/sbin/rc%{name}
|
2007-01-16 00:33:08 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
2009-10-12 16:51:23 +02:00
|
|
|
rm -f $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}
|
|
|
|
sed -e 's;@lib@;%{_lib};g' %{name}-SuSE/sysconfig.%{name} > $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}
|
|
|
|
install -m 644 %{name}-SuSE/sysconfig.mail-%{name} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mail-%{name}
|
2011-08-18 11:35:16 +02:00
|
|
|
test -e $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name} && rm -f $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name}
|
2007-01-16 00:33:08 +01:00
|
|
|
sed -e 's;@lib@;%{_lib};g' \
|
|
|
|
-e 's;@conf_backup_dir@;%{conf_backup_dir};' \
|
|
|
|
-e 's;@daemon_directory@;%{pf_daemon_directory};' \
|
|
|
|
-e 's;@readme_directory@;%{pf_readme_directory};' \
|
|
|
|
-e 's;@html_directory@;%{pf_html_directory};' \
|
|
|
|
-e 's;@sendmail_path@;%{pf_sendmail_path};' \
|
|
|
|
-e 's;@setgid_group@;%{pf_setgid_group};' \
|
|
|
|
-e 's;@manpage_directory@;%{_mandir};' \
|
|
|
|
-e 's;@newaliases_path@;%{pf_newaliases_path};' \
|
|
|
|
-e 's;@sample_directory@;%{pf_sample_directory};' \
|
2009-10-12 16:51:23 +02:00
|
|
|
-e 's;@mailq_path@;%{pf_mailq_path};' %{name}-SuSE/SuSEconfig.%{name} \
|
2011-08-18 11:35:16 +02:00
|
|
|
> $RPM_BUILD_ROOT/usr/sbin/SuSEconfig.%{name}
|
|
|
|
chmod 755 $RPM_BUILD_ROOT/usr/sbin/SuSEconfig.%{name}
|
2009-10-12 16:51:23 +02:00
|
|
|
install -m 644 %{name}-SuSE/dynamicmaps.cf $RPM_BUILD_ROOT/etc/%{name}/dynamicmaps.cf
|
2011-01-31 09:37:02 +01:00
|
|
|
install -m 644 %{name}-SuSE/ldap_aliases.cf $RPM_BUILD_ROOT/etc/%{name}/ldap_aliases.cf
|
2009-10-12 16:51:23 +02:00
|
|
|
install -m 644 %{name}-SuSE/helo_access $RPM_BUILD_ROOT/etc/postfix/helo_access
|
|
|
|
install -m 644 %{name}-SuSE/permissions $RPM_BUILD_ROOT/etc/permissions.d/%{name}
|
|
|
|
install -m 644 %{name}-SuSE/sender_canonical $RPM_BUILD_ROOT/etc/%{name}/sender_canonical
|
|
|
|
install -m 644 %{name}-SuSE/relay $RPM_BUILD_ROOT/etc/postfix/relay
|
|
|
|
install -m 644 %{name}-SuSE/relay_ccerts $RPM_BUILD_ROOT/etc/%{name}/relay_ccerts
|
|
|
|
install -m 600 %{name}-SuSE/sasl_passwd $RPM_BUILD_ROOT/etc/%{name}/sasl_passwd
|
2007-01-16 00:33:08 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/sasl2
|
2009-10-12 16:51:23 +02:00
|
|
|
install -m 600 %{name}-SuSE/smtpd.conf $RPM_BUILD_ROOT/etc/sasl2/smtpd.conf
|
|
|
|
install -m 644 %{name}-SuSE/openssl_%{name}.conf.in $RPM_BUILD_ROOT/etc/%{name}/openssl_%{name}.conf.in
|
|
|
|
install -m 755 %{name}-SuSE/mk%{name}cert $RPM_BUILD_ROOT/usr/sbin/mk%{name}cert
|
2007-01-18 01:51:49 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{omc_dir}
|
2009-10-12 16:51:23 +02:00
|
|
|
install -m 644 %{name}-SuSE/%{name}.xml $RPM_BUILD_ROOT/%{omc_dir}
|
2007-10-22 18:39:54 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/
|
2012-01-25 16:13:45 +01:00
|
|
|
install -m 644 %{name}-SuSE/%{name}-fw $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/smtp
|
2007-01-16 00:33:08 +01:00
|
|
|
{
|
|
|
|
cat<<EOF
|
|
|
|
#
|
|
|
|
# -----------------------------------------------------------------------
|
|
|
|
# NOTE: Many parameters have already been added to the end of this file
|
|
|
|
# by SuSEconfig.postfix. So take care that you don't uncomment
|
|
|
|
# and set a parameter without checking whether it has been added
|
|
|
|
# to the end of this file.
|
|
|
|
# -----------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
EOF
|
|
|
|
cat conf/main.cf
|
2009-10-12 16:51:23 +02:00
|
|
|
} > $RPM_BUILD_ROOT/etc/%{name}/main.cf
|
|
|
|
$RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/%{name} \
|
2007-01-16 00:33:08 +01:00
|
|
|
-e "manpage_directory = %{_mandir}" \
|
|
|
|
"setgid_group = %{pf_setgid_group}" \
|
|
|
|
"mailq_path = %{pf_mailq_path}" \
|
|
|
|
"newaliases_path = %{pf_newaliases_path}" \
|
|
|
|
"sendmail_path = %{pf_sendmail_path}" \
|
|
|
|
"readme_directory = %{pf_readme_directory}" \
|
|
|
|
"html_directory = %{pf_html_directory}" \
|
|
|
|
"sample_directory = %{pf_sample_directory}" \
|
2011-05-15 16:21:14 +02:00
|
|
|
"daemon_directory = %{pf_daemon_directory}"
|
2011-05-04 13:36:12 +02:00
|
|
|
#Set Permissions
|
|
|
|
install -m 644 %{name}-SuSE/%{name}-files $RPM_BUILD_ROOT/usr/lib/postfix/postfix-files
|
2009-10-12 16:51:23 +02:00
|
|
|
# postfix-mysql
|
|
|
|
install -m 644 %{name}-mysql/main.cf-mysql $RPM_BUILD_ROOT/etc/%{name}/main.cf-mysql
|
2011-05-04 13:36:12 +02:00
|
|
|
install -m 640 %{name}-mysql/*_maps.cf $RPM_BUILD_ROOT/etc/%{name}/
|
2007-01-16 00:33:08 +01:00
|
|
|
# create paranoid permissions file
|
2009-10-12 16:51:23 +02:00
|
|
|
printf '%%-38s %%-18s %%s\n' /usr/sbin/postdrop "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}.paranoid
|
|
|
|
printf '%%-38s %%-18s %%s\n' /usr/sbin/postqueue "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}.paranoid
|
|
|
|
install -m 644 include/*.h $RPM_BUILD_ROOT/usr/include/%{name}/
|
|
|
|
# some rpmlint stuff
|
|
|
|
# remove unneeded examples/chroot-setup
|
|
|
|
for example in AIX42 BSDI* F* HPUX* IRIX* NETBSD1 NEXTSTEP3 OPENSTEP4 OSF1 Solaris*; do
|
|
|
|
%{__rm} examples/chroot-setup/${example}
|
|
|
|
done
|
2011-05-04 10:08:55 +02:00
|
|
|
cp -a examples/* $RPM_BUILD_ROOT%{pf_sample_directory}
|
|
|
|
cp -a html/* $RPM_BUILD_ROOT%{pf_html_directory}
|
2011-07-01 14:45:31 +02:00
|
|
|
cp -a auxiliary/ $RPM_BUILD_ROOT%{pf_docdir}/
|
2011-08-12 18:44:59 +02:00
|
|
|
%if 0%{?suse_version} >= 1140
|
|
|
|
mkdir -p %{buildroot}/lib/systemd/system
|
|
|
|
mkdir -p %{buildroot}/etc/postfix/system
|
2011-12-13 15:51:10 +01:00
|
|
|
install -m 0644 %{name}-SuSE/postfix.service %{buildroot}/lib/systemd/system/
|
|
|
|
install -m 0755 %{name}-SuSE/update_chroot.systemd %{buildroot}/etc/postfix/system/update_chroot
|
|
|
|
install -m 0755 %{name}-SuSE/rebuild_tables.systemd %{buildroot}/etc/postfix/system/rebuild_tables
|
|
|
|
install -m 0755 %{name}-SuSE/wait_qmgr.systemd %{buildroot}/etc/postfix/system/wait_qmgr
|
|
|
|
install -m 0755 %{name}-SuSE/cond_slp.systemd %{buildroot}/etc/postfix/system/cond_slp
|
2011-08-12 18:44:59 +02:00
|
|
|
%endif
|
2011-05-15 16:21:14 +02:00
|
|
|
%if 0%{?suse_version} >= 1100
|
2009-10-12 16:51:23 +02:00
|
|
|
%fdupes $RPM_BUILD_ROOT%{pf_docdir}
|
|
|
|
%fdupes $RPM_BUILD_ROOT%{_mandir}
|
2011-05-15 16:21:14 +02:00
|
|
|
%endif
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2010-04-13 21:38:42 +02:00
|
|
|
install -m 755 %{SOURCE11} $RPM_BUILD_ROOT/usr/sbin/
|
2007-01-16 00:33:08 +01:00
|
|
|
|
|
|
|
%pre
|
2011-11-03 16:56:57 +01:00
|
|
|
%if %suse_version > 1140
|
|
|
|
%service_add_pre %{name}.service
|
|
|
|
%endif
|
|
|
|
|
2007-01-16 00:33:08 +01:00
|
|
|
VERSIONTEST=$(test -x usr/sbin/postconf && usr/sbin/postconf proxy_read_maps 2>/dev/null)
|
2008-08-07 01:34:35 +02:00
|
|
|
if [ -z "$VERSIONTEST" -a -f %{pf_queue_directory}/pid/master.pid ]; then
|
2009-10-12 16:51:23 +02:00
|
|
|
if checkproc -p %{pf_queue_directory}/pid/master.pid usr/lib/%{name}/master; then
|
|
|
|
echo "%{name} is still running. You have to stop %{name} in order to"
|
2007-01-16 00:33:08 +01:00
|
|
|
echo "install a newer version."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2009-10-12 16:51:23 +02:00
|
|
|
/usr/sbin/groupadd -g %{pf_gid} -o -r %{name} 2> /dev/null || :
|
2007-01-16 00:33:08 +01:00
|
|
|
/usr/sbin/groupadd -g %{maildrop_gid} -o -r maildrop 2> /dev/null || :
|
2011-05-04 10:08:55 +02:00
|
|
|
/usr/sbin/useradd -r -o -g %{name} -u %{pf_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} %{name} 2> /dev/null || :
|
2012-01-11 15:22:18 +01:00
|
|
|
/usr/sbin/usermod -G %{maildrop_gid},%{mail_gid} {name} 2> /dev/null || :
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%pre mysql
|
|
|
|
#echo "PARAM_pre: "$1
|
|
|
|
# on `rpm -ivh` PARAM is 1
|
|
|
|
# on `rpm -Uvh` PARAM is 2
|
|
|
|
if [ "$1" = "1" ]; then
|
|
|
|
echo "Adding %{vmusr} user"
|
|
|
|
if [ -z "`%{_bindir}/getent group %{vmusr} 2>/dev/null`" ]; then
|
|
|
|
%{_sbindir}/groupadd -r -g %{vmgid} %{vmusr}
|
|
|
|
fi
|
|
|
|
if [ -z "`%{_bindir}/getent passwd %{vmusr} 2>/dev/null`" ]; then
|
|
|
|
%{_sbindir}/useradd -c "maildirs chef" -d %{vmdir} -g %{vmusr} -u %{vmid} -r -s /bin/false %{vmusr}
|
|
|
|
fi
|
2007-01-16 00:33:08 +01:00
|
|
|
fi
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%preun
|
|
|
|
%stop_on_removal %{name}
|
2011-11-03 16:56:57 +01:00
|
|
|
%if %suse_version > 1140
|
|
|
|
%service_del_preun %{name}.service
|
|
|
|
%endif
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%preun mysql
|
|
|
|
#echo "PARAM_preun: "$1
|
|
|
|
# on `rpm -e` PARAM is 0
|
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
FILE=etc/%{name}/dynamicmaps.cf
|
2007-01-16 00:33:08 +01:00
|
|
|
if [ -e "$FILE" ] ; then
|
2009-10-12 16:51:23 +02:00
|
|
|
if grep -q "^mysql[[:space:]]" ${FILE}; then
|
|
|
|
echo "Removing mysql map entry from ${FILE}"
|
|
|
|
sed "/^mysql[[:space:]]/d" ${FILE} > ${FILE}.$$ && \
|
2007-01-16 00:33:08 +01:00
|
|
|
cp --remove-destination ${FILE}.$$ ${FILE} && \
|
|
|
|
rm ${FILE}.$$
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Can not find \"$FILE\". Not updating the file." >&2
|
|
|
|
fi
|
2009-10-12 16:51:23 +02:00
|
|
|
echo "Removing %{vmusr} user"
|
|
|
|
userdel %{vmusr} 2> /dev/null
|
|
|
|
groupdel %{vmusr} 2> /dev/null
|
2007-01-16 00:33:08 +01:00
|
|
|
fi
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%preun postgresql
|
2007-01-16 00:33:08 +01:00
|
|
|
if [ "$1" = 0 ] ; then
|
2009-10-12 16:51:23 +02:00
|
|
|
FILE=etc/%{name}/dynamicmaps.cf
|
2007-01-16 00:33:08 +01:00
|
|
|
if [ -e "$FILE" ] ; then
|
2009-10-12 16:51:23 +02:00
|
|
|
if grep -q "^pgsql[[:space:]]" ${FILE}; then
|
|
|
|
echo "Removing pgsql map entry from ${FILE}"
|
|
|
|
sed "/^pgsql[[:space:]]/d" ${FILE} > ${FILE}.$$ && \
|
2007-01-16 00:33:08 +01:00
|
|
|
cp --remove-destination ${FILE}.$$ ${FILE} && \
|
|
|
|
rm ${FILE}.$$
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Can not find \"$FILE\". Not updating the file." >&2
|
|
|
|
fi
|
|
|
|
fi
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%post
|
|
|
|
# We never have to run suseconfig for postfix after installation
|
|
|
|
# We only start postfix own upgrade-configuration by update
|
2011-05-04 13:36:12 +02:00
|
|
|
/usr/sbin/postfix set-permissions
|
2011-04-12 14:59:50 +02:00
|
|
|
if [ ${1:-0} -gt 1 ]; then
|
2011-05-02 10:40:39 +02:00
|
|
|
/usr/sbin/postfix upgrade-configuration || :
|
2011-08-18 11:35:16 +02:00
|
|
|
else
|
|
|
|
if [ ! -e /sbin/conf.d/SuSEconfig.postfix ]
|
|
|
|
then
|
|
|
|
ln -s /usr/sbin/SuSEconfig.postfix /sbin/conf.d/SuSEconfig.postfix
|
|
|
|
fi
|
2011-04-12 14:59:50 +02:00
|
|
|
fi
|
2011-05-15 16:21:14 +02:00
|
|
|
# before fillup we need to fix something
|
2011-10-15 16:18:03 +02:00
|
|
|
[ \! -f %{_sysconfdir}/sysconfig/%{name} ] || %{__sed} -i \
|
2011-05-15 16:21:14 +02:00
|
|
|
-e "s/POSTFIX_SMTPD_SENDERNT_RESTRICTIONS/POSTFIX_SMTPD_SENDER_RESTRICTIONS/" \
|
|
|
|
%{_sysconfdir}/sysconfig/%{name}
|
2009-12-11 13:34:58 +01:00
|
|
|
%{fillup_and_insserv -y postfix}
|
|
|
|
%{fillup_only -an mail}
|
2011-11-03 16:56:57 +01:00
|
|
|
%if %suse_version > 1140
|
|
|
|
%service_add_post %{name}.service
|
|
|
|
%endif
|
2010-01-21 11:04:31 +01:00
|
|
|
/sbin/ldconfig
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%postun
|
|
|
|
%restart_on_update %{name}
|
|
|
|
%insserv_cleanup
|
2010-01-21 11:04:31 +01:00
|
|
|
/sbin/ldconfig
|
2011-11-03 16:56:57 +01:00
|
|
|
%if %suse_version > 1140
|
|
|
|
%service_del_postun %{name}.service
|
|
|
|
%endif
|
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%post postgresql
|
|
|
|
FILE=etc/%{name}/dynamicmaps.cf
|
|
|
|
if ! grep -q "^pgsql[[:space:]]" ${FILE}; then
|
|
|
|
echo "Adding pgsql map entry to ${FILE}"
|
|
|
|
echo "pgsql /usr/lib/%{name}/dict_pgsql.so dict_pgsql_open" >> ${FILE}
|
|
|
|
fi
|
|
|
|
# ---------------------------------------------------------------------------
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%post mysql
|
|
|
|
FILE=etc/%{name}/dynamicmaps.cf
|
|
|
|
if ! grep -q "^mysql[[:space:]]" ${FILE}; then
|
|
|
|
echo "Adding mysql map entry to ${FILE}"
|
|
|
|
echo "mysql /usr/lib/%{name}/dict_mysql.so dict_mysql_open" >> ${FILE}
|
|
|
|
fi
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2008-10-22 18:42:21 +02:00
|
|
|
|
2011-04-12 14:59:50 +02:00
|
|
|
%files
|
2007-01-16 00:33:08 +01:00
|
|
|
%defattr(-,root,root)
|
2011-02-10 12:44:16 +01:00
|
|
|
%doc LICENSE
|
2007-01-16 00:33:08 +01:00
|
|
|
%config /etc/pam.d/*
|
2009-10-12 16:51:23 +02:00
|
|
|
/var/adm/fillup-templates/sysconfig.%{name}
|
|
|
|
/var/adm/fillup-templates/sysconfig.mail-%{name}
|
2011-08-18 11:35:16 +02:00
|
|
|
/usr/sbin/SuSEconfig.%{name}
|
2009-10-12 16:51:23 +02:00
|
|
|
%config(noreplace) %{omc_dir}/%{name}.xml
|
|
|
|
%dir /etc/%{name}
|
2011-04-12 14:59:50 +02:00
|
|
|
%config /etc/%{name}/main.cf.default
|
2009-10-12 16:51:23 +02:00
|
|
|
%config(noreplace) /etc/%{name}/access
|
2011-04-12 14:59:50 +02:00
|
|
|
%config(noreplace) /etc/%{name}/aliases
|
2009-10-12 16:51:23 +02:00
|
|
|
%config(noreplace) /etc/%{name}/generic
|
|
|
|
%config(noreplace) /etc/%{name}/helo_access
|
|
|
|
%config(noreplace) /etc/%{name}/canonical
|
|
|
|
%config(noreplace) /etc/%{name}/main.cf
|
|
|
|
%config(noreplace) /etc/%{name}/master.cf
|
|
|
|
%config(noreplace) /etc/%{name}/openssl_%{name}.conf.in
|
|
|
|
%config(noreplace) /etc/%{name}/relocated
|
|
|
|
%config(noreplace) /etc/%{name}/transport
|
|
|
|
%config(noreplace) /etc/%{name}/virtual
|
|
|
|
%config(noreplace) /etc/%{name}/sasl_passwd
|
|
|
|
%config(noreplace) /etc/%{name}/sender_canonical
|
|
|
|
%config(noreplace) /etc/%{name}/relay
|
|
|
|
%config(noreplace) /etc/%{name}/relay_ccerts
|
|
|
|
%config(noreplace) /etc/%{name}/header_checks
|
|
|
|
%config(noreplace) /etc/%{name}/bounce.cf.default
|
|
|
|
%config(noreplace) /etc/%{name}/dynamicmaps.cf
|
2011-01-31 09:37:02 +01:00
|
|
|
%config(noreplace) /etc/%{name}/ldap_aliases.cf
|
2012-01-25 16:13:45 +01:00
|
|
|
%config /etc/sysconfig/SuSEfirewall2.d/services/smtp
|
2007-01-16 00:33:08 +01:00
|
|
|
%dir /etc/sasl2/
|
|
|
|
%config(noreplace) /etc/sasl2/smtpd.conf
|
2009-10-12 16:51:23 +02:00
|
|
|
%config /etc/%{name}/LICENSE
|
|
|
|
%config /etc/%{name}/TLS_LICENSE
|
|
|
|
%config /etc/permissions.d/%{name}
|
|
|
|
%config /etc/permissions.d/%{name}.paranoid
|
|
|
|
%attr(0644, root, root) %config /etc/%{name}/makedefs.out
|
|
|
|
/usr/lib/%{name}/%{name}-files
|
|
|
|
%config %attr(0755,root,root) /etc/init.d/%{name}
|
2011-08-12 18:44:59 +02:00
|
|
|
%if 0%{?suse_version} >= 1140
|
|
|
|
%dir /etc/postfix/system
|
|
|
|
%config %attr(0755,root,root) /etc/postfix/system/update_chroot
|
2011-12-13 15:51:10 +01:00
|
|
|
%config %attr(0755,root,root) /etc/postfix/system/rebuild_tables
|
2011-08-12 18:44:59 +02:00
|
|
|
%config %attr(0755,root,root) /etc/postfix/system/wait_qmgr
|
|
|
|
%config %attr(0755,root,root) /etc/postfix/system/cond_slp
|
|
|
|
%config /lib/systemd/system/postfix.service
|
|
|
|
%endif
|
2007-01-16 00:33:08 +01:00
|
|
|
/usr/bin/mailq
|
|
|
|
/usr/bin/newaliases
|
|
|
|
%attr(0755, root, root) /usr/sbin/sendmail
|
|
|
|
/usr/sbin/qmqp-source
|
|
|
|
/usr/sbin/smtp-sink
|
|
|
|
/usr/sbin/smtp-source
|
2009-10-12 16:51:23 +02:00
|
|
|
/usr/sbin/mk%{name}cert
|
2010-04-13 21:38:42 +02:00
|
|
|
/usr/sbin/check_mail_queue
|
2011-05-04 13:36:12 +02:00
|
|
|
%verify(not mode group) /usr/sbin/post*
|
2009-10-12 16:51:23 +02:00
|
|
|
/sbin/rc%{name}
|
2007-01-16 00:33:08 +01:00
|
|
|
%{_libdir}/lib*
|
|
|
|
/usr/lib/sendmail
|
2009-10-12 16:51:23 +02:00
|
|
|
%dir /usr/lib/%{name}
|
|
|
|
/usr/lib/%{name}/*[^.so]
|
|
|
|
/usr/lib/%{name}/dict_ldap.so
|
|
|
|
/usr/lib/%{name}/dict_pcre.so
|
|
|
|
/usr/lib/%{name}/dict_tcp.so
|
2007-01-16 00:33:08 +01:00
|
|
|
%{conf_backup_dir}
|
2009-10-12 16:51:23 +02:00
|
|
|
%dir %attr(0700,%{name},root) %{pf_data_directory}
|
2007-01-16 00:33:08 +01:00
|
|
|
%{_mandir}/man?/*.gz
|
2011-05-04 13:36:12 +02:00
|
|
|
%dir %attr(0755,%{name},root) /%{pf_queue_directory}
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/active
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/bounce
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/corrupt
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/defer
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/deferred
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/flush
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/hold
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/incoming
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/private
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/saved
|
|
|
|
%dir %attr(0700,%{name},root) /%{pf_queue_directory}/trace
|
|
|
|
%dir %attr(0730,%{name},maildrop) /%{pf_queue_directory}/maildrop
|
|
|
|
%dir %attr(0710,%{name},maildrop) /%{pf_queue_directory}/public
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/include/%{name}/
|
2008-10-22 18:42:21 +02:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%files doc
|
|
|
|
%defattr(0644,root,root,0755)
|
|
|
|
%{pf_docdir}/
|
2008-10-22 18:42:21 +02:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%files mysql
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc %{name}-mysql/%{name}-mysql.sql
|
|
|
|
%config(noreplace) %attr(640, root, %{name}) /etc/%{name}/*_maps.cf
|
|
|
|
%config(noreplace) /etc/%{name}/main.cf-mysql
|
|
|
|
/usr/lib/%{name}/dict_mysql.so
|
2008-10-22 18:42:21 +02:00
|
|
|
|
2009-10-12 16:51:23 +02:00
|
|
|
%files postgresql
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/usr/lib/%{name}/dict_pgsql.so
|
2007-01-16 00:33:08 +01:00
|
|
|
|
2007-02-26 19:06:55 +01:00
|
|
|
%changelog
|