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

1.267   ! taca        1: # $NetBSD: Makefile,v 1.266 2013/09/06 14:08:18 taca Exp $
1.1       christos    2: 
1.267   ! taca        3: DISTNAME=      postfix-2.10.2
1.1       christos    4: CATEGORIES=    mail
1.63      martti      5: MASTER_SITES=  ftp://ftp.porcupine.org/mirrors/postfix-release/official/
1.219     ghen        6: MASTER_SITES+= http://postfix.it-austria.net/releases/official/
                      7: MASTER_SITES+= http://mirrors.isc.org/pub/postfix/official/
                      8: MASTER_SITES+= http://mirror.postfix.jp/postfix-release/official/
1.132     martti      9: 
1.235     wiz        10: MAINTAINER=    [email protected]
1.5       tron       11: HOMEPAGE=      http://www.postfix.org/
1.48      martti     12: COMMENT=       Postfix SMTP server and tools
1.234     gdt        13: # The postfix license has only very minor diffs from cpl-1.0.
                     14: LICENSE=       cpl-1.0
                     15: #LICENSE=      postfix-license
1.1       christos   16: 
1.181     jlam       17: CONFLICTS+=    courier-mta-[0-9]* fastforward>=0.51nb2 sendmail-[0-9]*
1.253     cheusov    18: CONFLICTS+=    esmtp>=1.2 nullmailer-[0-9]*
1.122     grant      19: 
1.112     jlam       20: PKG_INSTALLATION_TYPES=        overwrite pkgviews
                     21: 
1.178     martti     22: USE_TOOLS+=    perl
1.196     rillig     23: CHECK_HEADERS_SKIP+=   src/global/mail_params.h
1.178     martti     24: 
1.140     jlam       25: .include "../../mk/bsd.prefs.mk"
1.69      wiz        26: 
1.227     martti     27: SPECIAL_PERMS+=        sbin/postdrop postfix maildrop 2555
                     28: SPECIAL_PERMS+=        sbin/postqueue postfix maildrop 2555
                     29: 
1.140     jlam       30: # POSTFIX_QUEUE_DIR is the default queue directory for Postfix.  This is
                     31: # merely a default, and may be changed by setting "queue_directory" in
                     32: # ${PKG_SYSCONFDIR}/main.cf.
                     33: #
1.216     taca       34: POSTFIX_DATA_DIR?=     ${VARBASE}/db/postfix
1.140     jlam       35: POSTFIX_QUEUE_DIR?=    ${VARBASE}/spool/postfix
1.216     taca       36: BUILD_DEFS+=           VARBASE POSTFIX_DATA_DIR POSTFIX_QUEUE_DIR
1.140     jlam       37: 
                     38: # CCARGS is a list of options to pass to the preprocessor/compiler.
                     39: # AUXLIBS is a list of options to pass to the linker.
                     40: #
1.212     ghen       41: CCARGS=                -DUSE_SASL_AUTH
1.166     grant      42: AUXLIBS=       ${LDFLAGS}
1.93      jmmv       43: 
1.148     jlam       44: # Set some default paths to override ${WRKSRC}/src/global/mail_params.h.
1.216     taca       45: CCARGS+=       -DDEF_DATA_DIR=\"${POSTFIX_DATA_DIR}\"
1.140     jlam       46: CCARGS+=       -DDEF_QUEUE_DIR=\"${POSTFIX_QUEUE_DIR}\"
1.148     jlam       47: CCARGS+=       -DDEF_DAEMON_DIR=\"${LIBEXECDIR}\"
1.140     jlam       48: CCARGS+=       -DDEF_COMMAND_DIR=\"${PREFIX}/sbin\"
1.148     jlam       49: CCARGS+=       -DDEF_CONFIG_DIR=\"${PKG_SYSCONFDIR}\"
1.79      lukem      50: CCARGS+=       -DDEF_SENDMAIL_PATH=\"${PREFIX}/sbin/sendmail\"
                     51: CCARGS+=       -DDEF_MAILQ_PATH=\"${PREFIX}/bin/mailq\"
                     52: CCARGS+=       -DDEF_NEWALIAS_PATH=\"${PREFIX}/bin/newaliases\"
1.207     jlam       53: CCARGS+=       -DDEF_MANPAGE_DIR=\"${PREFIX}/${PKGMANDIR}\"
1.148     jlam       54: CCARGS+=       -DDEF_SAMPLE_DIR=\"${EXAMPLEDIR}\"
                     55: CCARGS+=       -DDEF_README_DIR=\"${DOCDIR}\"
                     56: 
