summaryrefslogtreecommitdiff
path: root/postfix-lmdb/Pkgfile
blob: 1e58adadb1d1c87be26400bcb11cf16dda3894d6 (plain)
    1 # Description: Secure and fast drop-in replacement for Sendmail (MTA)
    2 # URL:         https://www.postfix.org/
    3 # Maintainer:  Steffen Nurpmeso, steffen at sdaoden dot eu
    4 # Depends on:  libpcre lmdb   openssl
    5 
    6 rname=postfix
    7 name=postfix-lmdb
    8 version=3.5.9
    9 release=2
   10 source=(
   11    https://de.${rname}.org/ftpmirror/official/${rname}-${version}.tar.gz
   12    lmdb-default.patch postfix-install.patch post-install
   13    ${rname}.rc
   14    aliases README relay_clientcerts sender_restrict
   15    main-addon.cf master.patch
   16 )
   17 
   18 isinst() { pkginfo -i | grep -qE "^${1}[[:space:]]"; }
   19 
   20 build() {
   21    cd ${rname}-${version}
   22 
   23    patch -p1 < "${SRC}"/lmdb-default.patch
   24    patch -p1 < "${SRC}"/postfix-install.patch
   25 
   26    cca='-DNO_DB -DNO_EAI -DNO_NIS -DNO_NISPLUS '
   27    cca=${cca}' -DHAS_LMDB -DDEF_DB_TYPE=\"lmdb\" -DHAS_PCRE -DUSE_TLS'
   28    aux=
   29 
   30    if isinst dovecot; then # TODO UNTESTED!
   31       cca=${cca}' -DUSE_SASL_AUTH -DDEF_SASL_SERVER=dovecot'
   32    fi
   33 
   34    if isinst cyrus-sasl; then # TODO UNTESTED!
   35       cca=${cca}' -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl'
   36       aux=${aux}' -lsasl2'
   37    fi
   38 
   39    make tidy
   40    make pie=yes shared=yes \
   41       DEBUG= \
   42       CCARGS="${cca}" \
   43       OPT="${CFLAGS}" \
   44       AUXLIBS_LMDB=-llmdb \
   45       AUXLIBS_PCRE=-lpcre \
   46       AUXLIBS="-lssl -lcrypto" \
   47       ${aux} \
   48          install_root="${PKG}" \
   49          command_directory=/usr/sbin \
   50          config_directory=/etc/${name} \
   51          daemon_directory=/usr/lib/${name} \
   52          data_directory=/var/lib/${name} \
   53          html_directory=no \
   54          mail_spool_directory=/var/spool/mail \
   55          manpage_directory=/usr/share/man \
   56          meta_directory=/etc/${name} \
   57          queue_directory=/var/spool/${name} \
   58          readme_directory=no \
   59          shlib_directory=/usr/lib/${name} \
   60       makefiles
   61 
   62    make OPT="$CFLAGS"
   63 
   64    make \
   65          install_root="${PKG}" \
   66          command_directory=/usr/sbin \
   67          config_directory=/etc/${name} \
   68          daemon_directory=/usr/lib/${name} \
   69          data_directory=/var/lib/${name} \
   70          html_directory=no \
   71          mail_spool_directory=/var/spool/mail \
   72          manpage_directory=/usr/share/man \
   73          meta_directory=/etc/${name} \
   74          queue_directory=/var/spool/${name} \
   75          readme_directory=no \
   76          shlib_directory=/usr/lib/${name} \
   77    non-interactive-package
   78 
   79    install -D -m 0755 "${SRC}"/${rname}.rc "${PKG}"/etc/rc.d/${name}
   80    install -m 0644 "${SRC}"/aliases "${PKG}"/etc/${name}/aliases
   81    install -m 0644 "${SRC}"/README "${PKG}"/etc/${name}/CRUX-README.txt
   82    install -m 0644 "${SRC}"/relay_clientcerts \
   83       "${PKG}"/etc/${name}/relay_clientcerts
   84    install -m 0644 "${SRC}"/sender_restrict \
   85       "${PKG}"/etc/${name}/sender_restrict
   86    sed -E -i'' \
   87          -e 's/^(setgid_group.+)$/#\1/' \
   88          -e 's/^(inet_protocols.+)$/#\1/' \
   89       "${PKG}"/etc/${name}/main.cf
   90    cat "${SRC}"/main-addon.cf >> "${PKG}"/etc/${name}/main.cf
   91    (
   92       cd "${PKG}"/etc/${name}
   93       patch -p0 < "${SRC}"/master.patch
   94    )
   95 }
   96 
   97 # s-sh-mode

Generated by cgit