[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Pseudo flavors?
I've gotten Courier-MTA to compile now, but I'm having some problems getting
Pseudo-flavors to work like I expect. When I compile, it creates all the
packages, but if I pkg_add courier-0.40.0.tgz and then try to pkg_add (for
example) courier-0.40.0-webmail.tgz, it complains that "other version
courier-0.40.0 is already installed". If I pkg_add
courier-0.40.0-webmail.tgz, it installs it by itself without installing the
core package first, which in theory should be a dependency. I tried to copy
the format in courier-imap and php4, which both use pseudo-flavors. I'm
compiling on 3.2-Release, Makefile pasted below. (It's ugly, be kind.)
# $OpenBSD
COMMENT= "mail server for maildir format mailboxes"
COMMENT-fax= "fax server module for courier"
COMMENT-imap= "imap server module for courier"
COMMENT-ldap= "ldap authentication module for courier"
COMMENT-maildrop= "mail filter module for courier"
COMMENT-mlm= "mailing list manager for courier"
COMMENT-mysql= "mysql authentication module for courier"
COMMENT-pgsql= "pgsql authentication module for courier"
COMMENT-pop3= "pop3 server module for courier"
COMMENT-webmail= "webmail server module for courier"
COURIERVER= 0.40.0.20021026
DISTNAME= courier-${COURIERVER}
EXTRACT_SUFX= .tar.bz2
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=courier/}
#MASTER_SITES= http://www.courier-mta.org/beta/courier/
MAINTAINER= Steve Shockley <steve.shockley@shockley.net>
HOMEPAGE= http://www.courier-mta.org/
# GPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
#FLAVORS= fax mysql ldap gpg expect
#FLAVOR?=
INSTALL_TARGET= install-strip install-perms
SEPARATE_BUILD= concurrent
SYSCONFDIR= /etc/courier
COURIERCONF= ${SYSCONFDIR}
COURIERSTATE= /var/spool/courier
SUBST_VARS= COURIERSTATE COURIERCONF COURIERVER
EXAMPLE_DIR= ${PREFIX}/share/examples/courier
USE_GMAKE= Yes
MAILUSER= smmsp
MAILGROUP= smmsp
MAILGID= 25
MAILUID= 25
SUBPACKAGE?=
FLAVOR?=
PSEUDO_FLAVORS+= fax imap maildrop mlm pop3 webmail
LIB_DEPENDS= gdbm.2::databases/gdbm
#BUILDRUN_DEP= ispell::textproc/ispell
CONFIGURE_ARGS= --disable-root-check \
--datadir=${PREFIX}/share/courier \
--with-authuserdb \
--sysconfdir=${COURIERCONF} \
--with-authdaemon \
--with-authdaemonvar=${COURIERSTATE} \
--enable-workarounds-for-imap-client-bugs \
--with-db=gdbm \
--enable-mimetypes=/var/www/conf/mime.types \
--prefix=$(PREFIX) \
--exec-prefix=${LOCALBASE} \
--localstatedir=${COURIERSTATE} \
--without-ipv6 \
--with-mailuser=${MAILUSER} \
--with-mailgroup=${MAILGROUP} \
--with-mailuid=${MAILUID} \
--with-mailgid=${MAILGID} \
--with-ispell \
--mandir=${PREFIX}/man
# Expect is only used for changing passwords in webmail.
# Building it requires X and tk/tcl, so I don't enable it by default.
#.if ${FLAVOR:L:Mexpect}
#BUILDRUN_DEP+= expect::lang/expect
#.endif
# Note: gpg and fax haven't been well-tested in this port.
#.if ${FLAVOR:L:Mgpg}
#BUILDRUN_DEP+= gnupg::security/gnupg
#.endif
# Don't use the standard OpenBSD port for mgetty+sendfax
# Instead, use the one at:
# http://marc.theaimsgroup.com/?l=openbsd-ports&m=101116192526792&w=2
PSEUDO_FLAVORS+= no_fax
.if ${FLAVOR:L:Mno_fax}
# There's no --without-fax option...
.else
MULTI_PACKAGES+= -fax
BUILDRUN_DEP+= netpbm::graphics/netpbm \
mgetty::myports/mgetty+sendfax \
ghostscript::print/ghostscript/gnu
.endif
# imap
PSEUDO_FLAVORS+= no_imap
.if ${FLAVOR:L:Mno_imap}
# There's no --without-imap option...
.else
MULTI_PACKAGES+= -imap
.endif
# maildrop
PSEUDO_FLAVORS+= no_maildrop
.if ${FLAVOR:L:Mno_maildrop}
# There's no --without-maildrop option...
.else
MULTI_PACKAGES+= -maildrop
.endif
# mlm
PSEUDO_FLAVORS+= no_mlm
.if ${FLAVOR:L:Mno_mlm}
# There's no --without-mlm option...
.else
MULTI_PACKAGES+= -mlm
.endif
# pop3
PSEUDO_FLAVORS+= no_pop3
.if ${FLAVOR:L:Mno_pop3}
# There's no --without-pop3 option...
.else
MULTI_PACKAGES+= -pop3
.endif
# webmail
PSEUDO_FLAVORS+= no_webmail
.if ${FLAVOR:L:Mno_webmail}
# There's no --without-webmail option...
.else
MULTI_PACKAGES+= -webmail
.endif
# mysql
PSEUDO_FLAVORS+= no_mysql
.if ${FLAVOR:L:Mno_mysql}
CONFIGURE_ARGS+= --without-authmysql
.else
MULTI_PACKAGES+= -mysql
CONFIGURE_ARGS+= --with-authmysql \
--with-mysql-libs=${LOCALBASE}/lib/mysql \
--with-mysql-includes=${LOCALBASE}/include/mysql
MYSQL_DEPENDS+=
lib/mysql/mysqlclient.10:mysql-client-3.23.*:databases/mysql
.endif
# openldap
PSEUDO_FLAVORS+= no_ldap
.if ${FLAVOR:L:Mno_ldap}
CONFIGURE_ARGS+= --without-authldap
.else
MULTI_PACKAGES+= -ldap
CONFIGURE_ARGS+= --with-authldap
LDAP_DEPENDS+= ldap.2,lber.2:openldap-client-2.*:databases/openldap
.endif
# postgresql
PSEUDO_FLAVORS+= no_pgsql
.if !${FLAVOR:L:Mno_pgsql}
MULTI_PACKAGES+= -pgsql
CONFIGURE_ARGS+= --with-pgsql-libs=${LOCALBASE}/lib \
--with-pgsql-includes=${LOCALBASE}/include/postgresq
l
PGSQL_DEPENDS+= pq.2::databases/postgresql
.endif
.if defined(PACKAGING) && !empty(SUBPACKAGE)
LIB_DEPENDS= ${${SUBPACKAGE:U:S/-//g}_DEPENDS}
RUN_DEPENDS= :courier-imap-${COURIERVER}:mail/courier-imap
.else
.for i in ${MULTI_PACKAGES}
LIB_DEPENDS+= ${${i:U:S/-//g}_DEPENDS}
.endfor
.endif
# Why do this? I don't want run_depends to include automake, etc.
RUN_DEPENDS= ${BUILDRUN_DEP}
BUILD_DEPENDS= ${BUILDRUN_DEP}
BUILD_DEPENDS+= :bzip2-*:archivers/bzip2
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib" \
CXXFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
CPPFLAGS="${CFLAGS} -I${LOCALBASE}/include"
post-extract:
@cp ${.CURDIR}/files/c_rehash ${WRKDIR}/bin
post-install:
@cd $(WRKBUILD)/courier && chmod +x perms.sh setperms.sh &&
MAKE=$(MAKE) ./setperms.sh "$(DESTDIR)"
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/courier
@mv $(WRKINST)$(COURIERCONF)/* $(EXAMPLE_DIR)
@cp $(WRKBUILD)/permissions.dat $(EXAMPLE_DIR)
@cp $(WRKSRC)/sysconftool $(PREFIX)/sbin/sysconftool
.for file in webadmin-password upgrade-courier
@sed -e "s,y0y0y0,${TRUEPREFIX},g" -e "s,y1y1y1,${COURIERCONF},g" -e
"s,y2y2y2,${MAILUSER},g" -e "s,y3y3y3,${MAILGROUP},g" ${FILESDIR}/${file} >
${PREFIX}/sbin/${file}
@chmod 555 ${PREFIX}/sbin/${file}
@chown root:wheel ${PREFIX}/sbin/${file}
.endfor
.for i in sendmail-remove sendmail-restore startcourier
${INSTALL_SCRIPT} ${FILESDIR}/$i ${PREFIX}/sbin
.endfor
.include <bsd.port.mk>