aboutsummaryrefslogtreecommitdiffstats
path: root/news/newsstar/Makefile
blob: 99b90cdfc8dba532d96e2c1217c087a0a640e12b (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
89
90
91
92
93
94
95
96
97
98
# Created by: Andrey Slusar <anray@FreeBSD.org>
# $FreeBSD$

PORTNAME=   newsstar
PORTVERSION=    1.5.6
CATEGORIES= news
MASTER_SITES=   SF

MAINTAINER= mandree@FreeBSD.org
COMMENT=    Transfer news between a local NNTP server (INN, sn, s-news)

LICENSE=    GPLv3

LIB_DEPENDS=    gdbm:${PORTSDIR}/databases/gdbm
BUILD_DEPENDS=  xmlto:${PORTSDIR}/textproc/xmlto \
        ${LOCALBASE}/share/xml/docbook/4.5/docbookx.dtd:${PORTSDIR}/textproc/docbook-xml

USE_PERL5=  yes
GNU_CONFIGURE=  yes
USES=       iconv
MAKE_JOBS_SAFE= yes

OPTIONS_DEFINE=     SSL
OPTIONS_DEFAULT=    SSL

CONFIGURE_ARGS+=--prefix=${PREFIX} \
        --with-conf-dir=${PREFIX}/etc/newsstar \
        --with-rc-dir=/var/spool/newsstar/lib \
        --with-incoming-dir=/var/spool/newsstar/incoming

CONFIGURE_ENV=  LIBS="-L${LOCALBASE}/lib"
CPPFLAGS+=  -I${LOCALBASE}/include

.include <bsd.port.options.mk>

.if ! ${PORT_OPTIONS:MDOCS}
INSTALL_TARGET= install-am
.endif

.if ${PORT_OPTIONS:MSSL}
USE_OPENSSL=    yes
.else
CONFIGURE_ARGS+=--disable-ssl
.endif

.include <bsd.port.pre.mk>

.if exists(/var/spool/s-news)
CONFIGURE_ARGS+=--with-spool-dir=/var/spool/s-news \
        --with-snews-outgoing-dir=${LOCALBASE}/etc/s-news/suck
.endif

.if exists(${LOCALBASE}/sbin/snntpd)
CONFIGURE_ARGS+=--with-sn-spool-dir=/var/spool/news \
        --with-sn-articles-dir=/var/spool/news \
        --with-outgoing-dir=/var/spool/news/.outgoing
.endif

.if exists(${LOCALBASE}/news/bin/innconfval)
CONFIGURE_ARGS+=--with-inn-path=${LOCALBASE}/news/bin
.endif

MAN1=       newsstar.1
DOCS=       AUTHORS INSTALL NEWS README TODO docs/QuickStart docs/manual.txt \
        docs/index.html docs/ar01s02.html docs/ar01s03.html docs/ar01s04.html \
        docs/ar01s05.html docs/ar01s06.html docs/ar01s07.html docs/ar01s08.html \
        docs/ar01s09.html docs/ar01s10.html docs/ar01s11.html docs/ar01s12.html \
        docs/news.html

EX_CONFIGS= cf.server.sample curses.cf.sample filter.pl.sample main.cf.sample \
        master.ignore.sample master.score.sample newsrc.sample

pre-install:
    ${MKDIR} ${PREFIX}/lib/${PORTNAME}

post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
    ${MKDIR} ${EXAMPLESDIR}
.for i in ${EX_CONFIGS}
    ${INSTALL_DATA} ${WRKSRC}/sample_config/${i} ${EXAMPLESDIR}
.endfor
.endif
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${DOCSDIR}
.for i in ${DOCS}
    ${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.else
    ${MAKE} -C ${WRKSRC}/src install
    ${MAKE} -C ${WRKSRC}/docs install-man
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/share/sgml/docbook/dtd/xml|${LOCALBASE}/share/xml/docbook|' ${WRKSRC}/docs/manual.xml
    @${REINPLACE_CMD} -e 's|/usr/share/sgml/docbook/dtd/xml|${LOCALBASE}/share/xml/docbook|' ${WRKSRC}/docs/news.xml
    @${REINPLACE_CMD} -e 's|install-data-local: install-docs|install-data-local:|' ${WRKSRC}/Makefile.in

.include <bsd.port.post.mk>