|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
# install dirs
|
|
|
%define postfix_config_dir %{_sysconfdir}/postfix
|
|
|
+%define postfix_shlib_dir %{_libdir}/postfix
|
|
|
%define postfix_daemon_dir %{_libdir}/postfix
|
|
|
%define postfix_command_dir %{_sbindir}
|
|
|
%define postfix_queue_dir %{_var}/spool/postfix
|
|
@@ -27,11 +28,7 @@
|
|
|
%define postfix_readme_dir %{postfix_doc_dir}/README_FILES
|
|
|
|
|
|
|
|
|
-%define origversion 2.11.6
|
|
|
-
|
|
|
-# Macro: %{dynmap_add_cmd <name> [-m]}
|
|
|
-%define dynmap_add_cmd(m) FILE=%{_sysconfdir}/postfix/dynamicmaps.cf; if ! grep -q "^%{1}[[:space:]]" ${FILE}; then echo "Adding %{1} map entry to ${FILE}"; printf '%%-8s%%-35s%%-18s%%s\\n' %{1} %{_libdir}/postfix/dict_%{1}.so dict_%{1}_open %{-m:mkmap_%{1}_open} >> ${FILE}; fi;
|
|
|
-%define dynmap_rm_cmd() FILE=%{_sysconfdir}/postfix/dynamicmaps.cf; if [ $1 = 0 -a -s $FILE ]; then cp -p ${FILE} ${FILE}.$$; grep -v "^%{1}[[:space:]]" ${FILE}.$$ > ${FILE}; rm -f ${FILE}.$$; fi;
|
|
|
+%define origversion 3.0.3
|
|
|
|
|
|
Summary: Postfix Mail Transport Agent
|
|
|
Summary(ja): Postfix メールトランスポートエージェント
|
|
@@ -49,13 +46,8 @@ Source3: postfix.init
|
|
|
|
|
|
Patch0: postfix-2.9.1-vine.patch
|
|
|
|
|
|
-# patches 100-199 are imported from debian package.
|
|
|
-# patches 100/101 for postfix 2.8.x are from mdk.
|
|
|
-Patch100: postfix-2.11.1-dynamicmaps.diff
|
|
|
-Patch101: postfix-2.9.1-dynamicmaps2.diff
|
|
|
-
|
|
|
# patches 200-299 are imported from rh/fedora
|
|
|
-Patch200: postfix-2.5.7-large-fs.patch
|
|
|
+Patch200: postfix-3.0.0-large-fs.patch
|
|
|
|
|
|
Provides: smtpdaemon
|
|
|
Conflicts: sendmail
|
|
@@ -63,7 +55,7 @@ Conflicts: sendmail
|
|
|
BuildRequires: pam-devel
|
|
|
BuildRequires: cyrus-sasl-devel >= 2
|
|
|
BuildRequires: openldap-devel, openssl-devel
|
|
|
-BuildRequires: pcre-devel
|
|
|
+BuildRequires: libicu-devel, pcre-devel
|
|
|
|
|
|
%if "%{_dist_release}" >= "vl7"
|
|
|
BuildRequires: libdb-devel >= 5.3
|
|
@@ -194,55 +186,52 @@ PCRE map on Postfix.
|
|
|
sed -i -e 's|/usr/lib/postfix|/usr/lib64/postfix|g' conf/main.cf
|
|
|
%endif
|
|
|
|
|
|
-%patch100 -p1 -b .dynamicmaps
|
|
|
-%patch101 -p1 -b .dynamicmaps2
|
|
|
-
|
|
|
%patch200 -p1 -b .large-fs
|
|
|
|
|
|
-# patching src/global/Makefile to remove dependency
|
|
|
-pushd src/global
|
|
|
-%if %build_mysql
|
|
|
-:
|
|
|
-%else
|
|
|
-sed -ie "s/ dict_mysql.so/ /" Makefile.in
|
|
|
-%endif
|
|
|
-%if %build_pgsql
|
|
|
-:
|
|
|
-%else
|
|
|
-sed -ie "s/ dict_pgsql.so/ /" Makefile.in
|
|
|
-%endif
|
|
|
-popd
|
|
|
+# Change DEF_SHLIB_DIR according to build host
|
|
|
+sed -i \
|
|
|
+'s|^\(\s*#define\s\+DEF_SHLIB_DIR\s\+\)"/usr/lib/postfix"|\1"%{_libdir}/postfix" |' \
|
|
|
+src/global/mail_params.h
|
|
|
|
|
|
%build
|
|
|
-make makefiles \
|
|
|
- CCARGS="-DMAX_DYNAMIC_MAPS \
|
|
|
- -DHAS_DLOPEN \
|
|
|
- -DUSE_SASL_AUTH -I/usr/include/sasl \
|
|
|
- -DUSE_CYRUS_SASL \
|
|
|
- -DHAS_LDAP \
|
|
|
- -DHAS_SSL -I/usr/include/openssl \
|
|
|
- -DHAS_PCRE -I/usr/include/pcre \
|
|
|
- -DHAS_SQLITE \
|
|
|
+
|
|
|
+CCARGS="-DMAX_DYNAMIC_MAPS \
|
|
|
+ -DUSE_SASL_AUTH -I/usr/include/sasl \
|
|
|
+ -DUSE_CYRUS_SASL \
|
|
|
+ -DHAS_LDAP \
|
|
|
+ -DLDAP_DEPRECATED=1 -DUSE_LDAP_SASL \
|
|
|
+ -DHAS_SSL -I/usr/include/openssl \
|
|
|
+ -DHAS_PCRE -I/usr/include/pcre \
|
|
|
+ -DHAS_SQLITE \
|
|
|
+ `pkg-config --cflags sqlite3` \
|
|
|
+ -DUSE_TLS"
|
|
|
+
|
|
|
+AUXLIBS="-lsasl2 -lssl -lcrypto -lpcre -lldap -llber `pkg-config --libs sqlite3`"
|
|
|
+
|
|
|
%if %build_mysql
|
|
|
- -DHAS_MYSQL -I/usr/include/mysql \
|
|
|
+CCARGS="${CCARGS} -DHAS_MYSQL -I/usr/include/mysql -L%{_libdir}/mysql"
|
|
|
+AUXLIBS="${AUXLIBS} -lmysqlclient -lm"
|
|
|
%endif
|
|
|
%if %build_pgsql
|
|
|
- -DHAS_PGSQL -I/usr/include/pgsql \
|
|
|
+CCARGS="${CCARGS} -DHAS_PGSQL -I/usr/include/pgsql"
|
|
|
+AUXLIBS="${AUXLIBS} -lpq"
|
|
|
%endif
|
|
|
- -DUSE_TLS" \
|
|
|
- AUXLIBS="-lsasl2 -lssl -lcrypto" \
|
|
|
+
|
|
|
+make -f Makefile.init makefiles \
|
|
|
+ shared=yes dynamicmaps=yes \
|
|
|
+ CCARGS="${CCARGS}" \
|
|
|
+ AUXLIBS="${AUXLIBS}" \
|
|
|
+ SHLIB_RPATH="-Wl,-rpath,%{postfix_shlib_dir}" \
|
|
|
OPT="$RPM_OPT_FLAGS" DEBUG=""
|
|
|
-for libs in master global util dns tls milter xsasl
|
|
|
-do
|
|
|
- ln -sf lib${libs}.a lib/libpostfix-${libs}.so.1
|
|
|
-done
|
|
|
|
|
|
# make %{?_smp_mflags} DEBUG="" OPT="$RPM_OPT_FLAGS" \
|
|
|
# LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH}
|
|
|
|
|
|
# using _smp_mflags makes build error. why? (2008.10.11)
|
|
|
-make DEBUG="" OPT="$RPM_OPT_FLAGS" \
|
|
|
- LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} CDBSO=""
|
|
|
+#make DEBUG="" OPT="$RPM_OPT_FLAGS" \
|
|
|
+# LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} CDBSO=""
|
|
|
+
|
|
|
+make %{?_smp_mflags}
|
|
|
|
|
|
%install
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
@@ -261,19 +250,12 @@ install -d $RPM_BUILD_ROOT%{_var}/spool/postfix
|
|
|
install -d $RPM_BUILD_ROOT%{_var}/spool/postfix/{active,corrupt,deferred,incoming,pid,public}
|
|
|
install -d $RPM_BUILD_ROOT%{_var}/spool/postfix/{bounce,defer,flush,maildrop,private,saved}
|
|
|
|
|
|
-# disabled dynmaps
|
|
|
-sed -i -e 's/\(.*dict_cdb.*\)/# \1/g' libexec/postfix-files
|
|
|
-%if ! %build_mysql
|
|
|
-sed -i -e 's/\(.*dict_mysql.*\)/# \1/g' libexec/postfix-files
|
|
|
-%endif
|
|
|
-%if ! %build_pgsql
|
|
|
-sed -i -e 's/\(.*dict_pgsql.*\)/# \1/g' libexec/postfix-files
|
|
|
-%endif
|
|
|
-
|
|
|
LD_LIBRARY_PATH=./lib \
|
|
|
sh postfix-install -non-interactive \
|
|
|
install_root=$RPM_BUILD_ROOT \
|
|
|
config_directory=%{postfix_config_dir} \
|
|
|
+ meta_directory=%{postfix_config_dir} \
|
|
|
+ shlib_directory=%{postfix_shlib_dir} \
|
|
|
daemon_directory=%{postfix_daemon_dir} \
|
|
|
command_directory=%{postfix_command_dir} \
|
|
|
queue_directory=%{postfix_queue_dir} \
|
|
@@ -287,8 +269,6 @@ sh postfix-install -non-interactive \
|
|
|
sample_directory=%{postfix_sample_dir} \
|
|
|
readme_directory=%{postfix_readme_dir} || exit 1
|
|
|
|
|
|
-install -m755 lib/lib*.so.1 $RPM_BUILD_ROOT%{_libdir}
|
|
|
-
|
|
|
install -m644 conf/postfix-files $RPM_BUILD_ROOT%{_sysconfdir}/postfix
|
|
|
for i in post-install postfix-script
|
|
|
do
|
|
@@ -308,6 +288,29 @@ install -m755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/postfix
|
|
|
ln -sf postfix/aliases $RPM_BUILD_ROOT%{_sysconfdir}/aliases
|
|
|
ln -sf postfix/aliases.db $RPM_BUILD_ROOT%{_sysconfdir}/aliases.db
|
|
|
|
|
|
+# helper for splitting content of dynamicmaps.cf and postfix-files
|
|
|
+function split_file
|
|
|
+{
|
|
|
+# "|| :" to silently skip non existent records
|
|
|
+ grep "$1" "$3" >> "$3.d/$2" || :
|
|
|
+ sed -i "\|$1| d" "$3" || :
|
|
|
+}
|
|
|
+
|
|
|
+# split global dynamic maps configuration to individual sub-packages
|
|
|
+pushd $RPM_BUILD_ROOT%{postfix_config_dir}
|
|
|
+for map in sqlite ldap pcre \
|
|
|
+%{?build_mysql:mysql} %{?build_pgsql:pgsql}; do
|
|
|
+ rm -f dynamicmaps.cf.d/"$map" "postfix-files.d/$map"
|
|
|
+ split_file "^\s*$map\b" "$map" dynamicmaps.cf
|
|
|
+ sed -i "s|postfix-$map\\.so|%{postfix_shlib_dir}/\\0|" "dynamicmaps.cf.d/$map"
|
|
|
+
|
|
|
+ split_file "^\$shlib_directory/postfix-$map\\.so:" "$map" postfix-files
|
|
|
+ split_file "^\$manpage_directory/man5/${map}_table\\.5" "$map" postfix-files
|
|
|
+ map_upper=`echo $map | tr '[:lower:]' '[:upper:]'`
|
|
|
+ split_file "^\$readme_directory/${map_upper}_README:" "$map" postfix-files
|
|
|
+done
|
|
|
+popd
|
|
|
+
|
|
|
#( cd $RPM_BUILD_ROOT%{_bindir}
|
|
|
# ln -sf ../sbin/sendmail mailq
|
|
|
# ln -sf ../sbin/sendmail newaliases
|
|
@@ -321,7 +324,8 @@ install -d $RPM_BUILD_ROOT%{_data_dir}
|
|
|
|
|
|
# remove unneeded files
|
|
|
rm -f $RPM_BUILD_ROOT%{postfix_config_dir}/{TLS_,}LICENSE
|
|
|
-
|
|
|
+rm -f $RPM_BUILD_ROOT%{postfix_config_dir}/{main,master}.cf.proto
|
|
|
+rm -f $RPM_BUILD_ROOT%{postfix_config_dir}/makedefs.out
|
|
|
|
|
|
%pre
|
|
|
# Add user and groups if necessary
|
|
@@ -343,7 +347,7 @@ exit 0
|
|
|
manpage_directory=%{_mandir} \
|
|
|
sample_directory=%{postfix_sample_dir} \
|
|
|
readme_directory=%{postfix_readme_dir} &> /dev/null
|
|
|
-%dynmap_add_cmd tcp
|
|
|
+
|
|
|
/sbin/chkconfig --add postfix
|
|
|
if [ ! -f %{_sysconfdir}/postfix/aliases.db ]; then
|
|
|
%{_sbindir}/postalias %{_sysconfdir}/postfix/aliases
|
|
@@ -376,40 +380,6 @@ if [ $1 = 0 ]; then
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
-%post sqlite
|
|
|
-%dynmap_add_cmd sqlite
|
|
|
-
|
|
|
-%preun sqlite
|
|
|
-%dynmap_rm_cmd sqlite
|
|
|
-
|
|
|
-%if %build_pgsql
|
|
|
-%post pgsql
|
|
|
-%dynmap_add_cmd pgsql
|
|
|
-
|
|
|
-%preun pgsql
|
|
|
-%dynmap_rm_cmd pgsql
|
|
|
-%endif
|
|
|
-
|
|
|
-%if %build_mysql
|
|
|
-%post mysql
|
|
|
-%dynmap_add_cmd mysql
|
|
|
-
|
|
|
-%preun mysql
|
|
|
-%dynmap_rm_cmd mysql
|
|
|
-%endif
|
|
|
-
|
|
|
-%post ldap
|
|
|
-%dynmap_add_cmd ldap
|
|
|
-
|
|
|
-%postun ldap
|
|
|
-%dynmap_rm_cmd ldap
|
|
|
-
|
|
|
-%post pcre
|
|
|
-%dynmap_add_cmd pcre
|
|
|
-
|
|
|
-%postun pcre
|
|
|
-%dynmap_rm_cmd pcre
|
|
|
-
|
|
|
%clean
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
@@ -430,6 +400,8 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
%config %{_sysconfdir}/postfix/main.cf.default
|
|
|
%config %{_sysconfdir}/postfix/master.cf
|
|
|
%config %{_sysconfdir}/postfix/bounce.cf.default
|
|
|
+%dir %{_sysconfdir}/postfix/dynamicmaps.cf.d
|
|
|
+%dir %{_sysconfdir}/postfix/postfix-files.d
|
|
|
%config(noreplace) %{_sysconfdir}/postfix/aliases
|
|
|
%config(noreplace) %{_sysconfdir}/postfix/access
|
|
|
%config(noreplace) %{_sysconfdir}/postfix/canonical
|
|
@@ -449,16 +421,17 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
%{_libdir}/postfix/*
|
|
|
|
|
|
%if %{build_pgsql}
|
|
|
-%exclude %{_libdir}/postfix/dict_pgsql.so
|
|
|
+%exclude %{_libdir}/postfix/postfix-pgsql.so
|
|
|
%endif
|
|
|
%if %{build_mysql}
|
|
|
-%exclude %{_libdir}/postfix/dict_mysql.so
|
|
|
+%exclude %{_libdir}/postfix/postfix-mysql.so
|
|
|
%endif
|
|
|
|
|
|
-%exclude %{_libdir}/postfix/dict_sqlite.so
|
|
|
-%exclude %{_libdir}/postfix/dict_ldap.so
|
|
|
-%exclude %{_libdir}/postfix/dict_pcre.so
|
|
|
-%{_libdir}/lib*.so.1
|
|
|
+%exclude %{_libdir}/postfix/postfix-sqlite.so
|
|
|
+%exclude %{_libdir}/postfix/postfix-ldap.so
|
|
|
+%exclude %{_libdir}/postfix/postfix-pcre.so
|
|
|
+%exclude %{_sysconfdir}/postfix/dynamicmaps.cf.d/*
|
|
|
+%exclude %{_sysconfdir}/postfix/postfix-files.d/*
|
|
|
%{_sbindir}/postalias
|
|
|
%{_sbindir}/postcat
|
|
|
%{_sbindir}/postconf
|
|
@@ -496,29 +469,44 @@ rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
%files sqlite
|
|
|
%defattr(-,root,root)
|
|
|
-%{_libdir}/postfix/dict_sqlite.so
|
|
|
+%{_libdir}/postfix/postfix-sqlite.so
|
|
|
+%{_sysconfdir}/postfix/dynamicmaps.cf.d/sqlite
|
|
|
+%{_sysconfdir}/postfix/postfix-files.d/sqlite
|
|
|
|
|
|
%if %build_pgsql
|
|
|
%files pgsql
|
|
|
%defattr(-,root,root)
|
|
|
-%{_libdir}/postfix/dict_pgsql.so
|
|
|
+%{_libdir}/postfix/postfix-pgsql.so
|
|
|
+%{_sysconfdir}/postfix/dynamicmaps.cf.d/pgsql
|
|
|
+%{_sysconfdir}/postfix/postfix-files.d/pgsql
|
|
|
%endif
|
|
|
|
|
|
%if %build_mysql
|
|
|
%files mysql
|
|
|
%defattr(-,root,root)
|
|
|
-%{_libdir}/postfix/dict_mysql.so
|
|
|
+%{_libdir}/postfix/postfix-mysql.so
|
|
|
+%{_sysconfdir}/postfix/dynamicmaps.cf.d/mysql
|
|
|
+%{_sysconfdir}/postfix/postfix-files.d/mysql
|
|
|
%endif
|
|
|
|
|
|
%files ldap
|
|
|
%defattr(-,root,root)
|
|
|
-%{_libdir}/postfix/dict_ldap.so
|
|
|
+%{_libdir}/postfix/postfix-ldap.so
|
|
|
+%{_sysconfdir}/postfix/dynamicmaps.cf.d/ldap
|
|
|
+%{_sysconfdir}/postfix/postfix-files.d/ldap
|
|
|
|
|
|
%files pcre
|
|
|
%defattr(-,root,root)
|
|
|
-%{_libdir}/postfix/dict_pcre.so
|
|
|
+%{_libdir}/postfix/postfix-pcre.so
|
|
|
+%{_sysconfdir}/postfix/dynamicmaps.cf.d/pcre
|
|
|
+%{_sysconfdir}/postfix/postfix-files.d/pcre
|
|
|
|
|
|
%changelog
|
|
|
+* Sun Nov 1 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.3-1
|
|
|
+- new upstream release.
|
|
|
+- updated patch200.
|
|
|
+- dropped patch100 and 101.
|
|
|
+
|
|
|
* Sat Sep 5 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.11.6-1
|
|
|
- new upstream release.
|
|
|
|