Accepting request 376737 from home:darix:branches:server:mail

- fix build on sle11 by pointing _libexecdir to /usr/lib all the
  time.

- some distros did not pull pkgconfig indirectly. pull it directly.

- fix building the dynamic maps: the old build had postgresql e.g.
  with missing symbols.
  - convert to AUXLIBS_* instead of plain AUXLIBS which is needed
    for proper dynamic maps.
  - reordered the CCARGS and AUXLIBS* lines to group by feature
  - use pkgconfig or *_config tools where possible
- picked up signed char from fedora spec file
- enable lmdb support: new BR lmdb-devel, new subpackage
  postfix-lmdb.
- don't delete vmail user/groups

OBS-URL: https://build.opensuse.org/request/show/376737
OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=233
This commit is contained in:
Lars Vogdt 2016-03-21 16:10:37 +00:00 committed by Git OBS Bridge
parent 4a313bda65
commit 4635d77a7a
2 changed files with 113 additions and 28 deletions

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Sun Mar 20 14:11:27 UTC 2016 - mrueckert@suse.de
- fix build on sle11 by pointing _libexecdir to /usr/lib all the
time.
-------------------------------------------------------------------
Sun Mar 20 13:46:56 UTC 2016 - mrueckert@suse.de
- some distros did not pull pkgconfig indirectly. pull it directly.
-------------------------------------------------------------------
Sun Mar 20 08:19:23 UTC 2016 - mrueckert@suse.de
- fix building the dynamic maps: the old build had postgresql e.g.
with missing symbols.
- convert to AUXLIBS_* instead of plain AUXLIBS which is needed
for proper dynamic maps.
- reordered the CCARGS and AUXLIBS* lines to group by feature
- use pkgconfig or *_config tools where possible
- picked up signed char from fedora spec file
- enable lmdb support: new BR lmdb-devel, new subpackage
postfix-lmdb.
- don't delete vmail user/groups
-------------------------------------------------------------------
Wed Mar 9 13:06:35 UTC 2016 - varkoly@suse.com

View File

