summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEray Aslan <eras@gentoo.org>2015-04-17 05:46:06 +0000
committerEray Aslan <eras@gentoo.org>2015-04-17 05:46:06 +0000
commitd14833baa596e5074ccc427c015165dc2896eb04 (patch)
tree7d98dc371a7f369a843806d4f5ceb7aeb7d59ef2 /mail-mta/postfix
parentVersion bump. (diff)
downloadhistorical-d14833baa596e5074ccc427c015165dc2896eb04.tar.gz
historical-d14833baa596e5074ccc427c015165dc2896eb04.tar.bz2
historical-d14833baa596e5074ccc427c015165dc2896eb04.zip
Fix building with linux-4 - bug #544610
Package-Manager: portage-2.2.18/cvs/Linux x86_64 Manifest-Sign-Key: 0x77F1F175586A3B1F
Diffstat (limited to 'mail-mta/postfix')
-rw-r--r--mail-mta/postfix/ChangeLog8
-rw-r--r--mail-mta/postfix/Manifest24
-rw-r--r--mail-mta/postfix/files/postfix-linux4.patch27
-rw-r--r--mail-mta/postfix/postfix-3.0.1-r1.ebuild313
4 files changed, 350 insertions, 22 deletions
diff --git a/mail-mta/postfix/ChangeLog b/mail-mta/postfix/ChangeLog
index ef67028b3420..254bc4b719c6 100644
--- a/mail-mta/postfix/ChangeLog
+++ b/mail-mta/postfix/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for mail-mta/postfix
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.583 2015/04/14 10:58:09 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.584 2015/04/17 05:45:52 eras Exp $
+
+*postfix-3.0.1-r1 (17 Apr 2015)
+
+ 17 Apr 2015; Eray Aslan <eras@gentoo.org> +files/postfix-linux4.patch,
+ +postfix-3.0.1-r1.ebuild:
+ Fix building with linux-4 - bug #544610
14 Apr 2015; Agostino Sarubbo <ago@gentoo.org> postfix-3.0.0.ebuild:
Stable for ia64, wrt bug #544248
diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest
index 26088c10c1a9..2ab91770bc69 100644
--- a/mail-mta/postfix/Manifest
+++ b/mail-mta/postfix/Manifest
@@ -1,7 +1,5 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
AUX postfix-2.11.1-db6.patch 699 SHA256 90356024954a624306f2f5c8859e6a2a69965f83ca5e0d3d1005c9205bf41181 SHA512 9a6f00ae2d31b732be929ce647c222871704db02c09af659e260cf1a995bbde7f2045c59b9c33520070f427d4a2b377f6193bf6f9971087bf8df7f0c95d6d824 WHIRLPOOL 025a95e18942daf7d8a84a6ab9d17f14800aa34fc29bb5a8694f6667d1215553fe33375ef7e831937362b4b5129f6957ef3d8fd781508b554bfe841971524e15
+AUX postfix-linux4.patch 698 SHA256 b01c7129b3c14eee1590146496b52760f60793c83e50ed189ecfaca8a4a2e4f5 SHA512 3f99e1ba56a55d2630ae0347a4baa5ea699780c675fce7ece9e251ae55a078fbd8101cb49e1f610d48a4bed807a3e60bada9f6d30ba0dbad6afe3d7d4744707b WHIRLPOOL 40adee08dd76b337dd3c5e56f15bdc5edffdcd6c253718502af54fbf6b4277a4452e9c2f49e5ce3c4a9f13b14c33cbcc6197a61331b3fbdf07604957f8e64498
AUX postfix.rc6.2.7 2217 SHA256 51f4bffa535d891f94d4a20ca2a4a42cc99189f3de78cee1c8d235e4a9d1721d SHA512 a675a4e0a6a550caa97588d5167b4d26fe7e47f03aadbfb3576c45eaa17059ce6912a583c96ae317138040b043dd9f7c34059cd1fd86c37f8586399c5edbd000 WHIRLPOOL a719ba7be97c5eb9a8203cef7276e6ee55965cd2ea33d809d0ca94b05254b32dfbafaa3e6e2e9ea804605c4badc7e7d547aa919ece063a43181c07bac51c23da
AUX postfix.service 267 SHA256 5d6aa3489e8d66a29d132d7170d1fd3b4c36374486c76764df8efc42457739ee SHA512 83def57dd70caca1c07d8493289573342c341c2fe2b376f68df3647be7a3bace9fa57ad07e3b52fc0ca56ea4c7cdfb094e74775c335d18ddd5fdc4632f721915 WHIRLPOOL f1faf22f0c0b8c33f9ae327a81792508e53101eca8c7d7db985d8898f10e985118f2231c09c444e907580061a4adee1de1788f74b7af3ffaafca22c07dee474b
AUX smtp.pass 141 SHA256 c9b3b56a8df2367cc15bc43a70304fac7ebdd7697e1d450d1bcb4bfdd3e078e9 SHA512 652b43be887109bf162647e9c0f08dc4283c9fa8795c11c14e88c60984e07593a4cff9e0e6c5dc92c484f547ae0be50a078599fc2fd67a66903b3ac7a8854b55 WHIRLPOOL f075d66d8ae7a13645066e572ab634721aada5aa828380afc5d45f26a6dd34165069bdc7b2edb89357330863f5aac40ee105bbef284392043589a2921381eb1f
@@ -21,25 +19,9 @@ EBUILD postfix-2.11.3.ebuild 9787 SHA256 e77b8742bf2abbc331d1b2e1e34071a0b4c1b67
EBUILD postfix-2.11.4.ebuild 9795 SHA256 163629654e4aca99b4118b6b3ec046d1d56e7b807fefcd3974477c7ac1eec5f0 SHA512 8b57ce3759092e17d078697d86b0b7afce1557fa484f4dffc7ac437fda0e68715b5c0d24f68d62555ecedde3c538c07b48f67b14cbaf51b2216068e3479e6077 WHIRLPOOL 500b0422ee1bb3029b5f5cf6e396918d9133d1097acb538017747e06e2947e30e90fd07ae2a37531a1471abbbd21c4028440e6858d9d8fed2e3c0ab5cd121ac7
EBUILD postfix-2.11.5.ebuild 9795 SHA256 0a889b186b67bdea46395bc062160876d68da1acf38a593bbff776bf38723cbb SHA512 b764a6052ceee68fa8a2e41bb471d2452c80d24a5e69a964844668097e7327ba40882095243db9267acf49469cda35dd6b8737249d6d8a991e9614d2393e65a9 WHIRLPOOL 63face778a830a182c93c276173988bd6023b70f034f7c099d1f93dfbf9c3bab20ee19adb44ca19a8546f4fedbeb43cc4009f4c92c125fb792d07813ea19c7a7
EBUILD postfix-3.0.0.ebuild 8935 SHA256 863bd1c43a36733c5affef2beaa88ceced5d68f38040cd1a55f2888b8629a030 SHA512 c66178cf1ecaad992f862e5a652ec843ff73ffa4f88f90bbc1c6f6708e7f179eebfeec99d20a190c2e73fe522bab699d33fb3fadbe66a458dd893ce77e82a6a0 WHIRLPOOL c3ef523f007fadfc049557ad7c17700e55ebc513d64c97980b4e22bf58b13eb4af5b505e09bd3c4b8cc331888b42788870b4af2cc224627b2c96f660e2959bd0
+EBUILD postfix-3.0.1-r1.ebuild 8988 SHA256 0b2dfcefab52c6b5d0422dbcd7633ad69df64ca1de44679c442fd0a923686d76 SHA512 8fee68ead359b26ffdcd85d2b6ee8cf97a58eec4b668580a77f4b0beffeb37846fac85e63292cede1ed46b8c6b69c8d5b8119c5f29e80acad2a63871d9ca731c WHIRLPOOL 5376daddb930de1412758030da342c606d3377c5706b806854f9d28a4c2510fcfebde0101ab21497d4b7e28e500d7a3acf6bbdb0bd6ddc1cf32763905529fb56
EBUILD postfix-3.0.1.ebuild 8944 SHA256 1f96e2f03a2d64d3f6b5429966b64db03db50b0496988496b9e53786f0e5620a SHA512 e5bcef38ece746cb6000d6e0b54014791a70395212afa182068036be44c8d887e49cf7dabf2d1077bae99aa8300291d8654c3030d10182f8628744835338555a WHIRLPOOL 6519293ca30f9a93140a4183f58108fb6f3e4d9560882dc32d9970a7aa741f62f11dbad33e9562c8fabf9d1bc34b981f8363baec9a32e057d5e183618e0ae0ca
EBUILD postfix-3.1_pre20150330.ebuild 8952 SHA256 19174f6cb262ad37b2a9aef50f3d078c3365b3a4ba07adb74a638e6588b6d24b SHA512 165cf22bcc23558bf24cc93ae3eeba942a22b4dea1b689dddd8960fd5bc8b2103f2527ba448fac51bf913346d11fe2433fa236011b2cd3a95a660d293dff295e WHIRLPOOL cf88d7476f22faa85e81616412614daed9b568221e6785e635ee71caf2d34ac77d260d12e60354fc0677cfdd2e3b8778901aef5980d6decdda4ca89d2daecd8d
-MISC ChangeLog 15502 SHA256 aa537ea9897696b9fa55cc7b8f97d1ca269f44b109de14c8d52d772c583065d6 SHA512 0d14b1c67e02758c14f58086164f31cd2df1ddfb9d930c42fe561e3465c5e21f6815b9a3b7f522ac20c76e8345cd3345072d547df270723e86866ae878c8006d WHIRLPOOL aaab168113bd6ae2d05ee91702fe315ebee1bf4a311b2b59f7d3f8e1bf7cf0d3ddb1d788ce7693fe7b3073234135962455254b90fd35fd80e1810152f51efc59
+MISC ChangeLog 15680 SHA256 ded1e823612e2bb2f8cc09352526c84394ed95605ffba72e777f570646429c49 SHA512 c8ae37aaddf140599023f42c2aa1a078f373361162d55d04fe02a512cc499adca064d874f90a37010638c2c71839fcbd8ea7a7b36d93bc2e9be2b70cdc2f5809 WHIRLPOOL 1b57e88ce765ceb213c50bbb91b916fa99d232fedf2ef1b227ec7b3fd56880edbf0c6ca4f2504e234564d5b556eac032df662fa620d7093a11007ead0edff9b1
MISC ChangeLog-2013 100301 SHA256 439e93c3f6ea08471888157d2347da51181aa9031d4bfdeef2197a6b26680246 SHA512 c678433163e86def50d59e47d7a1a0e8f4c4af860f80932255a7c95544e1f5b55a70b68905b02a417b2332bcf3aaa59281814d8504d70085f0874a23faa2bf02 WHIRLPOOL 15a12897a576cf98d856c551157b72b47aa45fd61d05c6ed55033ce37ce247045c6bcc8143b7ccce4666900d85e0a04087c977a311e31c20f554a991bec74fbc
MISC metadata.xml 754 SHA256 52b30e7748a792a156ad44b46878b67cb1a359c882e03f76b1d7b3b0bf111129 SHA512 bef165b527524efdcabce97c2fc0735f784dfc014ae810294e6a19b534edc6a01e14e532d730c8b8c2b76c99dafac672074317ec6dc23942285ad27895fd7220 WHIRLPOOL 702d14bd15db16217c664a39534bd1b19774d5f6c5a4a2a43e6595f400c06332c56849fd0d722c7982f5c40398b4bb0b3398b96c6f370a57d99d323d0e84ab51
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
-
-iQIcBAEBCAAGBQJVLPLBAAoJELp701BxlEWfJlIQAMCA+E4nShaRvmirG7/0TWYX
-+w/uCI7J8Nkwrc8xDKjuprKAzrB2Q4Q82r1LIU55ek+JOpsS3WuECHLeBx9qfMEm
-Q0HKBMYUBqBRfmtzHo0fkBXqQy3gb++EL+gOhblrdswc80gmwtFL0imj8gWJQK4c
-5zgVyOyN0u9GHAogMU1rXXVFooKqSxrWaHRjuygjd2LVQZiJcCdEVJ4xFkKLt2Sc
-+Laa3ufR9NSS+ETAnP2R7sC2zxBILxZlxKJtNuVMh0doyTdwznDLTQ9X1OOpsZmX
-HqqKRY1hb/mY4sQerBiE/++VN8HXSlB/nQ7holpiD6Q2LyA/R0Tix6qAtR3SnYDC
-HBQ2D7t2QOFV/9EV/v6jcJX1HaKgMP1xkj6HoQrkJ923TSsHMyOcblqRBzKgsK5u
-UoanNsPuHhNSTMVl1hkqDvt5AHtXsiWOE9eOQJUXgjS65qUSneiDPHBUX8cbBDoK
-Vo++1uvaBzsbPC1EitX3W97oTpasHqmIDisJnBLcxK7tNz9DP5PFCsZLVEecZdgm
-EJIgCsUvaZfuXnJNdBWoYGwMkz+zzq3uZD/hGb+vp8YLvtOsqqwf8aTrKY9wQY14
-lQnRvZoMQ1nIuelKw92wuV9JzG2ThtYE+t4KuETv7bSVYef2ln6Nls8M+zN0OX0o
-+4kzvLkwc6uaBva9ur41
-=4GpU
------END PGP SIGNATURE-----
diff --git a/mail-mta/postfix/files/postfix-linux4.patch b/mail-mta/postfix/files/postfix-linux4.patch
new file mode 100644
index 000000000000..a28ad52627b1
--- /dev/null
+++ b/mail-mta/postfix/files/postfix-linux4.patch
@@ -0,0 +1,27 @@
+--- a/makedefs
++++ b/makedefs
+@@ -500,7 +500,12 @@ EOF
+ : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
+ : ${PLUGIN_LD="${CC-gcc} -shared"}
+ ;;
+- Linux.3*) SYSTYPE=LINUX3
++ Linux.[34]*)
++ case "$RELEASE" in
++ 3.*) SYSTYPE=LINUX3;;
++ 4.*) SYSTYPE=LINUX4;;
++ *) error "Unknown Linux version: `uname -r`.";;
++ esac
+ case "$CCARGS" in
+ *-DNO_DB*) ;;
+ *-DHAS_DB*) ;;
+--- a/src/util/sys_defs.h
++++ b/src/util/sys_defs.h
+@@ -756,7 +756,7 @@ extern int initgroups(const char *, int);
+ /*
+ * LINUX.
+ */
+-#if defined(LINUX2) || defined(LINUX3)
++#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4)
+ #define SUPPORTED
+ #include <sys/types.h>
+ #define UINT32_TYPE unsigned int
diff --git a/mail-mta/postfix/postfix-3.0.1-r1.ebuild b/mail-mta/postfix/postfix-3.0.1-r1.ebuild
new file mode 100644
index 000000000000..99b37d380903
--- /dev/null
+++ b/mail-mta/postfix/postfix-3.0.1-r1.ebuild
@@ -0,0 +1,313 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-3.0.1-r1.ebuild,v 1.1 2015/04/17 05:45:52 eras Exp $
+
+EAPI=5
+inherit eutils flag-o-matic multilib pam ssl-cert systemd toolchain-funcs user versionator
+
+MY_PV="${PV/_rc/-RC}"
+MY_SRC="${PN}-${MY_PV}"
+MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
+VDA_PV="2.10.0"
+VDA_P="${PN}-vda-v13-${VDA_PV}"
+RC_VER="2.7"
+
+DESCRIPTION="A fast and secure drop-in replacement for sendmail"
+HOMEPAGE="http://www.postfix.org/"
+SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
+ vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
+
+LICENSE="IBM"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="+berkdb cdb doc dovecot-sasl +eai hardened ldap ldap-bind lmdb memcached mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
+
+DEPEND=">=dev-libs/libpcre-3.4
+ dev-lang/perl
+ berkdb? ( >=sys-libs/db-3.2:* )
+ cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
+ eai? ( dev-libs/icu )
+ ldap? ( net-nds/openldap )
+ ldap-bind? ( net-nds/openldap[sasl] )
+ lmdb? ( >=dev-db/lmdb-0.9.11 )
+ mysql? ( virtual/mysql )
+ pam? ( virtual/pam )
+ postgres? ( dev-db/postgresql:* )
+ sasl? ( >=dev-libs/cyrus-sasl-2 )
+ sqlite? ( dev-db/sqlite:3 )
+ ssl? ( >=dev-libs/openssl-0.9.6g:* )"
+
+RDEPEND="${DEPEND}
+ dovecot-sasl? ( net-mail/dovecot )
+ memcached? ( net-misc/memcached )
+ net-mail/mailbase
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/exim
+ !mail-mta/mini-qmail
+ !mail-mta/msmtp[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/fastforward
+ selinux? ( sec-policy/selinux-postfix )"
+
+# No vda support for postfix-3.0
+REQUIRED_USE="ldap-bind? ( ldap sasl )
+ !vda"
+
+S="${WORKDIR}/${MY_SRC}"
+
+pkg_setup() {
+ # Add postfix, postdrop user/group (bug #77565)
+ enewgroup postfix 207
+ enewgroup postdrop 208
+ enewuser postfix 207 -1 /var/spool/postfix postfix,mail
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-linux4.patch"
+ if use vda; then
+ epatch "${DISTDIR}"/${VDA_P}.patch
+ fi
+
+ sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
+ src/util/sys_defs.h || die "sed failed"
+
+ # change default paths to better comply with portage standard paths
+ sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
+
+ epatch_user
+}
+
+src_configure() {
+ for name in CDB LDAP LMDB MYSQL PCRE PGSQL SDBM SQLITE
+ do
+ local AUXLIBS_${name}=""
+ done
+
+ # Make sure LDFLAGS get passed down to the executables.
+ local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -ldl"
+ AUXLIBS_PCRE="$(pcre-config --libs)"
+
+ use pam && mylibs="${mylibs} -lpam"
+
+ if use ldap; then
+ mycc="${mycc} -DHAS_LDAP"
+ AUXLIBS_LDAP="-lldap -llber"
+ fi
+
+ if use mysql; then
+ mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
+ AUXLIBS_MYSQL="$(mysql_config --libs)"
+ fi
+
+ if use postgres; then
+ mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
+ AUXLIBS_PGSQL="-L$(pg_config --libdir) -lpq"
+ fi
+
+ if use sqlite; then
+ mycc="${mycc} -DHAS_SQLITE"
+ AUXLIBS_SQLITE="-lsqlite3 -lpthread"
+ fi
+
+ if use ssl; then
+ mycc="${mycc} -DUSE_TLS"
+ mylibs="${mylibs} -lssl -lcrypto"
+ fi
+
+ if use lmdb; then
+ mycc="${mycc} -DHAS_LMDB"
+ AUXLIBS_LMDB="-llmdb -lpthread"
+ fi
+
+ if ! use eai; then
+ mycc="${mycc} -DNO_EAI"
+ fi
+
+ # broken. and "in other words, not supported" by upstream.
+ # Use inet_protocols setting in main.cf
+ #if ! use ipv6; then
+ # mycc="${mycc} -DNO_IPV6"
+ #fi
+
+ if use sasl; then
+ if use dovecot-sasl; then
+ # Set dovecot as default.
+ mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
+ fi
+ if use ldap-bind; then
+ mycc="${mycc} -DUSE_LDAP_SASL"
+ fi
+ mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
+ mylibs="${mylibs} -lsasl2"
+ elif use dovecot-sasl; then
+ mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
+ fi
+
+ if ! use nis; then
+ mycc="${mycc} -DNO_NIS"
+ fi
+
+ if ! use berkdb; then
+ mycc="${mycc} -DNO_DB"
+ if use cdb; then
+ # change default hash format from Berkeley DB to cdb
+ mycc="${mycc} -DDEF_DB_TYPE=\\\"cdb\\\""
+ fi
+ fi
+
+ if use cdb; then
+ mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
+ # Tinycdb is preferred.
+ if has_version dev-db/tinycdb ; then
+ einfo "Building with dev-db/tinycdb"
+ AUXLIBS_CDB="-lcdb"
+ else
+ einfo "Building with dev-db/cdb"
+ CDB_PATH="/usr/$(get_libdir)"
+ for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
+ AUXLIBS_CDB="${AUXLIBS_CDB} ${CDB_PATH}/${i}"
+ done
+ fi
+ fi
+
+ # Robin H. Johnson <robbat2@gentoo.org> 17/Nov/2006
+ # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
+ mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
+ filter-lfs-flags
+
+ # Workaround for bug #76512
+ if use hardened; then
+ [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
+ fi
+
+ # Remove annoying C++ comment style warnings - bug #378099
+ append-flags -Wno-comment
+
+ sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
+ sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
+
+ emake makefiles shared=yes dynamicmaps=no \
+ shlib_directory="/usr/$(get_libdir)/postfix/MAIL_VERSION" \
+ DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
+ AUXLIBS_CDB="${AUXLIBS_CDB}" AUXLIBS_LDAP="${AUXLIBS_LDAP}" \
+ AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" \
+ AUXLIBS_PCRE="${AUXLIBS_PCRE}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
+ AUXLIBS_SQLITE="${AUXLIBS_SQLITE}"
+}
+
+src_install () {
+ local myconf
+ use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
+ html_directory=\"/usr/share/doc/${PF}/html\""
+
+ LD_LIBRARY_PATH="${S}/lib" \
+ /bin/sh postfix-install \
+ -non-interactive \
+ install_root="${D}" \
+ config_directory="/etc/postfix" \
+ manpage_directory="/usr/share/man" \
+ command_directory="/usr/sbin" \
+ mailq_path="/usr/bin/mailq" \
+ newaliases_path="/usr/bin/newaliases" \
+ sendmail_path="/usr/sbin/sendmail" \
+ ${myconf} \
+ || die "postfix-install failed"
+
+ # Fix spool removal on upgrade
+ rm -Rf "${D}"/var
+ keepdir /var/spool/postfix
+
+ # Install rmail for UUCP, closes bug #19127
+ dobin auxiliary/rmail/rmail
+
+ # Provide another link for legacy FSH
+ dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
+
+ # Install qshape tool and posttls-finger
+ dobin auxiliary/qshape/qshape.pl
+ doman man/man1/qshape.1
+ dobin bin/posttls-finger
+ doman man/man1/posttls-finger.1
+
+ # Performance tuning tools and their manuals
+ dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
+ doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
+
+ # Set proper permissions on required files/directories
+ dodir /var/lib/postfix
+ keepdir /var/lib/postfix
+ fowners -R postfix:postfix /var/lib/postfix
+ fperms 0750 /var/lib/postfix
+ fowners root:postdrop /usr/sbin/post{drop,queue}
+ fperms 02711 /usr/sbin/post{drop,queue}
+
+ keepdir /etc/postfix
+ if use mbox; then
+ mypostconf="mail_spool_directory=/var/spool/mail"
+ else
+ mypostconf="home_mailbox=.maildir/"
+ fi
+ LD_LIBRARY_PATH="${S}/lib" \
+ "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
+ -e ${mypostconf} || die "postconf failed"
+
+ insinto /etc/postfix
+ newins "${FILESDIR}"/smtp.pass saslpass
+ fperms 600 /etc/postfix/saslpass
+
+ newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
+ # do not start mysql/postgres unnecessarily - bug #359913
+ use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
+ use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
+
+ dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
+ mv "${D}"/etc/postfix/{*.default,makedefs.out,*.proto} "${D}"/usr/share/doc/${PF}/
+ use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
+
+ pamd_mimic_system smtp auth account
+
+ if use sasl; then
+ insinto /etc/sasl2
+ newins "${FILESDIR}"/smtp.sasl smtpd.conf
+ fi
+
+ # header files
+ insinto /usr/include/postfix
+ doins include/*.h
+
+ # Remove unnecessary files
+ rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
+ rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
+
+ if has_version mail-mta/postfix; then
+ # let the sysadmin decide when to change the compatibility_level
+ sed -i -e /^compatibility_level/"s/^/#/" "${D}"/etc/postfix/main.cf || die
+ fi
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+}
+
+pkg_postinst() {
+ # Do not install server.{key,pem) SSL certificates if they already exist
+ if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
+ && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
+ SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
+ install_cert /etc/ssl/postfix/server
+ chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
+ fi
+
+ if [[ ! -e /etc/mail/aliases.db ]] ; then
+ ewarn
+ ewarn "You must edit /etc/mail/aliases to suit your needs"
+ ewarn "and then run /usr/bin/newaliases. Postfix will not"
+ ewarn "work correctly without it."
+ ewarn
+ fi
+}