Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # $OpenBSD: Makefile,v 1.17 2017/01/30 15:42:04 bluhm Exp $
  2. COMMENT-main = mother of Mail Transfer Agents
  3. COMMENT-libmilter = mail filter support library for sendmail
  4. V= 8.15.2
  5. DISTNAME = sendmail.${V}
  6. PKGNAME-main = sendmail-${V}
  7. PKGNAME-libmilter = libmilter-${V}
  8. REVISION-main = 2
  9. FULLPKGNAME-libmilter = libmilter-${V}
  10. FULLPKGPATH-libmilter = mail/sendmail,-libmilter
  11. SHARED_LIBS = milter 4.0
  12. CATEGORIES = mail
  13. HOMEPAGE = http://www.sendmail.org/
  14. # Sendmail License / BSD3 / BSD4 / Public Domain / CDDL (contrib/ directory)
  15. PERMIT_PACKAGE_CDROM = Yes
  16. MULTI_PACKAGES = -main -libmilter
  17. WANTLIB-main = c crypto ssl
  18. WANTLIB-libmilter = pthread
  19. MASTER_SITES = ftp://ftp.sendmail.org/pub/sendmail/ \
  20. ftp://ftp.bit.nl/mirror/sendmail/ \
  21. http://negi.ipv6labs.jp/pub/sendmail/
  22. BUILD_DEPENDS = textproc/groff
  23. SUBDIRS = libsmutil libsm libmilter libsharedmilter sendmail \
  24. mail.local mailstats makemap praliases smrsh editmap
  25. MAKE_FLAGS = O="${CFLAGS}" \
  26. SUBDIRS="${SUBDIRS} cf/cf" \
  27. MILTER_SOVER="${LIBmilter_VERSION}"
  28. MAKE_ENV = M4="/usr/bin/m4"
  29. FAKE_FLAGS = SUBDIRS="${SUBDIRS}"
  30. FLAVORS = ldap sasl
  31. FLAVOR ?=
  32. WANT_LDAP = No
  33. WANT_LOCALBASE = No
  34. WANT_SMTP_AUTH = No
  35. SUBST_VARS += LOCALBASE WANT_LDAP WANT_LOCALBASE WANT_SMTP_AUTH
  36. .if ${FLAVOR:Mldap}
  37. WANT_LDAP = Yes
  38. WANT_LOCALBASE = Yes
  39. WANTLIB-main += ldap lber-2.4
  40. LIB_DEPENDS-main += databases/openldap,-main
  41. .endif
  42. .if ${FLAVOR:Msasl}
  43. WANT_SMTP_AUTH = Yes
  44. WANT_LOCALBASE = Yes
  45. WANTLIB-main += sasl2
  46. LIB_DEPENDS-main += security/cyrus-sasl2
  47. .endif
  48. WRKDIST = ${WRKDIR}/sendmail-${V}
  49. post-extract:
  50. cp ${FILESDIR}/cf/*.mc ${WRKSRC}/cf/cf
  51. chmod 0644 ${WRKSRC}/cf/cf/*.mc
  52. cp ${FILESDIR}/sharedlibrary.m4 ${WRKSRC}/devtools/M4/UNIX/
  53. chmod 0644 ${WRKSRC}/devtools/M4/UNIX/sharedlibrary.m4
  54. cp -R ${WRKSRC}/libmilter ${WRKSRC}/libsharedmilter
  55. perl -pi -e 's=`library=`sharedlibrary=' ${WRKSRC}/libsharedmilter/Makefile.m4
  56. ${SUBST_CMD} -m 0644 -c ${FILESDIR}/site.OS.m4 \
  57. ${WRKSRC}/devtools/Site/site.config.m4
  58. opfiles = op.ps op.txt
  59. post-build:
  60. .for file in ${opfiles}
  61. cd ${WRKSRC}/doc/op/ && \
  62. ${SETENV} ${MAKE_ENV} GROFF_NO_SGR=1 make ${file}
  63. .endfor
  64. pre-fake:
  65. ${INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/sendmail/
  66. docdir = ${PREFIX}/share/doc/sendmail
  67. post-install:
  68. .for manpage section in aliases 5 mailq 1 newaliases 1
  69. mv ${PREFIX}/man/man${section}/${manpage}.${section} \
  70. ${PREFIX}/man/man${section}/sendmail-${manpage}.${section}
  71. .endfor
  72. find ${PREFIX}/bin/ -type l -print -execdir rm -f {} ';' | \
  73. sed 's/^/rm -f /'
  74. mv ${PREFIX}/sbin/makemap ${PREFIX}/libexec/sendmail
  75. .for file in sendmail-enable sendmail-disable
  76. @echo "Installing ${PREFIX}/sbin/${file}"
  77. @${SUBST_CMD} -c -m 0755 -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
  78. ${FILESDIR}/${file} ${PREFIX}/sbin/${file}
  79. .endfor
  80. ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/sendmail/
  81. .for file in access genericstable local-host-names mailertable relay-domains \
  82. trusted-users virtusertable
  83. @echo "Installing ${PREFIX}/share/examples/sendmail/${file}"
  84. @${SUBST_CMD} -m 0644 -c -o ${SHAREOWN} -g ${SHAREGRP} \
  85. ${FILESDIR}/${file} ${PREFIX}/share/examples/sendmail/${file}
  86. .endfor
  87. ${INSTALL_DATA_DIR} ${docdir}
  88. .for file in CACerts FAQ KNOWNBUGS LICENSE README RELEASE_NOTES
  89. ${INSTALL_DATA} ${WRKSRC}/${file} ${docdir}
  90. .endfor
  91. @echo "Installing ${docdir}/mailer.conf.sendmail"
  92. @${SUBST_CMD} -m 0644 -c -o ${SHAREOWN} -g ${SHAREGRP} \
  93. ${FILESDIR}/mailer.conf.sendmail ${docdir}/mailer.conf.sendmail
  94. ${INSTALL_DATA_DIR} ${docdir}/op
  95. .for file in op.me Makefile ${opfiles}
  96. ${INSTALL_DATA} ${WRKSRC}/doc/op/${file} ${docdir}/op
  97. .endfor
  98. ${INSTALL_DATA_DIR} ${docdir}/libmilter
  99. ${INSTALL_DATA} ${WRKSRC}/libmilter/docs/* ${docdir}/libmilter
  100. ${INSTALL_DATA_DIR} ${PREFIX}/share/sendmail
  101. cd ${WRKSRC}/cf && pax -rw -s '/.*${PATCHORIG:S@.@\.@g}$$//' . \
  102. ${PREFIX}/share/sendmail/
  103. cd ${WRKSRC} && pax -rw contrib ${PREFIX}/share/sendmail/
  104. ${INSTALL_DATA} -m 644 ${FILESDIR}/cf-Makefile \
  105. ${PREFIX}/share/sendmail/Makefile # XXX useful?
  106. ${INSTALL_DATA} ${WRKSRC}/cf/cf/openbsd-localhost.cf \
  107. ${PREFIX}/share/examples/sendmail/localhost.cf
  108. ${INSTALL_DATA} ${WRKSRC}/cf/cf/openbsd-proto.cf \
  109. ${PREFIX}/share/examples/sendmail/sendmail.cf
  110. ${INSTALL_DATA} ${WRKSRC}/cf/cf/openbsd-submit.cf \
  111. ${PREFIX}/share/examples/sendmail/submit.cf
  112. .include <bsd.port.mk>