@ -15,6 +15,11 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%if 0%{?suse_version} >= 1320 || ( 0%{?suse_version} == 1315 && 0%{?is_opensuse} )
%bcond_without lmdb
%else
%bcond_with lmdb
%endif
#
# Some defines
@ -22,6 +27,7 @@
%define pf_docdir %{_docdir}/%{name}-doc
%define pf_config_directory %{_sysconfdir}/%{name}
%define pf_daemon_directory /usr/lib/%{name}
%define _libexecdir /usr/lib
%define pf_command_directory %{_prefix}/sbin
%define pf_queue_directory var/spool/%{name}
%define pf_sendmail_path %{_sbindir}/sendmail
@ -76,13 +82,17 @@ Patch8: %{name}-vda-v13-3.10.0.patch
BuildRequires: cyrus-sasl-devel
BuildRequires: db-devel
BuildRequires: libopenssl-devel
%if %{with lmdb}
BuildRequires: lmdb-devel
%endif
BuildRequires: mysql-devel
BuildRequires: openldap2-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
BuildRequires: postgresql-devel
Requires: iproute2
Requires(pre): permissions
Requires(pre): %insserv_prereq
Requires(pre): %insserv_prereq
Requires(pre): %fillup_prereq
Provides: smtp_daemon
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -98,17 +108,17 @@ BuildRequires: fdupes
BuildRequires: systemd
%{?systemd_requires}
%else
Requires(pre): %insserv_prereq %fillup_prereq
Requires(pre): %{_bindir}/getent
Requires(pre): pwdutils
Requires(pre): /bin/awk
Requires(pre): /bin/grep
Requires(pre): /bin/sed
Requires(pre): fileutils
Requires(pre): netcfg
Requires(pre): pcre
Requires(pre): sh-utils
Requires(pre): textutils
Requires(pre): %insserv_prereq %fillup_prereq
Requires(pre): %{_bindir}/getent
Requires(pre): pwdutils
Requires(pre): /bin/awk
Requires(pre): /bin/grep
Requires(pre): /bin/sed
Requires(pre): fileutils
Requires(pre): netcfg
Requires(pre): pcre
Requires(pre): sh-utils
Requires(pre): textutils
%endif
%description
@ -152,6 +162,18 @@ 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.
%if %{with lmdb}
%package lmdb
Summary: Postfix plugin to support LMDB maps
Group: Productivity/Networking/Email/Servers
Requires(pre): %{name} = %{version}
%description lmdb
Postfix plugin to support LMDB maps. This library will be loaded
by starting %{name} if you'll access a postmap which is stored in
PostgreSQL.
%endif
%prep
%setup -q -a 2 -a 3
%patch1 -p1
@ -166,20 +188,55 @@ PostgreSQL.
# ---------------------------------------------------------------------------
%build
export CCARGS="-DHAS_PCRE -DUSE_SASL_AUTH -I/usr/include/sasl"
export CCARGS="-DHAS_LDAP -DHAS_PCRE -DUSE_SASL_AUTH -I%{_includedir}/sasl"
export CCARGS="$CCARGS -DHAS_MYSQL -I/usr/include/mysql"
export CCARGS="$CCARGS -DHAS_PGSQL -I/usr/include/pgsql"
export CCARGS="$CCARGS -DHAS_LDAP -I/usr/include/ldap"
export CCARGS="$CCARGS -DUSE_CYRUS_SASL"
export AUXLIBS="-lldap -llber -lpcre"
export AUXLIBS="$AUXLIBS -lsasl2"
export AUXLIBS="$AUXLIBS -lssl -lcrypto"
export AUXLIBS="$AUXLIBS -L/usr/local/lib -lldap -L/usr/local/lib -llber"
export CCARGS="$CCARGS -DUSE_TLS"
export CCARGS="$CCARGS %{optflags} -Wno-comments"
unset AUXLIBS AUXLIBS_LDAP AUXLIBS_PCRE AUXLIBS_MYSQL AUXLIBS_PGSQL AUXLIBS_SQLITE AUXLIBS_CDB
export CCARGS="${CCARGS} %{optflags} -Wno-comments -Wno-missing-braces -fPIC"
%ifarch s390 s390x ppc
export CCARGS="${CCARGS} -fsigned-char"
%endif
#
if pkg-config openssl ; then
export CCARGS="${CCARGS} -DUSE_TLS $(pkg-config --cflags openssl)"
export AUXLIBS="$AUXLIBS $(pkg-config --libs openssl)"
else
export CCARGS="${CCARGS} -DUSE_TLS"
export AUXLIBS="${AUXLIBS} -lssl -lcrypto"
fi
#
export CCARGS="${CCARGS} -DHAS_LDAP -DLDAP_DEPRECATED=1 -DUSE_LDAP_SASL"
export AUXLIBS_LDAP="-lldap -llber"
#
export CCARGS="${CCARGS} -DHAS_PCRE"
export AUXLIBS_PCRE="-lpcre"
#
export CCARGS="${CCARGS} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I%{_includedir}/sasl"
if pkg-config libsasl2 ; then
export AUXLIBS="$AUXLIBS $(pkg-config --libs libsasl2)"
else
export AUXLIBS="$AUXLIBS -lsasl2"
fi
#
export CCARGS="${CCARGS} -DHAS_MYSQL $(mysql_config --cflags)"
export AUXLIBS_MYSQL="$(mysql_config --libs)"
#
export CCARGS="${CCARGS} -DHAS_PGSQL -I$(pg_config --includedir)"
export AUXLIBS_PGSQL="-lpq"
#
%if %{with lmdb}
export CCARGS="${CCARGS} -DHAS_LMDB -I/usr/local/include" \
export AUXLIBS_LMDB="-llmdb"
%endif
#
# TODO
#export AUXLIBS_SQLITE
#export AUXLIBS_CDB
#export AUXLIBS_SDBM
export PIE=-pie
make makefiles pie=yes shared=yes dynamicmaps=yes shlib_directory=/usr/lib/postfix meta_directory=/usr/lib/postfix config_directory=/etc/postfix
make makefiles pie=yes shared=yes dynamicmaps=yes \
shlib_directory=/usr/lib/postfix \
meta_directory=/usr/lib/postfix \
config_directory=/etc/postfix
make
# ---------------------------------------------------------------------------
@ -375,9 +432,6 @@ if [ "$1" = "0" ]; then
else
echo "Can not find \"$FILE\". Not updating the file." >&2
fi
echo "Removing %{vmusr} user"
userdel %{vmusr} 2> /dev/null
groupdel %{vmusr} 2> /dev/null
fi
# ---------------------------------------------------------------------------
@ -597,4 +651,10 @@ fi
%defattr(-,root,root)
%{_libexecdir}/%{name}/postfix-pgsql.so
%if %{with lmdb}
%files lmdb
%defattr(-,root,root)
%{_libexecdir}/%{name}/postfix-lmdb.so
%endif
%changelog