Makefile.inc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # $OpenBSD: Makefile.inc,v 1.92 2016/09/23 09:16:56 sthen Exp $
  2. COMMENT= fast, secure sendmail replacement
  3. DISTNAME= postfix-${VERSION}
  4. PKGNAME= postfix-${VERSION:S/-/./}
  5. CATEGORIES= mail
  6. MASTER_SITE_POSTFIX= \
  7. http://ftp.porcupine.org/mirrors/postfix-release/ \
  8. http://de.postfix.org/ftpmirror/ \
  9. http://mirror.tje.me.uk/pub/mirrors/postfix-release/ \
  10. http://mirror.postfix.jp/postfix-release/ \
  11. ftp://ftp.porcupine.org/mirrors/postfix-release/ \
  12. ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/
  13. DIST_SUBDIR= postfix
  14. DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
  15. HOMEPAGE= http://www.postfix.org/
  16. MAINTAINER= Brad Smith <brad@comstyle.com>
  17. PERMIT_PACKAGE_CDROM= cannot be sold, see section 4 of license
  18. PERMIT_PACKAGE_FTP= yes
  19. PERMIT_DISTFILES_FTP= yes
  20. LIB_DEPENDS+= devel/pcre
  21. MAKE_DEBUG?=
  22. MAKE_CCARGS+= -I. -I../../include
  23. MAKE_CCARGS+= -DDEF_CONFIG_DIR=\"${SYSCONFDIR}/postfix\"
  24. MAKE_CCARGS+= -DDEF_DATA_DIR=\"/var/postfix\"
  25. MAKE_CCARGS+= -DHAS_SQLITE
  26. MAKE_CCARGS+= -DUSE_TLS
  27. MAKE_CCARGS+= -DUSE_SASL_AUTH
  28. # no UTF-8 support for now
  29. MAKE_CCARGS+= -DNO_EAI
  30. MAKE_AUXLIBS+= -lssl -lcrypto -lsqlite3 -pthread
  31. WANTLIB= c crypto pcre pthread sqlite3 ssl
  32. LIB_DEPENDS+= databases/sqlite3
  33. ALL_TARGET= default
  34. NO_TEST= Yes
  35. FLAVORS+= sasl2 ldap mysql pgsql db4
  36. FLAVOR?=
  37. .if ${FLAVOR:Msasl2}
  38. LIB_DEPENDS+= security/cyrus-sasl2
  39. WANTLIB+= sasl2
  40. MAKE_CCARGS+= -DUSE_CYRUS_SASL -I${LOCALBASE}/include -I${LOCALBASE}/include/sasl
  41. MAKE_AUXLIBS+= -L${LOCALBASE}/lib -lsasl2
  42. .endif
  43. .if ${FLAVOR:Mldap}
  44. LIB_DEPENDS+= databases/openldap>=2,<3
  45. WANTLIB+= ldap>=2 lber
  46. MAKE_CCARGS+= -DHAS_LDAP -I${LOCALBASE}/include
  47. MAKE_AUXLIBS+= -L${LOCALBASE}/lib -lldap -llber
  48. .endif
  49. .if ${FLAVOR:Mmysql}
  50. LIB_DEPENDS+= databases/mariadb
  51. WANTLIB+= lib/mysql/mysqlclient
  52. MAKE_CCARGS+= -DHAS_MYSQL -I${LOCALBASE}/include/mysql
  53. MAKE_AUXLIBS+= -L${LOCALBASE}/lib/mysql -lmysqlclient
  54. .endif
  55. .if ${FLAVOR:Mpgsql}
  56. LIB_DEPENDS+= databases/postgresql
  57. WANTLIB+= pq>=3
  58. MAKE_CCARGS+= -DHAS_PGSQL -I${LOCALBASE}/include/postgresql
  59. MAKE_AUXLIBS+= -L${LOCALBASE}/lib -lpq
  60. .endif
  61. .if ${FLAVOR:Mdb4}
  62. LIB_DEPENDS+= databases/db/v4>=4,<5
  63. WANTLIB+= lib/db4/db>=4
  64. MAKE_CCARGS+= -I${LOCALBASE}/include/db4
  65. MAKE_AUXLIBS+= -L${LOCALBASE}/lib/db4 -ldb
  66. .endif
  67. pre-configure:
  68. @perl -pi -e 's,/cyrus/bin,${LOCALBASE}/libexec/cyrus-imapd,g' \
  69. ${WRKSRC}/conf/master.cf
  70. do-configure:
  71. @cd ${WRKSRC}; ${MAKE_PROGRAM} makefiles \
  72. CC="${CC}" OPT="${CFLAGS}" DEBUG="${MAKE_DEBUG}" \
  73. CCARGS='${MAKE_CCARGS}' AUXLIBS="${MAKE_AUXLIBS}"
  74. do-install:
  75. ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/postfix
  76. @(cd ${WRKSRC}; sh postfix-install \
  77. -non-interactive \
  78. mail_owner=_postfix \
  79. setgid_group=_postdrop \
  80. install_root=${WRKINST} \
  81. data_directory=/var/postfix \
  82. queue_directory=/var/spool/postfix \
  83. daemon_directory=${TRUEPREFIX}/libexec/postfix \
  84. command_directory=${TRUEPREFIX}/sbin \
  85. sendmail_path=${TRUEPREFIX}/sbin/sendmail \
  86. newaliases_path=${TRUEPREFIX}/sbin/newaliases \
  87. mailq_path=${TRUEPREFIX}/sbin/mailq \
  88. manpage_directory=${TRUEPREFIX}/man \
  89. readme_directory=${TRUEPREFIX}/share/doc/postfix/readme \
  90. html_directory=${TRUEPREFIX}/share/doc/postfix/html \
  91. )
  92. ${INSTALL_SCRIPT} ${FILESDIR}/postfix-enable ${PREFIX}/sbin
  93. ${INSTALL_SCRIPT} ${FILESDIR}/postfix-disable ${PREFIX}/sbin
  94. ${INSTALL_SCRIPT} ${FILESDIR}/postfix-install ${PREFIX}/sbin
  95. ${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/sbin/qshape
  96. ${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${PREFIX}/man/man1
  97. @mv ${WRKINST}${SYSCONFDIR}/postfix/* ${PREFIX}/share/examples/postfix
  98. @rm -fr ${WRKINST}/var/postfix
  99. @rm -fr ${WRKINST}/var/spool/postfix
  100. @chown -h ${BINOWN}:${BINGRP} ${PREFIX}/{sbin,libexec/postfix}/*
  101. @chown -R ${MANOWN}:${MANGRP} ${PREFIX}/man
  102. @chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share