Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Help with packages/modules/flavors

From: Steve Shockley <steve.shockley(at)shockley.net>
Date: Sat Nov 30 2002 - 14:41:28 EST


I've almost got Courier-MTA working the way I want, except I can't get the dependencies right. I've pasted my current Courier-MTA makefile below. Right now, I can install -fax and it installs without the base package, and if I install the base package, it requires itself and recurses until the machine runs out of memory.

I guess the part I'm still fuzzy on is the difference between a subpackage, pseudo_flavor, packaging, multi_package and module. My goal is to have Courier work like the php4 port, where you can add in modules after the fact and not have 31 flavors.

I know there's something dumb here that I'm missing, but I've been staring at it too long. Can somebody straighten me out on this?

# $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.1
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 
HOMEPAGE=       
http://www.courier-mta.org/

# GPL

PERMIT_PACKAGE_CDROM=   Yes
PERMIT_PACKAGE_FTP=     Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP=   Yes

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?=

LIB_DEPENDS+=   gdbm.2::databases/gdbm
BUILD_DEPENDS+= gnupg::security/gnupg
RUN_DEPENDS+=   gnupg::security/gnupg
Do you need help?X

# You can enable these if you want, but they take forever to compile. # Expect is only used for changing passwords in webmail and requires X and tk/tcl
# Ispell always seems to take forever to download and is only used for webmail.

#BUILD_DEPENDS= ispell::textproc/ispell \
#               expect::lang/expect
#RUN_DEPENDS+=  ispell::textproc/ispell \
#               expect::lang/expect
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} \
Do you need more help?X
--with-mailgid=${MAILGID} \ --with-ispell \ --mandir=${PREFIX}/man PSEUDO_FLAVORS+= no_fax no_imap no_maildrop no_mlm no_pop3 no_webmail
no_mysql no_ldap no_pgsql
FLAVOR?=
MULTI_PACKAGES=
.if !${FLAVOR:L:Mno_imap}

MULTI_PACKAGES+= -imap
.endif

.if !${FLAVOR:L:Mno_maildrop}

MULTI_PACKAGES+= -maildrop
.endif

.if !${FLAVOR:L:Mno_mlm}

MULTI_PACKAGES+= -mlm
.endif

.if !${FLAVOR:L:Mno_pop3}

MULTI_PACKAGES+= -pop3
.endif

.if !${FLAVOR:L:Mno_webmail}

MULTI_PACKAGES+= -webmail
.endif

# 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 BUILD_DEPENDS+= ${MYSQL_DEPENDS}
.endif

# openldap
.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
BUILD_DEPENDS+=         ${LDAP_DEPENDS}

.endif

# postgresql
.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
BUILD_DEPENDS+=         ${PGSQL_DEPENDS}

.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

.if !${FLAVOR:L:Mno_fax}
MULTI_PACKAGES+= -fax FAX_DEPENDS+= ::graphics/netpbm \ ::myports/mgetty+sendfax \ ::print/ghostscript/gnu BUILD_DEPENDS+= ${FAX_DEPENDS}

.endif
Can we help you?X

CONFIGURE_STYLE= gnu
CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib" \

                CXXFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
                CPPFLAGS="${CFLAGS} -I${LOCALBASE}/include"

.for i in ${MULTI_PACKAGES}
FULLPKGNAME${i}= courier${i}-${COURIERVER}

.endfor

.if defined(PACKAGING) && !empty(SUBPACKAGE)

        @echo "foo"
MODULE_NAME=            ${SUBPACKAGE:S/-//g}
LIB_DEPENDS=            ${${MODULE_NAME:U}_DEPENDS}
#LIB_DEPENDS=           ${${SUBPACKAGE:U:S/-//g}_DEPENDS}
#RUN_DEPENDS=           :courier-${COURIERVER}:myports/courier
#RUN_DEPENDS=           :courier-${COURIERVER}:mail/courier
SUBST_VARS=             MODULE_NAME

.elif defined(PACKAGING) && empty(SUBPACKAGE)
Can't find what you're looking for?X

@echo "bar" LIB_DEPENDS= #MESSAGE= ${PKGDIR}/DESCR SUBST_VARS= COURIERVER

.else
.for i in ${MULTI_PACKAGES}
        @echo "baz"
#LIB_DEPENDS+=          ${${i:U:S/-//g}_DEPENDS}

.endfor
.endif

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

Don't know where to look next?X

.include <bsd.port.mk>
Received on Sat Nov 30 14:42:19 2002

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:38:18 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library