Search
j0ke.net Open Build Service
>
Projects
>
home:sheid
>
postfix
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 59
[-]
[+]
Added
postfix.spec
@@ -0,0 +1,1070 @@ +%bcond_without mysql +%bcond_with pgsql +%bcond_without ldap +%bcond_without pcre +%bcond_without sasl +%bcond_without tls +%bcond_without ipv6 +%bcond_without pflogsumm + +# Postfix requires one exlusive uid/gid and a 2nd exclusive gid for its own +# use. Let me know if the second gid collides with another package. +# Be careful: Redhat's 'mail' user & group isn't unique! +%define postfix_uid 89 +%define postfix_user postfix +%define postfix_gid 89 +%define postfix_group postfix +%define maildrop_group postdrop +%define maildrop_gid 90 + +%define postfix_config_dir %{_sysconfdir}/postfix +%define postfix_daemon_dir %{_libexecdir}/postfix +%define postfix_command_dir %{_sbindir} +%define postfix_queue_dir %{_var}/spool/postfix +%define postfix_data_dir %{_var}/lib/postfix +%define postfix_doc_dir %{_docdir}/%{name}-%{version} +%define postfix_sample_dir %{postfix_doc_dir}/samples +%define postfix_readme_dir %{postfix_doc_dir}/README_FILES + +Name: postfix +Summary: Postfix Mail Transport Agent +Version: 2.11.5 +Release: 1.1 +Epoch: 2014 +Group: System Environment/Daemons +URL: http://www.postfix.org +License: IBM +Requires(post): /sbin/chkconfig +Requires(post): %{_sbindir}/alternatives +Requires(pre): %{_sbindir}/groupadd +Requires(pre): %{_sbindir}/useradd +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(preun): %{_sbindir}/alternatives +Requires(postun): /sbin/service + +Provides: MTA smtpd smtpdaemon server(smtp) + +Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/%{name}-%{version}.tar.gz +Source1: postfix-etc-init.d-postfix +Source3: README-Postfix-SASL-RedHat.txt + +# Sources 50-99 are upstream [patch] contributions + +%define pflogsumm_ver 1.1.3 + +%if %{with pflogsumm} +# Postfix Log Entry Summarizer: http://jimsun.linxnet.com/postfix_contrib.html +Source53: http://jimsun.linxnet.com/downloads/pflogsumm-%{pflogsumm_ver}.tar.gz +%endif + +# Sources >= 100 are config files + +Source100: postfix-sasl.conf +Source101: postfix-pam.conf + +# Patches + +Patch1: postfix-2.7.0-config.patch +Patch2: postfix-2.6.1-files.patch +Patch3: postfix-alternatives.patch +Patch8: postfix-large-fs.patch +Patch9: pflogsumm-1.1.3-datecalc.patch + +# Optional patches - set the appropriate environment variables to include +# them when building the package/spec file + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +# Determine the different packages required for building postfix +BuildRequires: db4-devel, pkgconfig, zlib-devel + +%{?with_ldap:BuildRequires: openldap-devel} +%{?with_sasl:BuildRequires: cyrus-sasl-devel} +%{?with_pcre:BuildRequires: pcre-devel} +%{?with_mysql:BuildRequires: mysql-devel} +%{?with_pgsql:BuildRequires: postgresql-devel} +%{?with_tls:BuildRequires: openssl-devel} + +%description +Postfix is a Mail Transport Agent (MTA), supporting LDAP, SMTP AUTH (SASL), +TLS + +%package perl-scripts +Summary: Postfix utilities written in perl +Group: Applications/System +Requires: %{name} = %{epoch}:%{version}-%{release} +# perl-scripts introduced in 2:2.5.5-2 +Obsoletes: postfix < 2:2.5.5-2 +%if %{with pflogsumm} +Provides: postfix-pflogsumm = %{epoch}:%{version}-%{release} +Obsoletes: postfix-pflogsumm < 2:2.5.5-2 +%endif +%description perl-scripts +This package contains perl scripts pflogsumm and qshape. + +Pflogsumm is a log analyzer/summarizer for the Postfix MTA. It is +designed to provide an over-view of Postfix activity. Pflogsumm +generates summaries and, in some cases, detailed reports of mail +server traffic volumes, rejected and bounced email, and server +warnings, errors and panics. + +qshape prints Postfix queue domain and age distribution. + +%prep +%setup -q +# Apply obligatory patches +%patch1 -p1 -b .config +%patch2 -p1 -b .files +%patch3 -p1 -b .alternatives +%patch8 -p1 -b .large-fs + +%if %{with pflogsumm} +gzip -dc %{SOURCE53} | tar xf - +pushd pflogsumm-%{pflogsumm_ver} +%patch9 -p1 -b .datecalc +popd +%endif + +for f in README_FILES/TLS_{LEGACY_,}README TLS_ACKNOWLEDGEMENTS; do + iconv -f iso8859-1 -t utf8 -o ${f}{_,} && + touch -r ${f}{,_} && mv -f ${f}{_,} +done + +%build +CCARGS=-fPIC +AUXLIBS= + +%ifarch s390 s390x ppc +CCARGS="${CCARGS} -fsigned-char" +%endif + +%if %{with ldap} + CCARGS="${CCARGS} -DHAS_LDAP -DLDAP_DEPRECATED=1" + AUXLIBS="${AUXLIBS} -lldap -llber" +%endif +%if %{with pcre} + # -I option required for pcre 3.4 (and later?) + CCARGS="${CCARGS} -DHAS_PCRE -I%{_includedir}/pcre" + AUXLIBS="${AUXLIBS} -lpcre" +%endif +%if %{with mysql} + CCARGS="${CCARGS} -DHAS_MYSQL -I%{_includedir}/mysql" + AUXLIBS="${AUXLIBS} -L%{_libdir}/mysql -lmysqlclient -lm" +%endif +%if %{with pgsql} + CCARGS="${CCARGS} -DHAS_PGSQL -I%{_includedir}/pgsql" + AUXLIBS="${AUXLIBS} -lpq" +%endif +%if %{with sasl} + CCARGS="${CCARGS} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I%{_includedir}/sasl" + AUXLIBS="${AUXLIBS} -L%{_libdir}/sasl2 -lsasl2" + %global sasl_config_dir %{_sysconfdir}/sasl2 +%endif +%if %{with tls} + if pkg-config openssl ; then + CCARGS="${CCARGS} -DUSE_TLS `pkg-config --cflags openssl`" + AUXLIBS="${AUXLIBS} `pkg-config --libs openssl`" + else + CCARGS="${CCARGS} -DUSE_TLS -I/usr/include/openssl" + AUXLIBS="${AUXLIBS} -lssl -lcrypto" + fi +%endif +%if ! %{with ipv6} + CCARGS="${CCARGS} -DNO_IPV6" +%endif + +CCARGS="${CCARGS} -DDEF_CONFIG_DIR=\\\"%{postfix_config_dir}\\\"" +CCARGS="${CCARGS} $(getconf LFS_CFLAGS)" + +AUXLIBS="${AUXLIBS} -pie -Wl,-z,relro" + +make -f Makefile.init makefiles CCARGS="${CCARGS}" AUXLIBS="${AUXLIBS}" \ + DEBUG="" OPT="$RPM_OPT_FLAGS -Wno-comment" + +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT + +# install postfix into $RPM_BUILD_ROOT + +# Move stuff around so we don't conflict with sendmail +for i in man1/mailq.1 man1/newaliases.1 man1/sendmail.1 man5/aliases.5; do + dest=$(echo $i | sed 's|\.[1-9]$|.postfix\0|') + mv man/$i man/$dest + sed -i "s|^\.so $i|\.so $dest|" man/man?/*.[1-9] +done +
Added
_service:download_files:postfix-2.11.5.tar.gz
^