aboutsummaryrefslogtreecommitdiffstats
path: root/comms/ncid/Makefile
blob: 9bdac37ae1a2e95af8301270d02b316fa069ba08 (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
# New ports collection makefile for:   ncid
# Date created:        06 June 2005
# Whom:                David
#
# $FreeBSD$
#

PORTNAME=   ncid
PORTVERSION=    0.72.1
PORTREVISION=   1
CATEGORIES= comms
MASTER_SITES=   SF
DISTNAME=   ${PORTNAME}-${PORTVERSION}-src

MAINTAINER= adox@mcx2.org
COMMENT=    Network based Caller ID package

USE_TK= yes
WRKSRC=     ${WRKDIR}/${PORTNAME}
MAN1=       ncid.1 ncidrotate.1 yac2ncid.1 ncidmodules.1 ncidtools.1
MAN5=       ncid.conf.5 ncidmodules.conf.5 ncidd.alias.5 sip2ncid.conf.5 ncidd.conf.5 yac2ncid.conf.5
MAN8=       ncidd.8 ncidsip.8 sip2ncid.8

USE_GMAKE=  yes
ALL_TARGET= local
MAKE_ARGS=  WISH=${WISH} TCLSH=${TCLSH}
INSTALL_TARGET= freebsd-install
SUB_FILES=  pkg-message

post-extract:
    @cd ${WRKSRC}/FreeBSD;for i in *.rc; do \
        x=`echo $$i | cut -f 1 -d .`; ${CP} $$i $$x; done

post-patch:
    @${GREP} -lr 'etc/ncid' ${WRKSRC}/|${XARGS} ${REINPLACE_CMD} -Ee\
        's,(/usr/local/etc/ncid|/etc/ncid),${ETCDIR},g'
    @${FIND} ${WRKSRC}/ -name Makefile|${XARGS} ${REINPLACE_CMD} -Ee\
        '/install:/s,install-(etc|logrotate),,'
    @${REINPLACE_CMD} -Ee '/mkdir.*(INIT|ROTATE|BIN|LOG|ETC)/d;\
        /CFLAGS.*=/s|=|+=|;s|-O||' ${WRKSRC}/Makefile

post-install:
    @${INSTALL} -d ${ETCDIR}/
    @cd ${WRKSRC};for i in *.alias *.conf scripts/*.conf;do\
        ib=`basename $$i`;\
        ${INSTALL_DATA} $$i ${ETCDIR}/$$ib.dist;\
        ${CP} -n ${ETCDIR}/$$ib.dist ${ETCDIR}/$$ib;\
        ${ECHO_CMD} "@unexec cd %D/${ETCDIR_REL}/;! cmp -s $$ib $$ib.dist||\
            ${RM} -f $$ib">>${TMPPLIST};\
        ${ECHO_CMD} "${ETCDIR_REL}/$$ib.dist">>${TMPPLIST};\
        ${ECHO_CMD} "@exec ${CP} -n %D/%F %D/${ETCDIR_REL}/$$ib">>${TMPPLIST};\
    done
    @${ECHO_CMD} "@unexec ${RMDIR} %D/${ETCDIR_REL} 2>/dev/null || true">>${TMPPLIST}
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>