[arch-commits] Commit in postfix/trunk (PKGBUILD postfix.install)

David Runge dvzrv at archlinux.org
Fri Jan 22 19:55:27 UTC 2021


    Date: Friday, January 22, 2021 @ 19:55:27
  Author: dvzrv
Revision: 406621

upgpkg: postfix 3.5.9-1: Upgrade to 3.5.9.

Introduce split packages postfix-{cdb,ldap,lmdb,mysql,pcre,pgsql,sqlite},
which allows for a slimmer installation, while not pulling in
all available database backends, if they are not required.
Add upstream PGP key 622C7C012254C186677469C50C0B590E80CA15A7 to
validpgpkeys (Wietse Venema <wietse at porcupine.org>).
Add HAS_LMDB to CFLAGS to actually build the lmdb feature.
Add split packages to postfix' optdepends.
Add .install file for postfix notifying the users about the change in
packaging.
Remove obsolete postfix-tools from conflicts/provides/replaces.
Remove unreproducible makedefs file also from postfix-files.
Introduce drop-in files for dynamicmaps.cf and postfix-files for
each of the split packages.

Added:
  postfix/trunk/postfix.install
Modified:
  postfix/trunk/PKGBUILD

-----------------+
 PKGBUILD        |  167 +++++++++++++++++++++++++++++++++++++++++++++++-------
 postfix.install |    8 ++
 2 files changed, 154 insertions(+), 21 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-01-22 18:22:32 UTC (rev 406620)
+++ PKGBUILD	2021-01-22 19:55:27 UTC (rev 406621)
@@ -3,42 +3,46 @@
 # Contributor: Jeff Brodnax <tullyarcher at bellsouth.net>
 # Contributor: Paul Mattal <paul at archlinux.org>
 
-pkgname=postfix
-pkgver=3.5.8
-pkgrel=4
+pkgbase=postfix
+pkgname=('postfix' 'postfix-cdb' 'postfix-ldap' 'postfix-lmdb' 'postfix-mysql'
+'postfix-pcre' 'postfix-pgsql' 'postfix-sqlite')
+pkgver=3.5.9
+pkgrel=1
 url="http://www.postfix.org/"
 pkgdesc='Fast, easy to administer, secure mail server'
 license=('EPL')
 arch=('x86_64')
