diff options
Diffstat (limited to 'mail/imap-uw/Makefile')
-rw-r--r-- | mail/imap-uw/Makefile | 219 |
1 files changed, 90 insertions, 129 deletions
diff --git a/mail/imap-uw/Makefile b/mail/imap-uw/Makefile index 71eede37e6d..75c9bcaf6d4 100644 --- a/mail/imap-uw/Makefile +++ b/mail/imap-uw/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.110 2006/03/04 21:30:00 jlam Exp $ +# $NetBSD: Makefile,v 1.111 2006/07/26 20:00:27 jlam Exp $ # # ATTENTION: # The Kerberos support in this software is known to be problematic. If you @@ -7,6 +7,7 @@ DISTNAME= imap-2004g PKGNAME= ${DISTNAME:S/-/-uw-/} +PKGREVISION= 1 CATEGORIES= mail MASTER_SITES= ftp://ftp.cac.washington.edu/imap/ EXTRACT_SUFX= .tar.Z @@ -15,162 +16,122 @@ MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://www.washington.edu/imap/ COMMENT= University of Washington's IMAP, POP2, and POP3 servers -USE_LIBTOOL= yes - -INST_PROG= ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} -INST_LIB= ${LIBTOOL} --mode=install ${INSTALL_LIB} -INC_DIR= ${PREFIX}/include/c-client -LIB_DIR= ${PREFIX}/lib -DOC_DIR= ${PREFIX}/share/doc/imap-uw +USE_LIBTOOL= yes +MAKE_ENV+= LIBTOOL=libtool +MAKE_ENV+= LTCOMPILE="libtool --mode=compile" +MAKE_ENV+= LTLINK="libtool --mode=link" +LTINSTALL_PROGRAM= ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} +LTINSTALL_LIB= ${LIBTOOL} --mode=install ${INSTALL_LIB} .include "../../mk/bsd.prefs.mk" -.if ${OPSYS} == "SunOS" -BUILD_TARGET= gso -.elif ${OPSYS} == "Linux" -BUILD_TARGET= slx -.elif ${OPSYS} == "Darwin" -BUILD_TARGET= osx -.elif ${OPSYS} == "IRIX" +# Each platform has its own special target in the imap Makefiles. +OPSYSVARS+= BUILD_TARGET +BUILD_TARGET.SunOS= gso +BUILD_TARGET.Linux= slx +BUILD_TARGET.Darwin= osx +.if ${OPSYS} == "IRIX" . if ${OS_VERSION} >= 6.5 -BUILD_TARGET= sg6 +BUILD_TARGET.IRIX= sg6 . else -BUILD_TARGET= sgi +BUILD_TARGET.IRIX= sgi . endif -.elif ${OPSYS} == "OSF1" -BUILD_TARGET= osf -.elif ${OPSYS} == "OpenBSD" -BUILD_TARGET= bso -.else -BUILD_TARGET= neb .endif +BUILD_TARGET.OSF1= osf +BUILD_TARGET.OpenBSD= bso +BUILD_TARGET.*= neb + +MESSAGE_SRC= ${PKGDIR}/MESSAGE .include "options.mk" -BUILD_DEFS+= IMAP_UW_CCLIENT_MBOX_FMT IMAP_UW_MAILSPOOLHOME -CCLIENT_INCS= c-client.h env.h env_unix.h flocksim.h flstring.h \ - fs.h ftl.h imap4r1.h linkage.c linkage.h mail.h misc.h \ - netmsg.h newsrc.h nl.h nntp.h osdep.h rfc822.h \ - smtp.h tcp.h utf8.h -CCLIENT_LIB= libc-client.la -CCLIENT_PICLIB= libc-client_pic.a -CCLIENT_MAJOR= 4 -CCLIENT_MINOR= 3 -CCLIENT_MFILES= src/imapd/Makefile \ - src/ipopd/Makefile \ - src/mtest/Makefile \ - src/osdep/unix/Makefile - -MESSAGE_SUBST+= SSLCERTS=${SSLCERTS:Q} -MESSAGE_SUBST+= SSLKEYS=${SSLKEYS:Q} -PLIST_SUBST+= CCLIENT_MAJOR=${CCLIENT_MAJOR:Q} -PLIST_SUBST+= CCLIENT_MINOR=${CCLIENT_MINOR:Q} - -MANFILES= src/imapd/imapd.8 src/ipopd/ipopd.8 - -MAKE_ENV+= SSLDIR=${SSLBASE:Q} -MAKE_ENV+= SSLCERTS=${SSLCERTS:Q} -MAKE_ENV+= SSLKEYS=${SSLKEYS:Q} -MAKE_ENV+= CCLIENT_MAJOR=${CCLIENT_MAJOR:Q} -MAKE_ENV+= CCLIENT_MINOR=${CCLIENT_MINOR:Q} -MAKE_ENV+= CREATEPROTO=${IMAP_UW_CCLIENT_MBOX_FMT:Q}proto - -BUILD_TARGET+= CC="${LIBTOOL} ${CC}" -BUILD_TARGET+= EXTRALDFLAGS="${LDFLAGS}" -BUILD_TARGET+= EXTRACFLAGS="${CFLAGS}" - -# reduce optimization level on alpha to avoid compiler bugs -.if ${OPSYS} == "NetBSD" -. if ${MACHINE_ARCH} == "alpha" -CPPFLAGS:= ${CPPFLAGS:C/-O[0-9]*/-O/g} -CFLAGS:= ${CFLAGS:C/-O[0-9]*/-O/g} -CONFIGURE_ENV+= CPPFLAGS=${CPPFLAGS:M*:Q} -CONFIGURE_ENV+= CFLAGS=${CFLAGS:M*:Q} -. endif +# The defaults for these values are set in pkgsrc/mk/defaults/mk.conf. +#IMAP_US_CCLIENT_MBOX_FMT?= unix +#IMAP_US_MAILSPOOLHOME?= .Mailbox +BUILD_DEFS+= IMAP_UW_CCLIENT_MBOX_FMT IMAP_UW_MAILSPOOLHOME + +CCLIENT_LIB= libc-client.la +CCLIENT_PICLIB= libc-client_pic.a +CCLIENT_MAJOR= 4 +CCLIENT_MINOR= 3 +MAKE_ENV+= CCLIENT_MAJOR=${CCLIENT_MAJOR:Q} +MAKE_ENV+= CCLIENT_MINOR=${CCLIENT_MINOR:Q} + +EXTRASPECIALS+= CREATEPROTO=${IMAP_UW_CCLIENT_MBOX_FMT:Q}proto + +MAKE_FLAGS+= EXTRALDFLAGS=${LDFLAGS:Q} +MAKE_FLAGS+= EXTRACFLAGS=${CFLAGS:Q} +MAKE_FLAGS+= EXTRASPECIALS=${EXTRASPECIALS:Q} + +SUBST_CLASSES+= mbox +SUBST_STAGE.mbox= do-configure +SUBST_FILES.mbox= src/osdep/unix/env_unix.c +.if defined(IMAP_USE_MAILSPOOLHOME) +SUBST_SED.mbox= -e 's|@SPOOLDIR@|myhomedir ()|' \ + -e 's|@MAILBOX@|"${IMAP_UW_MAILSPOOLHOME}"|' +.else +SUBST_SED.mbox= -e 's|@SPOOLDIR@|MAILSPOOL|' \ + -e 's|@MAILBOX@|myusername ()|' .endif -INSTALLATION_DIRS+= bin libexec sbin ${PKGMANDIR}/man1 ${PKGMANDIR}/man8 - -post-extract: - # - # Change references to the built library to ${CCLIENT_LIB}. - # - cd ${WRKSRC}; for file in ${CCLIENT_MFILES}; do \ - ${MV} -f $${file} $${file}.orig; \ - ${SED} -e "s|c-client.a|${CCLIENT_LIB}|g" \ - $${file}.orig > $${file}; \ - ${RM} -f $${file}.orig; \ - done - # - # Correct hardcoded paths in man pages. - # - cd ${WRKSRC}; for FILE in ${MANFILES}; do \ - ${CP} $${FILE} $${FILE}.broken; \ - ${SED} -e "s|/usr/etc/imapd|${PREFIX}/libexec/imapd|g" \ +SUBST_CLASSES+= man +SUBST_STAGE.man= post-build +SUBST_FILES.man= src/imapd/imapd.8 src/ipopd/ipopd.8 +SUBST_SED.man= -e "s|/usr/etc/imapd|${PREFIX}/libexec/imapd|g" \ -e "s|/etc/rimapd|${PREFIX}/sbin/rimapd|g" \ -e "s|/usr/etc/ipop2d|${PREFIX}/libexec/ipop2d|g" \ - -e "s|/usr/etc/ipop3d|${PREFIX}/libexec/ipop3d|g" \ - $${FILE}.broken > $${FILE}; \ - done + -e "s|/usr/etc/ipop3d|${PREFIX}/libexec/ipop3d|g" -post-patch: -.if defined(IMAP_UW_MAILSPOOLHOME) - cd ${WRKSRC}/src/osdep/unix && \ - ${SED} -e 's|@SPOOLDIR@|myhomedir ()|' \ - -e 's|@MAILBOX@|"${IMAP_UW_MAILSPOOLHOME}"|' \ - env_unix.c > env_unix.c.new && \ - ${MV} -f env_unix.c.new env_unix.c -.else - cd ${WRKSRC}/src/osdep/unix && \ - ${SED} -e 's|@SPOOLDIR@|MAILSPOOL|' \ - -e 's|@MAILBOX@|myusername ()|' \ - env_unix.c > env_unix.c.new && \ - ${MV} -f env_unix.c.new env_unix.c -.endif +INSTALLATION_DIRS+= bin lib libexec sbin \ + ${PKGMANDIR}/man1 ${PKGMANDIR}/man8 # Generate _pic.a library from shared objects. -# post-build: cd ${WRKSRC}/c-client; \ ${LIBTOOL} --mode=link ${CC} -o ${CCLIENT_PICLIB:.a=.la} *.lo -do-install: - ${INSTALL_DATA_DIR} ${INC_DIR} - cd ${WRKSRC}/c-client; ${INSTALL_DATA} ${CCLIENT_INCS} ${INC_DIR} - ${INSTALL_LIB_DIR} ${LIB_DIR} - ${INST_LIB} ${WRKSRC}/c-client/${CCLIENT_LIB} ${LIB_DIR} - ${INSTALL_LIB} ${WRKSRC}/c-client/.libs/${CCLIENT_PICLIB} ${LIB_DIR} - ${RANLIB} ${LIB_DIR}/${CCLIENT_PICLIB} - cd ${LIB_DIR}; for file in libc-client.*; do \ - case $$file in \ - *.la) ;; \ - *) \ - f=`${ECHO} $${file} | ${SED} "s|libc-client|libimapuw|g"`; \ - ${TEST} -f $${file} && ${LN} -f $${file} $${f}; \ - ;; \ - esac; \ - done - ${INST_PROG} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec - ${INST_PROG} ${WRKSRC}/ipopd/ipop2d ${PREFIX}/libexec - ${INST_PROG} ${WRKSRC}/ipopd/ipop3d ${PREFIX}/libexec - ${INST_PROG} ${WRKSRC}/mtest/mtest ${PREFIX}/sbin +do-install: install-headers install-lib install-doc + ${LTINSTALL_PROGRAM} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec + ${LTINSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop2d ${PREFIX}/libexec + ${LTINSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop3d ${PREFIX}/libexec + ${LTINSTALL_PROGRAM} ${WRKSRC}/mtest/mtest ${PREFIX}/sbin ${LN} -sf ../libexec/imapd ${PREFIX}/sbin/rimapd ${INSTALL_MAN} ${WRKSRC}/src/imapd/imapd.8 ${PREFIX}/${PKGMANDIR}/man8 ${INSTALL_MAN} ${WRKSRC}/src/ipopd/ipopd.8 ${PREFIX}/${PKGMANDIR}/man8 ${LN} -sf ipopd.8 ${PREFIX}/${PKGMANDIR}/man8/ipop2d.8 ${LN} -sf ipopd.8 ${PREFIX}/${PKGMANDIR}/man8/ipop3d.8 - ${INSTALL_DATA_DIR} ${DOC_DIR} - ${CP} -R ${WRKSRC}/docs/* ${DOC_DIR} - ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOC_DIR} - ${FIND} ${DOC_DIR} -type d -print | ${XARGS} ${CHMOD} ${PKGDIRMODE} - ${FIND} ${DOC_DIR} -type f -print | ${XARGS} ${CHMOD} ${SHAREMODE} - - ${INST_PROG} ${WRKSRC}/mailutil/mailutil ${PREFIX}/bin + ${LTINSTALL_PROGRAM} ${WRKSRC}/mailutil/mailutil ${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/src/mailutil/mailutil.1 ${PREFIX}/${PKGMANDIR}/man1 - ${INST_PROG} ${WRKSRC}/dmail/dmail ${PREFIX}/bin + ${LTINSTALL_PROGRAM} ${WRKSRC}/dmail/dmail ${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/src/dmail/dmail.1 ${PREFIX}/${PKGMANDIR}/man1 - ${INST_PROG} ${WRKSRC}/mlock/mlock ${PREFIX}/bin - ${INST_PROG} ${WRKSRC}/tmail/tmail ${PREFIX}/bin + ${LTINSTALL_PROGRAM} ${WRKSRC}/mlock/mlock ${PREFIX}/bin + ${LTINSTALL_PROGRAM} ${WRKSRC}/tmail/tmail ${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/src/tmail/tmail.1 ${PREFIX}/${PKGMANDIR}/man1 +.PHONY: install-headers install-lib install-doc +install-headers: + ${INSTALL_DATA_DIR} ${PREFIX}/include/c-client + ${CAT} ${PKGDIR}/PLIST | \ + while read entry; do \ + case "$$entry" in \ + include/c-client/*) \ + src="${WRKSRC}/c-client/`${BASENAME} $$entry`"; \ + dest="${PREFIX}/$$entry"; \ + ${INSTALL_DATA} $$src $$dest; \ + esac; \ + done + +install-lib: + ${LTINSTALL_LIB} ${WRKSRC}/c-client/${CCLIENT_LIB} ${PREFIX}/lib + ${INSTALL_LIB} ${WRKSRC}/c-client/.libs/${CCLIENT_PICLIB} ${PREFIX}/lib + ${RANLIB} ${PREFIX}/lib/${CCLIENT_PICLIB} + +DOCDIR= ${PREFIX}/share/doc/${PKGBASE} +install-doc: + ${INSTALL_DATA_DIR} ${DOCDIR} + ${CP} -R ${WRKSRC}/docs/* ${DOCDIR} + ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DOCDIR} + ${FIND} ${DOCDIR} -type d -print | ${XARGS} ${CHMOD} ${PKGDIRMODE} + ${FIND} ${DOCDIR} -type f -print | ${XARGS} ${CHMOD} ${SHAREMODE} + .include "../../mk/bsd.pkg.mk" |