1.177     martti     57: REPLACE_PERL+= auxiliary/qshape/qshape.pl
                     58: 
1.148     jlam       59: # Override those same default paths in the installed example main.cf.
                     60: SUBST_CLASSES+=                postfix
                     61: SUBST_STAGE.postfix=   post-configure
                     62: SUBST_FILES.postfix=   conf/main.cf src/global/mail_params.h
                     63: SUBST_SED.postfix=     \
1.216     taca       64:        -e 's|^\(data_directory\) =.*|\1 = ${POSTFIX_DATA_DIR}|'
                     65: SUBST_SED.postfix+=    \
1.194     martti     66:        -e 's|^\(queue_directory\) =.*|\1 = ${POSTFIX_QUEUE_DIR}|'
1.191     martti     67: SUBST_SED.postfix+=    \
1.194     martti     68:        -e 's|^\(command_directory\) =.*|\1 = ${PREFIX}/sbin|'
1.191     martti     69: SUBST_SED.postfix+=    \
1.194     martti     70:        -e 's|^\(daemon_directory\) =.*|\1 = ${LIBEXECDIR}|'
1.191     martti     71: SUBST_SED.postfix+=    \
1.194     martti     72:        -e 's|^\(sendmail_path\) =.*|\1 = ${PREFIX}/sbin/sendmail|'
1.191     martti     73: SUBST_SED.postfix+=    \
1.194     martti     74:        -e 's|^\(newaliases_path\) =.*|\1 = ${PREFIX}/bin/newaliases|'
1.191     martti     75: SUBST_SED.postfix+=    \
1.194     martti     76:        -e 's|^\(mailq_path\) =.*|\1 = ${PREFIX}/bin/mailq|'
1.191     martti     77: SUBST_SED.postfix+=    \
1.194     martti     78:        -e 's|^\(setgid_group\) =.*|\1 = maildrop|'
1.191     martti     79: SUBST_SED.postfix+=    \
1.207     jlam       80:        -e 's|^\(manpage_directory\) =.*|\1 = ${PREFIX}/${PKGMANDIR}|'
1.191     martti     81: SUBST_SED.postfix+=    \
1.194     martti     82:        -e 's|^\(sample_directory\) =.*|\1 = ${EXAMPLEDIR}|'
1.191     martti     83: SUBST_SED.postfix+=    \
1.194     martti     84:        -e 's|^\(readme_directory\) =.*|\1 = ${DOCDIR}|'
1.191     martti     85: SUBST_SED.postfix+=    \
1.194     martti     86:        -e '/^\#define DEF_SGID_GROUP[  ]/s,postdrop,maildrop,g'
1.79      lukem      87: 
1.147     jlam       88: # options.mk appends to CCARGS and AUXLIBS the options needed to build
                     89: # Postfix with support for various add-on modules.
1.140     jlam       90: #
1.147     jlam       91: .include "options.mk"
1.28      hubertf    92: 
1.140     jlam       93: PKG_SYSCONFSUBDIR=     postfix
1.146     jlam       94: LIBEXECDIR=            ${PREFIX}/libexec/postfix
                     95: DOCDIR=                        ${PREFIX}/share/doc/postfix
                     96: EXAMPLEDIR=            ${PREFIX}/share/examples/postfix
1.121     grant      97: 
1.217     martti     98: FILES_SUBST+=          EXAMPLEDIR=${EXAMPLEDIR}
1.140     jlam       99: MESSAGE_SUBST+=                EXAMPLEDIR=${EXAMPLEDIR}
1.142     jlam      100: MESSAGE_SUBST+=                DOCDIR=${DOCDIR}
1.86      jlam      101: 
1.140     jlam      102: MESSAGE_SRC+=          ${PKGDIR}/MESSAGE
                    103: .if exists(${PKGDIR}/MESSAGE.${OPSYS})
                    104: MESSAGE_SRC+=          ${PKGDIR}/MESSAGE.${OPSYS}
1.95      martti    105: .endif
1.140     jlam      106: PLIST_SRC+=            ${PKGDIR}/PLIST
1.50      kent      107: 
1.154     wiz       108: BUILD_TARGET=          # empty
1.188     martti    109: MAKE_ENV+=             CC=${CC:Q} OPT=${CFLAGS:Q}
1.170     rillig    110: MAKE_ENV+=             AUXLIBS=${AUXLIBS:Q} CCARGS=${CCARGS:Q}
1.140     jlam      111: 
                    112: RCD_SCRIPTS=           postfix