-depends=('db' 'glibc' 'libldap' 'libnsl' 'libsasl' 'openssl' 'pcre'
-'postgresql-libs' 'sqlite' 'tinycdb' 'zlib')
-makedepends=('icu' 'mariadb-libs')
-optdepends=('perl: for postfix-collate.pl and qshape')
-conflicts=('smtp-server' 'smtp-forwarder' 'postfix-tools')
-provides=('smtp-server' 'smtp-forwarder' 'postfix-tools')
-replaces=('postfix-tools')
-backup=('etc/postfix/'{access,aliases,canonical,generic,header_checks,main.cf,master.cf,relocated,transport,virtual})
-source=("http://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${pkgver}.tar.gz"
+depends=('glibc')
+makedepends=('db' 'icu' 'libldap' 'libnsl' 'libsasl' 'lmdb' 'mariadb-libs'
+'openssl' 'pcre' 'postgresql-libs' 'sqlite' 'tinycdb' 'zlib')
+source=("https://de.postfix.org/ftpmirror/official/${pkgname}-${pkgver}.tar.gz"
+        "${pkgname}-${pkgver}.tar.gz.sig::https://de.postfix.org/ftpmirror/official/${pkgname}-${pkgver}.tar.gz.gpg2"
         "${pkgname}-3.5.8-main_defaults.patch"
         "${pkgname}.service"
         "${pkgname}.sysusers"
         "${pkgname}.tmpfiles"
 )
-sha512sums=('0abb07d99e343b76e6a26b4a090af9d592f4dfd03c8c737cc72bfb0f4267dafcbb0cb0aa7b6255f8b834c9289d89a5c47b167be3758239309937cb77e0d9464b'
+sha512sums=('9ff3a33cdd5811e470d5c6cfa896fa76e4d3257b139deec5f420d18e34232f327b7c8496c5d13566c6f9ae1fdf8719feb9981372b2869b0208a2eb3a1daaeadd'
+            'SKIP'
             '7b2785aa8120ca3ff91b405baf675e9e11f8d58b18a9b842672e7ae30932febddac10556a70823d8746fcb160bceb4dbabdee45cf46b02fc0127057656fb85c4'
             '27f54747ad480d65b560c9dbc97e12c6353e4bceca0ffe3e358e31de56db0ad79928164c9f8790c73a9f791daa378253d2ee29b5a766661778553ec889b2cf97'
             'a7f15970f613ae7b98ce1b84ca0a6034ce3cc7b2b9ce7160dad9731f740fb762f4a54f44acceb5f06f8744fa9e952b088086af8a69da388a600b742a3cda37f2'
             'd08574a6acd595fc146513c92dc1bb341c3432d67de1e93ab73a7ce60e385dd34f3a55e3d3d7aec5f358ac4aae260f028599ac47650ebc663cea3043a760a7bc')
-b2sums=('13166e854f70987f981bb5e7e5dabfaa73b3170ab16fc1ff8f70f6b98a0697ac980bdf74bbfb39fdfd1972f922a31a28882b1575b79fd8f01d81e08e68d756bc'
+b2sums=('66a7bd71e7f74c8f25963ed8d41f04f1f95e060fd23c848065a0e947e766efe058e6593ed8ce1f69528f5b2e9868756d0ea0622b3d77486852882622dd3bb872'
+        'SKIP'
         'b5f19e0619f1fb017cd889c14e341c21146b3afe7b9eefcdb7fb1eb83a357434b899d1e92f3ab0023c78ef8f2de6ae54c4599ee0f0bd04d257f4ca0a4dc9a16c'
         '02dd441cf6e4a7c2bc0de876f020b0784d811f77a5c6102dd075d67b07158dbc53c8b4d62bc8035283d4f349008574b1c3fac03f4519d56ffd809cb5bcfb7bea'
         'db58b7deb24cea16fb84f56680f0000683f72e11a95039969878e3819607aad5e65af9d9f50007e7710609065c0e3ebb9b30c1d929162b74eca5e74434d82cf1'
         'de31693cea5f452a9c8c0d1cf5210a6e67c0176f8b1a4d74106f2e803911569e9fdbb2301b3b5dc7ad6a6da285026b1a3ed3de52117d216b030cf0d92348909d')
+validpgpkeys=('622C7C012254C186677469C50C0B590E80CA15A7') # Wietse Venema <wietse at porcupine.org>
 
 prepare() {
-  cd "${pkgname}-${pkgver}"
+  cd "${pkgbase}-${pkgver}"
   # add distribution defaults to main.cf (alias_maps and alias_database)
-  patch -Np1 -i ../"${pkgname}-3.5.8-main_defaults.patch"
+  patch -Np1 -i ../"${pkgbase}-3.5.8-main_defaults.patch"
+
+  # create work directories for split package configuration
+  mkdir -vp dynamicmaps.cf.d "${pkgbase}-files.d"
 }
 
 build() {
@@ -47,6 +51,7 @@
     '-DUSE_SASL_AUTH'
     '-DUSE_CYRUS_SASL' '-I/usr/include/sasl'
     '-DHAS_LDAP'
+    '-DHAS_LMDB'
     '-DUSE_TLS'
     '-DHAS_MYSQL' '-I/usr/include/mysql'
     '-DHAS_PGSQL' '-I/usr/include/postgresql'
@@ -59,7 +64,7 @@
     '-DDEF_MANPAGE_DIR=\"/usr/share/man\"'
   )
 
-  cd "${pkgname}-${pkgver}"
+  cd "${pkgbase}-${pkgver}"
   # NOTE: descriptions of variables in makedefs
   make makefiles \
     DEBUG='' \
@@ -81,10 +86,25 @@
   make
 }
 
-package() {
-  local _name
-  depends+=('libicuuc.so' 'libmariadb.so')
+package_postfix() {
+  local _name _feature
 
+  depends+=('db' 'libnsl' 'libsasl' 'openssl' 'zlib' 'libicuuc.so')
+  optdepends=(
+    'perl: for postfix-collate.pl and qshape'
+    'postfix-cdb: for CDB integration'
+    'postfix-ldap: for LDAP integration'
+    'postfix-lmdb: for LMDB integration'
+    'postfix-mysql: for MySQL integration'
+    'postfix-pcre: for PCRE integration'
+    'postfix-pgsql: for PostgreSQL integration'
+    'postfix-sqlite: for SQLite integration'
+  )
+  conflicts=('smtp-server' 'smtp-forwarder')
+  provides=('smtp-server' 'smtp-forwarder')
+  backup=('etc/postfix/'{access,aliases,canonical,generic,header_checks,main.cf,master.cf,relocated,transport,virtual})
+  install="${pkgbase}.install"
+
   cd "${pkgname}-${pkgver}"
   LD_LIBRARY_PATH="lib:$LD_LIBRARY_PATH" \
   sh postfix-install -non-interactive install_root="${pkgdir}"
@@ -104,8 +124,113 @@
   # sysusers.d
   install -vDm 644 "../${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
   # tmpfiles.d
-  # NOTE: follow setup in conf/postfix-files
+  # NOTE: follows setup in conf/postfix-files
   install -vDm 644 "../${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+
+  # create dynamicmaps.cf.d/ and postfix-files.d/ entries for split packages
+  # remove targetted files from main configuration files
+  for _feature in {cdb,ldap,lmdb,mysql,pcre,pgsql,sqlite}; do
+    grep "${pkgbase}-${_feature}" "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf" > "dynamicmaps.cf.d/${pkgbase}-${_feature}.cf"
+    sed -e "/${pkgbase}-${_feature}/d" -i "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf"
+    grep "${pkgbase}-${_feature}" "${pkgdir}/etc/${pkgbase}/${pkgbase}-files" > "${pkgbase}-files.d/${pkgbase}-${_feature}.cf"
+    sed -e "/${pkgbase}-${_feature}/d" -i "${pkgdir}/etc/${pkgbase}/${pkgname}-files"
+    grep "${_feature^^}_README:" "${pkgdir}/etc/${pkgbase}/${pkgbase}-files" >> "${pkgbase}-files.d/${pkgbase}-${_feature}.cf"
+    sed -e "/${_feature^^}_README:/d" -i "${pkgdir}/etc/${pkgbase}/${pkgname}-files"
+    if [[ "${_feature}" != cdb ]]; then
+      grep "${_feature}_table.5:" "${pkgdir}/etc/${pkgbase}/${pkgbase}-files" >> "${pkgbase}-files.d/${pkgbase}-${_feature}.cf"
+      sed -e "/${_feature}_table.5:/d" -i "${pkgdir}/etc/${pkgbase}/${pkgname}-files"
+      # remove files, that are part of the split packages
+      rm -vf "${pkgdir}/usr/share/man/man5/${_feature}_table.5"
+    fi
+    # remove files, that are part of the split packages
+    rm -vf "${pkgdir}/usr/lib/${pkgbase}/${pkgbase}-${_feature}.so"
+    rm -vf "${pkgdir}/usr/share/doc/${pkgbase}/${_feature^^}_README"
+  done
+
   # remove non-reproducible file, that only lists what the build circumstances were
   rm -v "${pkgdir}/etc/${pkgname}/makedefs.out"
+  sed -e '/makedefs/d' -i "${pkgdir}/etc/${pkgname}/${pkgname}-files"
 }
+
+package_postfix-cdb() {
+  depends+=('postfix' 'libcdb.so')
+  name+=' (CDB integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 README_FILES/CDB_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}
+
+package_postfix-ldap() {
+  depends+=('postfix' 'libldap')
+  name+=' (LDAP integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 man/man5/ldap_table.5 -t "${pkgdir}/usr/share/man/man5/"
+  install -vDm 644 README_FILES/LDAP_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}
+
+package_postfix-lmdb() {
+  depends+=('lmdb' 'postfix')
+  name+=' (LMDB integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 man/man5/lmdb_table.5 -t "${pkgdir}/usr/share/man/man5/"
+  install -vDm 644 README_FILES/LMDB_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}
+
+package_postfix-mysql() {
+  depends+=('postfix' 'libmariadb.so')
+  name+=' (MySQL integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 man/man5/mysql_table.5 -t "${pkgdir}/usr/share/man/man5/"
+  install -vDm 644 README_FILES/MYSQL_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}
+
+package_postfix-pcre() {
+  depends+=('pcre' 'postfix')
+  name+=' (PCRE integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 man/man5/pcre_table.5 -t "${pkgdir}/usr/share/man/man5/"
+  install -vDm 644 README_FILES/PCRE_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}
+
+package_postfix-pgsql() {
+  depends+=('postfix' 'libpq.so')
+  name+=' (PostgreSQL integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 man/man5/pgsql_table.5 -t "${pkgdir}/usr/share/man/man5/"
+  install -vDm 644 README_FILES/PGSQL_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}
+
+package_postfix-sqlite() {
+  depends+=('postfix' 'sqlite')
+  name+=' (SQLite integration)'
+
+  cd "${pkgbase}-${pkgver}"
+  install -vDm 755 lib/${pkgname}.so -t "${pkgdir}/usr/lib/${pkgbase}/"
+  install -vDm 644 "dynamicmaps.cf.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/dynamicmaps.cf.d/"
+  install -vDm 644 "${pkgbase}-files.d/${pkgname}.cf" -t "${pkgdir}/etc/${pkgbase}/${pkgbase}-files.d/"
+  install -vDm 644 man/man5/sqlite_table.5 -t "${pkgdir}/usr/share/man/man5/"
+  install -vDm 644 README_FILES/SQLITE_README -t "${pkgdir}/usr/share/doc/${pkgbase}/"
+}

Added: postfix.install
===================================================================
--- postfix.install	                        (rev 0)
+++ postfix.install	2021-01-22 19:55:27 UTC (rev 406621)
@@ -0,0 +1,8 @@
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_upgrade() {
+  # introduction of split packages
+  if [ "$(vercmp "$2" "3.5.9")" -le 0 ]; then
+    echo "WARNING: The following features are now only available via optdepends: cdb, ldap, lmdb, mysql, pcre, pgsql, sqlite."
+  fi
+}



More information about the arch-commits mailing list