Annotation of pkgsrc/mail/postfix/Makefile, revision 1.109.2.1

1.109.2.1! agc         1: # $NetBSD: Makefile,v 1.110 2003/11/26 06:03:41 jlam Exp $
1.1       christos    2: 
1.103     martti      3: DISTNAME=      postfix-2.0.16
1.1       christos    4: CATEGORIES=    mail
1.63      martti      5: MASTER_SITES=  ftp://ftp.porcupine.org/mirrors/postfix-release/official/
1.108     jlam        6: DIST_SUBDIR=   postfix
1.1       christos    7: 
1.105     martti      8: MAINTAINER=    [email protected]
1.5       tron        9: HOMEPAGE=      http://www.postfix.org/
1.48      martti     10: COMMENT=       Postfix SMTP server and tools
1.1       christos   11: 
1.69      wiz        12: USE_BUILDLINK2=        yes
1.78      jlam       13: USE_PKGINSTALL=        yes
1.69      wiz        14: 
1.79      lukem      15: PKG_SYSCONFSUBDIR=     postfix
1.108     jlam       16: POSTFIX_SPOOL=         /var/spool/postfix
1.79      lukem      17: 
1.93      jmmv       18: OWN_DIRS=      ${POSTFIX_SPOOL}
                     19: 
1.79      lukem      20: CCARGS+=       -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
                     21: CCARGS+=       -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\"
                     22: CCARGS+=       -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\"
                     23: CCARGS+=       -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\"
                     24: CCARGS+=       -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
                     25: CCARGS+=       -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
                     26: 
1.28      hubertf    27: .include "../../mk/bsd.prefs.mk"
                     28: 
1.86      jlam       29: FIX_RPATH+=    AUXLIBS
                     30: 
1.95      martti     31: .if defined(POSTFIX_USE_INET6) && ${POSTFIX_USE_INET6} == "YES"
1.109     jlam       32: .  include "../../security/openssl/buildlink2.mk"
1.103     martti     33: PATCHFILES+=           tls+ipv6-1.18a-pf-2.0.16.patch.gz
                     34: PATCH_SITES+=          ftp://ftp.stack.nl/pub/postfix/tls+ipv6/1.18/
1.95      martti     35: PATCH_DIST_STRIP=      -p1
                     36: BUILD_DEFS+=           POSTFIX_USE_INET6
                     37: 
1.108     jlam       38: CCARGS+=       -DHAS_SSL
                     39: AUXLIBS+=      -L${BUILDLINK_PREFIX.openssl}/lib                       \
                     40:                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openssl}/lib        \
                     41:                -lssl -lcrypto
                     42: BUILD_DEFS+=   POSTFIX_USE_TLS
1.95      martti     43: 
1.108     jlam       44: PLIST_SRC+=    ${PKGDIR}/PLIST.tls
                     45: MESSAGE_SRC+=  ${PKGDIR}/MESSAGE.tls
1.95      martti     46: .endif
1.50      kent       47: 
1.48      martti     48: .if defined(POSTFIX_USE_PCRE) && ${POSTFIX_USE_PCRE} == "YES"
1.109     jlam       49: .  include "../../devel/pcre/buildlink2.mk"
1.50      kent       50: CCARGS+=       -DHAS_PCRE
1.108     jlam       51: AUXLIBS+=      -L${BUILDLINK_PREFIX.pcre}/lib                          \
                     52:                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.pcre}/lib           \
1.71      martti     53:                -lpcre
1.48      martti     54: BUILD_DEFS+=   POSTFIX_USE_PCRE
1.76      martti     55: .else
                     56: CCARGS+=       -DNO_PCRE
1.57      martti     57: .endif
                     58: 
1.71      martti     59: .if defined(POSTFIX_USE_LDAP) && ${POSTFIX_USE_LDAP} == "YES"
1.109     jlam       60: .  include "../../databases/openldap/buildlink2.mk"
1.71      martti     61: CCARGS+=       -DHAS_LDAP
1.108     jlam       62: AUXLIBS+=      -L${BUILDLINK_PREFIX.openldap}/lib                      \
1.86      jlam       63:                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.openldap}/lib       \
1.71      martti     64:                -lldap -llber
                     65: BUILD_DEFS+=   POSTFIX_USE_LDAP
                     66: .endif
                     67: 
