summaryrefslogtreecommitdiffstats
path: root/comms/ncid/Makefile
blob: 27d7b62a4cef429c35cd258011cdcbd262faf2b3 (plain)
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
# Created by: David
# $FreeBSD$

PORTNAME=	ncid
PORTVERSION=	1.0
CATEGORIES=	comms
MASTER_SITES=	SF
DISTNAME=	${PORTNAME}-${PORTVERSION}-src

MAINTAINER=	cpm@fbsd.es
COMMENT=	Network based Caller ID package

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/doc/LICENSE

USES=		gmake perl5 tk
ALL_TARGET=	local
MAKE_ARGS=	WISH=${WISH} TCLSH=${TCLSH}
INSTALL_TARGET=	freebsd-install
MAKE_JOBS_UNSAFE=	yes

SUB_FILES=	pkg-message

OPTIONS_DEFINE=	DOCS

WRKSRC=	${WRKDIR}/${PORTNAME}
PORTDOCS=	CHANGES CONTRIBUTORS.md Devices.md Documentation.md FAQ.md Gateways.md \
		GettingStarted.md INSTALL-Cygwin.md INSTALL-Fedora.md INSTALL-FreeBSD.md \
		INSTALL-Mac.md INSTALL-Raspbian.md INSTALL-Redhat.md INSTALL-TiVo.md \
		INSTALL-Ubuntu.md INSTALL-Win.md INSTALL.md LICENSE Makefile Modems.md \
		NCID-API.odt NCID-SDK.md NCID_Documentation.md README.docdir ReleaseNotes.md \
		TODO.md Verbose.md mk-epub ncid-1.jpg

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|=|+=|' ${WRKSRC}/Makefile
# Respect PREFIX/MANPREFIX/DATADIR
	${REINPLACE_CMD} -e 's|prefix.*= /usr/local|prefix=$${PREFIX}|g' \
		-e 's|$$(prefix)/bin|$${PREFIX}/bin|g' \
		-e 's|$$(prefix)/sbin|$${PREFIX}/sbin|g' \
		-e 's|$$(prefix)/share|$${PREFIX}/share|g' \
		-e 's|$$(SHARE)/man|$${MANPREFIX}/man/|g' \
		-e 's|$$(SHARE)/ncid|$${DATADIR}|g' ${WRKSRC}/Makefile

do-install:
	${MKDIR} ${STAGEDIR}${ETCDIR}
	${INSTALL_PROGRAM} ${WRKSRC}/server/ncidd ${STAGEDIR}${PREFIX}/sbin
	${INSTALL_PROGRAM} ${WRKSRC}/gateway/sip2ncid ${STAGEDIR}${PREFIX}/sbin
	${INSTALL_DATA} ${WRKSRC}/client/ncid ${STAGEDIR}${PREFIX}/bin
.for f in ncid2ncid rn2ncid yac2ncid wc2ncid
	${INSTALL_DATA} ${WRKSRC}/gateway/${f} ${STAGEDIR}${PREFIX}/bin
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ncid2ncid
.endfor
	${INSTALL_DATA} ${WRKSRC}/client/ncid.gif ${STAGEDIR}${PREFIX}/share/pixmaps/ncid
.for g in ncid-page ncid-samba ncid-speak ncid-mythtv ncid-kpopup ncid-skel \
ncid-alert ncid-yac ncid-initmodem ncid-notify ncid-wakeup
	${INSTALL_DATA}	${WRKSRC}/modules/${g} ${STAGEDIR}${PREFIX}/share/ncid
.endfor
	${INSTALL_DATA} ${WRKSRC}/server/ncidd.alias ${STAGEDIR}${ETCDIR}
.for h in cidcall cidalias cidupdate wct ncidutil
	${INSTALL_DATA} ${WRKSRC}/tools/${h} ${STAGEDIR}${PREFIX}/bin
.endfor
.for i in ncidd ncid2ncid rn2ncid sip2ncid wc2ncid yac2ncid ncid-mythtv ncid-notify \
ncid-page ncid-samba ncid-speak ncid-yac ncid-initmodem
	${INSTALL_DATA} ${WRKSRC}/FreeBSD/${i} ${STAGEDIR}${PREFIX}/etc/rc.d
.endfor
	${INSTALL_MAN} ${WRKSRC}/man/*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
	${INSTALL_MAN} ${WRKSRC}/man/*.5 ${STAGEDIR}${MAN5PREFIX}/man/man5
	${INSTALL_MAN} ${WRKSRC}/man/*.7 ${STAGEDIR}${MAN7PREFIX}/man/man7
	${INSTALL_MAN} ${WRKSRC}/man/*.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
do-install-DOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
.for j in ${PORTDOCS}
	${INSTALL_DATA} ${WRKSRC}/doc/${j} ${STAGEDIR}${DOCSDIR}
.endfor

.include <bsd.port.mk>
OpenPOWER on IntegriCloud