1.173     martti    113: OWN_DIRS+=             ${POSTFIX_QUEUE_DIR} ${POSTFIX_QUEUE_DIR}/etc
1.216     taca      114: OWN_DIRS_PERMS+=       ${POSTFIX_DATA_DIR} postfix postfix 0700
1.140     jlam      115: MAKE_DIRS+=            ${PKG_SYSCONFDIR}
                    116: 
                    117: PKG_GROUPS?=           postfix maildrop
1.180     jlam      118: PKG_USERS?=            postfix:postfix
                    119: PKG_GECOS.postfix=     Postfix User
                    120: PKG_HOME.postfix=      ${POSTFIX_QUEUE_DIR}
1.140     jlam      121: 
1.141     jlam      122: CONF_FILES=            # empty
1.224     martti    123: .for i in main.cf master.cf
1.192     martti    124: CONF_FILES+=           ${EXAMPLEDIR}/${i} ${PKG_SYSCONFDIR}/${i}
1.141     jlam      125: .endfor
                    126: CONF_FILES_PERMS=      # empty
1.93      jmmv      127: 
1.151     xtraeme   128: MAKE_ENV+=             DEBUG= # empty
                    129: 
1.176     joerg     130: SUBST_CLASSES+=                paths
                    131: SUBST_FILES.paths=     ${WRKDIR}/mailer.conf
                    132: SUBST_SED.paths+=      -e 's,@PREFIX@,${PREFIX},g'
                    133: SUBST_STAGE.paths=     post-patch
                    134: 
1.248     fhajny    135: .if ${OPSYS} == "SunOS" && !exists(/usr/include/rpcsvc/nis_cache.h)
                    136: SUBST_CLASSES+=                nis
                    137: SUBST_FILES.nis=       src/util/sys_defs.h
                    138: SUBST_MESSAGE.nis=     Working around dropped support for NIS+ on SunOS
                    139: SUBST_STAGE.nis=       post-patch
                    140: SUBST_SED.nis=         -e 's,\#define HAS_NISPLUS,\#undef HAS_NISPLUS,g'
                    141: .endif
                    142: 
1.265     jperkin   143: CFLAGS.SunOS+=         -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
                    144: 
1.229     heinz     145: .if !empty(USE_DESTDIR:M[Yy][Ee][Ss])
                    146: DESTDIR_INSTALLOPTIONS=-package install_root="${DESTDIR}"
                    147: .endif
                    148: 
                    149: INSTALLATION_DIRS+=    ${LIBEXECDIR} ${EXAMPLEDIR} ${DOCDIR}
                    150: 
1.176     joerg     151: post-extract:
1.190     martti    152:        cp ${FILESDIR}/mailer.conf ${WRKDIR}/mailer.conf
1.193     martti    153:        rm -f ${WRKSRC}/auxiliary/MacOSX/Postfix.StartupItem/Postfix
1.176     joerg     154: 
1.28      hubertf   155: do-configure:
1.108     jlam      156:        cd ${WRKSRC} &&                                                 \
1.190     martti    157:        env ${MAKE_ENV} ${MAKE} -f Makefile.init makefiles              \
1.108     jlam      158:                'CCARGS=${CCARGS}' 'AUXLIBS=${AUXLIBS}'
1.1       christos  159: 
1.5       tron      160: post-build:
1.145     jlam      161: .if !empty(PKG_OPTIONS:Msasl)
1.140     jlam      162:        ${ECHO} "pwcheck_method: ${PWCHECK_METHOD}" > ${WRKDIR}/smtpd.conf
                    163: .endif
1.5       tron      164: 
1.140     jlam      165: do-install:
1.190     martti    166:        rm -f ${WRKSRC}/conf/*.orig
1.145     jlam      167: .if !empty(PKG_OPTIONS:Msasl)
1.229     heinz     168:        ${INSTALL_DATA} ${WRKDIR}/smtpd.conf ${DESTDIR}${EXAMPLEDIR}
1.50      kent      169: .endif
1.200     martti    170:        cd ${WRKSRC} && sh ./postfix-install -non-interactive           \
1.229     heinz     171:                ${DESTDIR_INSTALLOPTIONS} config_directory="${EXAMPLEDIR}"
                    172:        ${INSTALL_DATA} ${WRKDIR}/mailer.conf \
                    173:                ${DESTDIR}${EXAMPLEDIR}/mailer.conf
1.177     martti    174:        ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl \
1.229     heinz     175:                ${DESTDIR}${PREFIX}/sbin/qshape
1.204     martti    176:        ${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 \
1.229     heinz     177:                ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
1.1       christos  178: 
                    179: .include "../../mk/bsd.pkg.mk"

CVSweb <[email protected]>