1.57      martti     68: .if defined(POSTFIX_USE_MYSQL) && ${POSTFIX_USE_MYSQL} == "YES"
1.109     jlam       69: .  include "../../databases/mysql-client/buildlink2.mk"
1.69      wiz        70: CCARGS+=       -DHAS_MYSQL -I${BUILDLINK_PREFIX.mysql-client}/include/mysql
1.71      martti     71: AUXLIBS+=      -L${BUILDLINK_PREFIX.mysql-client}/lib/mysql            \
1.86      jlam       72:                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.mysql-client}/lib/mysql     \
1.71      martti     73:                -lmysqlclient -lz -lm
1.57      martti     74: BUILD_DEFS+=   POSTFIX_USE_MYSQL
1.19      kim        75: .endif
1.71      martti     76: 
1.104     christos   77: .if defined(USE_SASL2) && ${USE_SASL2} == "YES"
                     78: USING_SASL=YES
1.109     jlam       79: .  include "../../security/cyrus-sasl2/buildlink2.mk"
1.104     christos   80: CCARGS+=       -DUSE_SASL2_AUTH
1.108     jlam       81: AUXLIBS+=      -L${BUILDLINK_PREFIX.cyrus-sasl}/lib                    \
1.106     kleink     82:                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib     \
1.104     christos   83:                -lsasl2
                     84: BUILD_DEFS+=   USE_SASL2
1.107     jlam       85: .elif defined(USE_SASL) && ${USE_SASL} == "YES"
                     86: USING_SASL=YES
1.109     jlam       87: .  include "../../security/cyrus-sasl/buildlink2.mk"
1.107     jlam       88: CCARGS+=       -DUSE_SASL_AUTH
1.108     jlam       89: AUXLIBS+=      -L${BUILDLINK_PREFIX.cyrus-sasl}/lib                    \
1.107     jlam       90:                -Wl,${RPATH_FLAG}${BUILDLINK_PREFIX.cyrus-sasl}/lib     \
                     91:                -lsasl
                     92: BUILD_DEFS+=   USE_SASL
1.104     christos   93: .endif
1.71      martti     94: 
1.104     christos   95: .if defined(USING_SASL)
1.107     jlam       96: PLIST_SRC+=    ${PKGDIR}/PLIST.sasl
1.71      martti     97: MESSAGE_SRC+=  ${PKGDIR}/MESSAGE.sasl
                     98: MESSAGE_SUBST+=        PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
1.67      martti     99: .endif
                    100: 
                    101: MESSAGE_SRC+=  ${PKGDIR}/MESSAGE
1.50      kent      102: PLIST_SRC+=    ${PKGDIR}/PLIST
1.28      hubertf   103: ALL_TARGET=    #empty
1.65      tron      104: MAKE_ENV=      CC="${CC}" OPT="${CFLAGS}"
1.76      martti    105: MAKE_ENV+=     AUXLIBS="${AUXLIBS}" CCARGS="${CCARGS}"
1.1       christos  106: 
1.79      lukem     107: POSTFIX_CONF_FILES=    conf/main.cf src/util/sys_defs.h postfix-install
                    108: POSTFIX_CONF_FILES+=   conf/sample-misc.cf src/global/mail_params.h
                    109: 
1.93      jmmv      110: FILES_SUBST+=  SHAREDIR=${SHAREDIR}
                    111: MESSAGE_SUBST+=        SHAREDIR=${SHAREDIR}
1.79      lukem     112: PLIST_SUBST+=  PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
                    113: PLIST_SUBST+=  POSTFIX_SPOOL=${POSTFIX_SPOOL}
                    114: 
                    115: PKG_GROUPS?=   postfix maildrop
                    116: PKG_USERS?=    postfix:postfix::Postfix\\ User:${POSTFIX_SPOOL}
                    117: 
                    118: LIBEXECDIR=    ${PREFIX}/libexec/${PKGBASE}
