aboutsummaryrefslogtreecommitdiffstats
path: root/mail/quickml/Makefile
blob: 075e53e8838bb57380b20e55e6932da7fc3148fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# New ports collection makefile for:    quickml
# Date created:             11 June 2004
# Whom:                 Yuichiro AIZAWA <yaizawa@mdbl.sfc.keio.ac.jp>
#
# $FreeBSD$
#

PORTNAME=   quickml
PORTVERSION=    0.7
PORTREVISION=   4
CATEGORIES= mail
MASTER_SITES=   http://0xcc.net/quickml/

MAINTAINER= yaizawa@mdbl.sfc.keio.ac.jp
COMMENT=    An easy-to-use mailing list system

OPTIONS+=   ANALOG "Enable quickml-analog" on \
        LIMIT  "Enable Creators and Members Limitation Patch" off

PKGINSTALL= ${WRKDIR}/pkg-install

QUICKML_USER=   quickml
QUICKML_GROUP=  quickml

USE_AUTOTOOLS=  autoconf:259
GNU_CONFIGURE=  yes
USE_RUBY=   yes

USE_RC_SUBR=    yes
FILES_SUB=  USER=${QUICKML_USER} GROUP=${QUICKML_GROUP} \
        PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} RUBY=${RUBY}

CONFIGURE_ARGS+=    --datadir="${PREFIX}/share/quickml"
CONFIGURE_ARGS+=    --with-ruby="${RUBY}"
CONFIGURE_ARGS+=    --with-user="${QUICKML_USER}"
CONFIGURE_ARGS+=    --with-group="${QUICKML_GROUP}"
CONFIGURE_ARGS+=    --with-rubydir="${RUBY_LIBDIR}"

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_LIMIT)
PATCH_DIST_STRIP=   -p1
.endif

.if !defined(WITHOUT_ANALOG)
USE_GHOSTSCRIPT_RUN=    yes
RUN_DEPENDS+=   gnuplot:${PORTSDIR}/math/gnuplot \
        convert:${PORTSDIR}/graphics/ImageMagick
.endif

post-fetch:
.if !defined(WITHOUT_LIMIT)
    @ ( cd ${DISTDIR} && ${FETCH_CMD} -o ${PORTNAME}-${PORTVERSION}-limited.patch "http://linux.matchy.net/view.xcg?c=plugin;plugin=attach_download;p=QuickMLLimited;file_name=${PORTNAME}-${PORTVERSION}-limited.patch" )
.endif

post-patch:
.if !defined(WITHOUT_LIMIT)
    @${PATCH} ${PATCH_DIST_ARGS} < ${DISTDIR}/${PORTNAME}-${PORTVERSION}-limited.patch
.endif
    @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
        ${FILESDIR}/quickml.sh > ${WRKDIR}/quickml.sh
.if defined(WITHOUT_ANALOG)
    ${PATCH} ${PATCH_DIST_ARGS} < ${FILESDIR}/without_quickml-analog
.endif

pre-install:
    @${SED} ${FILES_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
        ${PKGDIR}/pkg-install > ${PKGINSTALL}
    @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL

post-install:
    ${MKDIR} ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/messages.ja ${DATADIR}
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/ml-usage.en.rd ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/quickml.en.rd ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/quickml.ja.rd ${DOCSDIR}
    ${INSTALL_DATA} ${FILESDIR}/with-mta.en.rd ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/with-mta.ja.rd ${DOCSDIR}
.endif
.if !exists(${PREFIX}/etc/rc.d/quickml.sh)
    @${ECHO} "Installing ${PREFIX}/etc/rc.d/quickml.sh startup file."
    ${INSTALL_SCRIPT} -m 751 ${WRKDIR}/quickml.sh ${PREFIX}/etc/rc.d/quickml.sh
.endif
    @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' -e 's|%%DOCSDIR%%|${DOCSDIR}|g' ${PKGMESSAGE}

.include <bsd.port.post.mk>