diff options
author | Eray Aslan <eras@gentoo.org> | 2015-04-13 07:50:57 +0000 |
---|---|---|
committer | Eray Aslan <eras@gentoo.org> | 2015-04-13 07:50:57 +0000 |
commit | 6965b2082a8d6aee80bd450c5b6ae14077950bcf (patch) | |
tree | d7ac3a2d64bef5ddd07e68d9298ad63d5aa6b70f /mail-mta/postfix | |
parent | Version bump to latest release, drop older, remove py3.3 (diff) | |
download | historical-6965b2082a8d6aee80bd450c5b6ae14077950bcf.tar.gz historical-6965b2082a8d6aee80bd450c5b6ae14077950bcf.tar.bz2 historical-6965b2082a8d6aee80bd450c5b6ae14077950bcf.zip |
Version bump
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/ChangeLog | 10 | ||||
-rw-r--r-- | mail-mta/postfix/Manifest | 28 | ||||
-rw-r--r-- | mail-mta/postfix/postfix-2.10.7.ebuild | 315 | ||||
-rw-r--r-- | mail-mta/postfix/postfix-2.11.5.ebuild | 324 | ||||
-rw-r--r-- | mail-mta/postfix/postfix-3.0.1.ebuild | 312 |
5 files changed, 983 insertions, 6 deletions
diff --git a/mail-mta/postfix/ChangeLog b/mail-mta/postfix/ChangeLog index 307565fc45e8..5c9e935c4d3d 100644 --- a/mail-mta/postfix/ChangeLog +++ b/mail-mta/postfix/ChangeLog @@ -1,6 +1,14 @@ # 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.580 2015/04/09 20:52:17 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.581 2015/04/13 07:50:46 eras Exp $ + +*postfix-3.0.1 (13 Apr 2015) +*postfix-2.11.5 (13 Apr 2015) +*postfix-2.10.7 (13 Apr 2015) + + 13 Apr 2015; Eray Aslan <eras@gentoo.org> +postfix-2.10.7.ebuild, + +postfix-2.11.5.ebuild, +postfix-3.0.1.ebuild: + Version bump 09 Apr 2015; Markus Meier <maekke@gentoo.org> postfix-3.0.0.ebuild: arm stable, bug #544248 diff --git a/mail-mta/postfix/Manifest b/mail-mta/postfix/Manifest index b0ede36a78f1..ca691ff8a8c8 100644 --- a/mail-mta/postfix/Manifest +++ b/mail-mta/postfix/Manifest @@ -7,23 +7,41 @@ AUX postfix.service 267 SHA256 5d6aa3489e8d66a29d132d7170d1fd3b4c36374486c76764d AUX smtp.pass 141 SHA256 c9b3b56a8df2367cc15bc43a70304fac7ebdd7697e1d450d1bcb4bfdd3e078e9 SHA512 652b43be887109bf162647e9c0f08dc4283c9fa8795c11c14e88c60984e07593a4cff9e0e6c5dc92c484f547ae0be50a078599fc2fd67a66903b3ac7a8854b55 WHIRLPOOL f075d66d8ae7a13645066e572ab634721aada5aa828380afc5d45f26a6dd34165069bdc7b2edb89357330863f5aac40ee105bbef284392043589a2921381eb1f AUX smtp.sasl 147 SHA256 0ef6a2a7846498f56b9a8879f561a51c1e3a203ba90b2991d499afa69fd85629 SHA512 0beba4baecb4c4abdd3d2dd61e9e56d3abbc0035184992c98c57538b9244c6a07470974afe663775c3f3f10354e64457aa07e657dfd212e31a0920e3f04a6000 WHIRLPOOL 0c3eef040dd4486e007c31111b965725d3e9cf5a896881e0c927a715598dcc936dbf1034d6add2e6fb8ef4bd0114a7a49a8bba6f27b14aac30023457a1da12a3 DIST postfix-2.10.6.tar.gz 3830356 SHA256 d3d31ec52432e26972c00129cff2382f3f036e691d7c752e7974030789477c55 SHA512 5075485e71f386f11fb560180109b2e8ade60c583a3d79fb7e013cf1887acceb2904b583da85abbd1201e03e813eb5e7f5ee24546fb29191d77a07bf99f443c5 WHIRLPOOL 6e98b6dcaa353fcfb3fc69f8bebcfb67e8e6590d7a7c60f8737e4a80d8a84d9c4a781b1fa06983de35c6e718b3abda2decd09ed0d89388a3d089a3ba1e6cb69e +DIST postfix-2.10.7.tar.gz 3830200 SHA256 47e1deae652a5e8262f1540ec5f9d602760c50056cf653e0f160a7c328ecc2b7 SHA512 5800401ca002dfe1cea2b3a56750f302846c245cebecfec723834469181174de39db42a8c5eddbca59267ba090104c6919e3bc7ef105cbbe572787aa764a4acd WHIRLPOOL 2645b0f784cdea3adecc2c9868ccfbee680921603b76f8db4833dfde27f01ca2e5d8d0c092f1f849f4938bb07e36ffd13a31f977fa04205404a405dc94c55a94 DIST postfix-2.11.3.tar.gz 4039705 SHA256 04e5146e6e56261baae9f63c590348a4b12ce22d3d46260e26e97233f40802c3 SHA512 b371f1099b1e6e653242a9b4f3812b38b6a9145a4f4c1c9fa5bef6a02e1a9a8f4ec2979c8946f6c873e303ac54f5dd1a84b934eeea8169e2ce187028c36c857e WHIRLPOOL 7b639ae7a5d0bf16ec0c1568b6f1bb486ccf540ae75269d97be36135441513730d78449b29c99403c6876609ddcc676f5740683a963281f1b2481c33bd4cab8e DIST postfix-2.11.4.tar.gz 4040104 SHA256 f4154c1db58c0300897d4c430bd90714ac7855249df59cc8828910fd5ccb031e SHA512 b9c0f065519367fb52c58eeeaed62996da7244c362e5ff9fa9fe5263a06a5fb99a3e30cdf044de0165976581e0bfad89681974ad1b3abbeaedb691db2c20336b WHIRLPOOL 3075c8ff2be9a47c769738f00169a799fe8f2531f21a88efc83e0be386636d9ee5d5a6b205a313e359e5913abe47943fdf264fb08f40173c5ede38427dbb880d +DIST postfix-2.11.5.tar.gz 4036256 SHA256 0a4cc61f6d6c57eee676d4e78a42b2d29f8b0f406277d350bc0928f51efa3187 SHA512 9ad7ae79f8bc5c7c3631b11dec8e7086298607d1b8058a08d833bb8f590cc103305f7ff1e8fb6d9de8fb8eaf1be0a5e4481cb034a2594a55b7ece71c74d80931 WHIRLPOOL 59e0c56610fe4d1fc91d181ff6d5eeb21f015f5f72265318a6e9e0113311f1aec1f3ff41174a038fd4331f4eadc35ec68d3f5e9e9504d4db21a3d06766128535 DIST postfix-3.0.0.tar.gz 4239248 SHA256 c2f2f10aa3e6b7090ba979e9c515e42b3140c5c1c17a33d58787569df7ae0955 SHA512 ba5b67a8f03c6fe6bbb62e2aad981a6f3ba8266ea2fa93abfa5d31cdb20b2d5a47fc373f401b247ca2cb5a19e654f86b2a65fe906c102d729e472b6c5ff1cd7a WHIRLPOOL 1510a17f3376d77eb503b3adf47639f6466a38e20a06ebf7ae0ec6849dc2ea332377c82af816f298a2719bccc4917d14132ee9e11c14cbafa3ea53ec40056f50 +DIST postfix-3.0.1.tar.gz 4265677 SHA256 cd2bd6447fe3368bb1a39f482f8dd1eec87c63067a0eb75f9aec8e4eadd21328 SHA512 17916f6dc7113589b011dbf6a6bb54cb9f6d0d5f176fb3c877d4a5a09ac62c4faf088bf1eba0b41c6d2b9d55660fd4c52d4ba2a01f82db3679322756b6da6f37 WHIRLPOOL 3e0f28350a42428b7deae460d2312c90f84f82aaa7755207e1eba04ee7c3b276eaddbd8c8b705a38923ad29625a36aa06c80849ecc9201f4aa99e44811913790 DIST postfix-3.1-20150330.tar.gz 4265096 SHA256 4e76f9bf5653b9c100bd46c70384dc6044e8bf1e6a998233a4bb59b132e40693 SHA512 86c311be81f7bb01b634ce3e416707f1add3109450a200d5c3f511cc5c5307fd8f29b307a6bb4ce5be140c0ed2b22a6fcbeccef687d871b82688634799f194a0 WHIRLPOOL 7eeb84f1bf90a85a9a318437bdeb554b383364b81bfeaad060c64de4629f85c989dc1e9f5b738161000ecd0f6b57d6c5a26bba8529139c682ee650105668a09a DIST postfix-vda-v13-2.10.0.patch 55701 SHA256 6208021eb0b37ac6482e334e538ed5700cc22c4d4dd66ed9e975ae5f20bf935f SHA512 0b4b53a8cd28abf56eee3b2ed63ca1814251b60816e6ca1143249d25fd6ef7f905bec3134125ac6e851af685db8aae878012113693261529ae2ddbcf1bd93e62 WHIRLPOOL d98b7d2177b8b69738086880fd08c336fa60b99ff7413624e628fd5f17be2064f2ccaa37c047d3013ed41c0ff1bcb76e7962f8390c4179f28ab11733dd3b59d3 EBUILD postfix-2.10.6.ebuild 9610 SHA256 5d3abafb4d3ebb7ba90c7969aa4dd3a17de12be80d34443fc34d0c8c2265eb59 SHA512 c7f323dad93073d7ac06e166d4be9c81817fce5492e2c05cdb579de9674298ce8cb2817e898c24a602da3ece8999c92df88837ed54adac855fc6c8f90f62a3ed WHIRLPOOL c5a00f5464d80418cee4a719afd81d519194d3b9e3cf27acd5c59b062f5bb762a9c940fc752f88218d91401c2173a914fcf93fa38d8ac17936763ee9568dc9b0 +EBUILD postfix-2.10.7.ebuild 9610 SHA256 1ae49eddbdf663f5da02205abed0a68b346b5d15906bffd6c738963bb4a2a688 SHA512 b918728be53a41136882d24c19e26be985d23d05204ebd0e9f253fb5c2f04a2b8d92659cc7723b47cf13d3ed04668d3aa2f65a12368efbe134819b7d1717a805 WHIRLPOOL 31eacee0feaf4f5aef7b5d092bdb8d0542d59aca96090803a51167e0e54016f72f551cab13bf613e4a5096feed4b5fa064a3537c59e6dfd2b5e0f199cee18341 EBUILD postfix-2.11.3.ebuild 9787 SHA256 e77b8742bf2abbc331d1b2e1e34071a0b4c1b67044ab569544de40d6ab8d59f3 SHA512 bb0849deed6b2fc601db9b35de6b69660c581b12b0d98a6b43d61e192aeba42e686b59fd122e8598842c62ed0c31fb84028834a938a015e6077ad2a8cf3c28cd WHIRLPOOL 19661286ac70a5fdf8f68e42b5f75e18217823be70105625dcea68212acf14ef6e2ba7dc2f1052a5bff8db30c982138bab74701ab96615a437861145f06c0f1a 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 8939 SHA256 4f97ad847819ef5994bc25c7c7e42be64d2d67f4b1ca7d988a4080b381f287c6 SHA512 91d7926722e2c16e9cc3dc7f891dfda39bb0f917e8065aa9cf2ab8e5c216eb2bd06ac9d2d5f9185c2d92a861cd0f0d9fb0a52d98a48c0c44f4e36fe15b061489 WHIRLPOOL 7716052a8d4122c268e054084630e3512332bafc963be7eab173b887d0bdea7e4b79ce01844fe7ae3198b0f6ef8fd0e2ffacc71662dc02404de3fc40b8cf59a7 +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 15067 SHA256 e542d7729b23fbf8146a0c7366b15b233bd9fb649fd30ddff99d2aa684551990 SHA512 4ef376df0c74b9a537e5cdd839603529c62805fa312efcafbaaac830a631ee4532f75a301c0d8f3b94a4c6809edc74de0934da46a3da608c9608b525b6493ba5 WHIRLPOOL c8310a77f17ca103e1ff707a68ad4f7daa11d9f3dc461b9f600d870b25bdea7eb4eee66505fdef2466334efbf685203410658a87e5c12f988f6e9d3fe9ea5ed2 +MISC ChangeLog 15288 SHA256 105ec69f61c90c50c01ee68929f845d0f9b110c0cbc9906e275e02e26250f829 SHA512 0b751c50dde77d319c63694b12177c452ddcef5214df6b043abf172fd5be3fd17904e1d1499f92f2ba207d5a5b26840eab43d9c801b6fea37e43bd600260009b WHIRLPOOL b39f0e43e37d3e404af65a7a97b6f222dbd93de82f3ebf8e2211fdd35b6e659ed92e4bec1ba42d08b1d8327aaaa250e82750c705cd046be4bfa9af2968e1c885 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 +Version: GnuPG v2.0 -iEYEAREIAAYFAlUm5oIACgkQkKaRLQcq0GL0OgCeKHTvUOPJhrAwbsfMpvy3YO8o -oFwAn19vWQ0r7Q0XYDNaLRfucBRPf/B9 -=gzyT +iQJ8BAEBCABmBQJVK3WpXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBQjk1NkM0NUMxNzFCRTY4Rjk4NENDMDk3 +N0YxRjE3NTU4NkEzQjFGAAoJEHfx8XVYajsfmu4QAJx/36tMKH4CHkg3ZSDi3Pb3 +F+GHkdgzHFfRmHINq3Q/FH5pgxIptZmZKd2X6rO3Ct6DHvGKW3/vUeyzqzutdPD/ +ReRNes6Y/1t07L02HfWv1a540YzFVZ8MN0pZ6qshMCxhqnKq3OPtIkrTM2Gx2nWw +DwOMwd9w8tRykEmgkZyA+2WnOfiszn4YEeNkmxB1jKarnLZCWWAUvJh/Bi9S5tSD +D+ZThq+1IHPNPoaR8JsqzyuTiG8kBPA+sAvE4REXqj87rG+ed5j5hcXTBng9aXkh +t+NqiFr2EqwPktqcDCk5PWaGLt1yWxLDh7s8vo5GulusTpCybkfIMZIh2xnn0CbI +xpPFTq875DLdWrmoPlVEgf5mlJj9PzxFZVKJpGpy+6JgLX/1QvHX8Xeku/K5v6QY +p3vaZVkA2XeUUJW9MDoHL6JTlp/U5siepw+LBWF/bQ5x4xCfD5zK5WxiM5+m8hhY +pclC1zSCkxV8iQWKKtBzRandID6zqs+fdPiDENcnGQUB0a9Y+cXOr/uZJaHig1TN +yEqs807cWCAp6gONlXNbRbo8lOyNiJ65/uKde7QYCGTEVmnk63+dQIvma0l0Uxp4 +A1x7vtIMkRGH6dGu0VKDQqwbK494AocHB4pv3aw0k5467ySssThy2TOkm9k1MVBJ +P8bb30ICzKGWMZ4mqcW5 +=hG28 -----END PGP SIGNATURE----- diff --git a/mail-mta/postfix/postfix-2.10.7.ebuild b/mail-mta/postfix/postfix-2.10.7.ebuild new file mode 100644 index 000000000000..85706a6c51e5 --- /dev/null +++ b/mail-mta/postfix/postfix-2.10.7.ebuild @@ -0,0 +1,315 @@ +# 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-2.10.7.ebuild,v 1.1 2015/04/13 07:50:46 eras Exp $ + +EAPI=5 +inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam user versionator systemd + +MY_PV="${PV/_pre/-}" +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="~mips ~s390" +IUSE="+berkdb cdb doc dovecot-sasl hardened ldap ldap-bind 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 ) ) + ldap? ( net-nds/openldap ) + ldap-bind? ( net-nds/openldap[sasl] ) + 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 + selinux? ( sec-policy/selinux-postfix ) + !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" + +REQUIRED_USE="ldap-bind? ( ldap sasl )" + +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}-2.11.1-db6.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" +} + +src_configure() { + # Make sure LDFLAGS get passed down to the executables. + local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread" + + use pam && mylibs="${mylibs} -lpam" + + if use ldap; then + mycc="${mycc} -DHAS_LDAP" + mylibs="${mylibs} -lldap -llber" + fi + + if use mysql; then + mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)" + mylibs="${mylibs} $(mysql_config --libs)" + fi + + if use postgres; then + mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)" + mylibs="${mylibs} -lpq -L$(pg_config --libdir)" + fi + + if use sqlite; then + mycc="${mycc} -DHAS_SQLITE" + mylibs="${mylibs} -lsqlite3" + fi + + if use ssl; then + mycc="${mycc} -DUSE_TLS" + mylibs="${mylibs} -lssl -lcrypto" + 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 + sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \ + src/util/sys_defs.h || die "sed failed" + fi + + if ! use berkdb; then + mycc="${mycc} -DNO_DB" + if use cdb; then + # change default hash format from Berkeley DB to cdb + sed -i -e "s/hash/cdb/" src/util/sys_defs.h || die + fi + fi + + if use cdb; then + mycc="${mycc} -DHAS_CDB -I/usr/include/cdb" + CDB_LIBS="" + # Tinycdb is preferred. + if has_version dev-db/tinycdb ; then + einfo "Building with dev-db/tinycdb" + CDB_LIBS="-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 + CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}" + done + fi + mylibs="${mylibs} ${CDB_LIBS}" + 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 DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" makefiles +} + +src_install () { + local myconf + use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \ + html_directory=\"/usr/share/doc/${PF}/html\"" + + /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 + dobin auxiliary/qshape/qshape.pl + doman man/man1/qshape.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 + "${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} "${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} + + systemd_dounit "${FILESDIR}/${PN}.service" +} + +pkg_preinst() { + # Postfix 2.9. + # default for inet_protocols changed from ipv4 to all in postfix-2.9. + # check inet_protocols setting in main.cf and modify if necessary to prevent + # performance loss with useless DNS lookups and useless connection attempts. + [[ -d ${ROOT}/etc/postfix ]] && { + if [[ "$(${D}/usr/sbin/postconf -dh inet_protocols)" != "ipv4" ]]; then + if [[ ! -n "$(${D}/usr/sbin/postconf -c ${ROOT}/etc/postfix -n inet_protocols)" ]]; + then + ewarn "\nCOMPATIBILITY: adding inet_protocols=ipv4 to main.cf." + ewarn "That will keep the same behaviour as previous postfix versions." + ewarn "Specify inet_protocols explicitly if you want to enable IPv6.\n" + else + # delete inet_protocols setting. there is already one in /etc/postfix + sed -i -e /inet_protocols/d "${D}"/etc/postfix/main.cf || die + fi + fi + } +} + +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 + + if [[ $(get_version_component_range 2 ${REPLACING_VERSIONS}) -lt 9 ]]; then + elog "If you are using old style postfix instances by symlinking" + elog "startup scripts in ${ROOT}etc/init.d, please consider" + elog "upgrading your config for postmulti support. For more info:" + elog "http://www.postfix.org/MULTI_INSTANCE_README.html" + if ! use berkdb; then + ewarn "\nPostfix is installed without BerkeleyDB support." + ewarn "Please turn on berkdb USE flag if you need hash or" + ewarn "btree table lookups.\n" + fi + ewarn "Postfix daemons now live under /usr/libexec/postfix" + ewarn "Please adjust your main.cf accordingly by running" + ewarn "etc-update/dispatch-conf or similar and accepting the new" + ewarn "daemon_directory setting." + fi +} diff --git a/mail-mta/postfix/postfix-2.11.5.ebuild b/mail-mta/postfix/postfix-2.11.5.ebuild new file mode 100644 index 000000000000..ea056c5a56e2 --- /dev/null +++ b/mail-mta/postfix/postfix-2.11.5.ebuild @@ -0,0 +1,324 @@ +# 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-2.11.5.ebuild,v 1.1 2015/04/13 07:50:46 eras Exp $ + +EAPI=5 +inherit eutils flag-o-matic multilib pam ssl-cert systemd toolchain-funcs user versionator + +MY_PV="${PV/_pre/-}" +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 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 ) ) + 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 )" + +REQUIRED_USE="ldap-bind? ( ldap sasl )" + +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}-2.11.1-db6.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() { + # Make sure LDFLAGS get passed down to the executables. + local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread" + + use pam && mylibs="${mylibs} -lpam" + + if use ldap; then + mycc="${mycc} -DHAS_LDAP" + mylibs="${mylibs} -lldap -llber" + fi + + if use mysql; then + mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)" + mylibs="${mylibs} $(mysql_config --libs)" + fi + + if use postgres; then + mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)" + mylibs="${mylibs} -lpq -L$(pg_config --libdir)" + fi + + if use sqlite; then + mycc="${mycc} -DHAS_SQLITE" + mylibs="${mylibs} -lsqlite3" + fi + + if use ssl; then + mycc="${mycc} -DUSE_TLS" + mylibs="${mylibs} -lssl -lcrypto" + fi + + if use lmdb; then + mycc="${mycc} -DHAS_LMDB" + mylibs="${mylibs} -llmdb" + 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" + CDB_LIBS="" + # Tinycdb is preferred. + if has_version dev-db/tinycdb ; then + einfo "Building with dev-db/tinycdb" + CDB_LIBS="-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 + CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}" + done + fi + mylibs="${mylibs} ${CDB_LIBS}" + 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 DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" makefiles +} + +src_install () { + local myconf + use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \ + html_directory=\"/usr/share/doc/${PF}/html\"" + + /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 + "${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} "${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} + + systemd_dounit "${FILESDIR}/${PN}.service" +} + +pkg_preinst() { + # Postfix 2.9. + # default for inet_protocols changed from ipv4 to all in postfix-2.9. + # check inet_protocols setting in main.cf and modify if necessary to prevent + # performance loss with useless DNS lookups and useless connection attempts. + [[ -d ${ROOT}/etc/postfix ]] && { + if [[ "$(${D}/usr/sbin/postconf -dh inet_protocols)" != "ipv4" ]]; then + if [[ ! -n "$(${D}/usr/sbin/postconf -c ${ROOT}/etc/postfix -n inet_protocols)" ]]; + then + ewarn "\nCOMPATIBILITY: adding inet_protocols=ipv4 to main.cf." + ewarn "That will keep the same behaviour as previous postfix versions." + ewarn "Specify inet_protocols explicitly if you want to enable IPv6.\n" + else + # delete inet_protocols setting. there is already one in /etc/postfix + sed -i -e /inet_protocols/d "${D}"/etc/postfix/main.cf || die + fi + fi + } +} + +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 + + if [[ $(get_version_component_range 2 ${REPLACING_VERSIONS}) -lt 9 ]]; then + elog "If you are using old style postfix instances by symlinking" + elog "startup scripts in ${ROOT}etc/init.d, please consider" + elog "upgrading your config for postmulti support. For more info:" + elog "http://www.postfix.org/MULTI_INSTANCE_README.html" + if ! use berkdb; then + ewarn "\nPostfix is installed without BerkeleyDB support." + ewarn "Please turn on berkdb USE flag if you need hash or" + ewarn "btree table lookups.\n" + fi + ewarn "Postfix daemons now live under /usr/libexec/postfix" + ewarn "Please adjust your main.cf accordingly by running" + ewarn "etc-update/dispatch-conf or similar and accepting the new" + ewarn "daemon_directory setting." + fi +} diff --git a/mail-mta/postfix/postfix-3.0.1.ebuild b/mail-mta/postfix/postfix-3.0.1.ebuild new file mode 100644 index 000000000000..b8f207fbd47b --- /dev/null +++ b/mail-mta/postfix/postfix-3.0.1.ebuild @@ -0,0 +1,312 @@ +# 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.ebuild,v 1.1 2015/04/13 07:50:46 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() { + 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 +} |