1.93      jmmv      119: SHAREDIR=      ${PREFIX}/share/examples/${PKGBASE}
1.79      lukem     120: 
1.93      jmmv      121: CONF_FILES=    ${SHAREDIR}/main.cf ${PKG_SYSCONFDIR}/main.cf
1.79      lukem     122: CONF_FILES+=   ${SHAREDIR}/master.cf ${PKG_SYSCONFDIR}/master.cf
1.107     jlam      123: .if defined(USING_SASL)
1.109     jlam      124: .  if defined(USE_SASL2)
1.107     jlam      125: CONF_FILES+=   ${SHAREDIR}/smtpd.conf  ${PREFIX}/lib/sasl2/smtpd.conf
1.109     jlam      126: .  else
1.107     jlam      127: CONF_FILES+=   ${SHAREDIR}/smtpd.conf  ${PREFIX}/lib/sasl/smtpd.conf
1.109     jlam      128: .  endif
1.107     jlam      129: .endif
1.108     jlam      130: CONF_FILES_PERMS=      # empty
1.93      jmmv      131: .for confscr in post-install postfix-files postfix-script
                    132: CONF_FILES_PERMS+=     ${SHAREDIR}/${confscr} ${PKG_SYSCONFDIR}/${confscr} \
                    133:                        ${ROOT_USER} ${ROOT_GROUP} 755
                    134: .endfor
                    135: .undef confscr
                    136: 
1.108     jlam      137: INSTALL_EXTRA_TMPL+=   ${PKGDIR}/INSTALL
1.79      lukem     138: 
1.1       christos  139: pre-configure:
1.79      lukem     140:        @for i in ${POSTFIX_CONF_FILES}; do                             \
                    141:                ${CP} ${WRKSRC}/$${i} ${WRKSRC}/$${i}.dist;             \
                    142:                ${SED} -e 's|__PREFIX|'${PREFIX}'|g'                    \
                    143:                        -e 's|__PKG_SYSCONFDIR|'${PKG_SYSCONFDIR}'|g'   \
                    144:                        < ${WRKSRC}/$${i}.dist                          \
                    145:                        > ${WRKSRC}/$${i};                              \
                    146:        done
1.28      hubertf   147: 
                    148: do-configure:
1.108     jlam      149:        cd ${WRKSRC} &&                                                 \
                    150:        ${SETENV} ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles        \
                    151:                'CCARGS=${CCARGS}' 'AUXLIBS=${AUXLIBS}'
1.1       christos  152: 
1.5       tron      153: post-build:
                    154:        ${SED} -e 's#@@PREFIX@@#${PREFIX}#g' \
1.28      hubertf   155:            <${FILESDIR}/mailer.conf >${WRKDIR}/mailer.conf.postfix
1.5       tron      156: 
1.1       christos  157: pre-install:
1.79      lukem     158:        ${INSTALL_DATA_DIR} ${PKG_SYSCONFDIR}
                    159:        ${INSTALL_DATA_DIR} ${SHAREDIR}
1.62      martti    160:        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/postfix
1.79      lukem     161:        ${INSTALL_DATA_DIR} ${LIBEXECDIR}
                    162:        ${CHOWN} ${ROOT_USER}:${ROOT_GROUP} ${SHAREDIR} ${LIBEXECDIR}
                    163:        ${CHMOD} 755 ${SHAREDIR} ${LIBEXECDIR}
1.28      hubertf   164:        -${RM} -f ${WRKSRC}/conf/*.orig
1.104     christos  165: .if defined(USING_SASL)
1.109     jlam      166: .  if defined(USE_SASL2)
1.107     jlam      167:        ${ECHO} "pwcheck_method: auxprop" > ${WRKDIR}/smtpd.conf
1.109     jlam      168: .  else
1.107     jlam      169:        ${ECHO} "pwcheck_method: sasldb" > ${WRKDIR}/smtpd.conf
1.109     jlam      170: .  endif
1.107     jlam      171:        ${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${SHAREDIR}
1.109.2.1! agc       172: .endif
1.79      lukem     173:        ${INSTALL_SCRIPT} ${WRKSRC}/conf/post-install ${SHAREDIR}
                    174:        ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-files ${SHAREDIR}
                    175:        ${INSTALL_SCRIPT} ${WRKSRC}/conf/postfix-script ${SHAREDIR}
1.93      jmmv      176:        ${INSTALL_DATA} ${WRKSRC}/conf/main.cf ${SHAREDIR}
                    177:        ${INSTALL_DATA} ${WRKSRC}/conf/master.cf ${SHAREDIR}
                    178:        ${INSTALL_DATA} ${WRKDIR}/mailer.conf.postfix ${SHAREDIR}/mailer.conf
                    179: 
                    180: do-install:
1.108     jlam      181:        cd ${WRKSRC} && ${SETENV} config_directory="${SHAREDIR}"        \
                    182:                ${SH} postfix-install -non-interactive
1.1       christos  183: 
                    184: .include "../../mk/bsd.pkg.mk"

CVSweb <[email protected]>