summaryrefslogtreecommitdiffstats
path: root/devel/icmake/Makefile
blob: f8a093ac1df0ffebe17ee746ca4e59cfba804c42 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# $FreeBSD$

PORTNAME=	icmake
PORTVERSION=	7.21.00
CATEGORIES=	devel
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}
DISTNAME=	${PORTNAME}_${PORTVERSION}
EXTRACT_SUFX=	.orig.tar.gz

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Intelligent C-like Maker

LICENSE=	GPLv3

BUILD_DEPENDS=	bash:${PORTSDIR}/shells/bash \
		gsed:${PORTSDIR}/textproc/gsed

DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
PORTDOCS=	*

PLIST_SUB+=	PORTVERSION="${PORTVERSION}"

WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}

REINPLACE_ARGS=	-I ""

USES=		shebangfix
SHEBANG_FILES=	icm_bootstrap icm_install icm_prepare scripts/convert

.include <bsd.port.options.mk>

post-patch:
	@${REINPLACE_CMD} -e 's|sed|gsed|g' \
		${WRKSRC}/scripts/conversions \
		${WRKSRC}/scripts/convert
	@${REINPLACE_CMD} -e 's|"usr/bin"|"bin"| ; \
		s|"usr/share/icmake"|"share/icmake-${PORTVERSION}"| ; \
		s|"usr/share/man"|"man"| ; \
		s|"usr/lib/icmake"|"lib/icmake-${PORTVERSION}"| ; \
		s|"usr/share/doc/icmake"|"share/doc/icmake-${PORTVERSION}"| ; \
		s|"usr/share/doc/icmake-doc"|"share/doc/icmake-${PORTVERSION}/doc"|' \
		${WRKSRC}/INSTALL.im
	@${REINPLACE_CMD} -e '\
		s|"ar"|"${AR}"| ; \
		s|"rsv"|"${ARFLAGS}"| ; \
		s|"gcc"|"${CC}"| ; \
		s|"gzip"|"${GZIP_CMD}"| ; \
		s|"cp"|"${CP}"| ; \
		s|"mkdir"|"${MKDIR}"| ; \
		s|"rm"|"${RM}"| ; \
		s|"strip"|"${STRIP_CMD}"|' \
		${WRKSRC}/def/programs
	@${REINPLACE_CMD} -e 's|cp -r|cp -R|' \
		${WRKSRC}/icm_bootstrap \
		${WRKSRC}/icm_install
	@${REINPLACE_CMD} -e 's|#!.*/usr/bin/icmake|#!${PREFIX}/bin/icmake|' \
		${WRKSRC}/comp/build \
		${WRKSRC}/doc/icmake.1 \
		${WRKSRC}/doc/manpage/icmake.yo \
		${WRKSRC}/doc/manpage/build \
		${WRKSRC}/examples/am \
		${WRKSRC}/examples/defines \
		${WRKSRC}/examples/ds \
		${WRKSRC}/examples/ftpxfer \
		${WRKSRC}/examples/initialization \
		${WRKSRC}/examples/nesteddirectives \
		${WRKSRC}/examples/r \
		${WRKSRC}/exec/build \
		${WRKSRC}/make/build \
		${WRKSRC}/pp/build \
		${WRKSRC}/rss/build \
		${WRKSRC}/un/build
	@${REINPLACE_CMD} -e 's|"gcc"|"${CC}"|g; s|-Wall -O2|${CFLAGS}|g' \
		${WRKSRC}/comp/build \
		${WRKSRC}/def/programs \
		${WRKSRC}/doc/icmake.doc \
		${WRKSRC}/exec/icmconf \
		${WRKSRC}/usr/share/icmake/icmconf \
		${WRKSRC}/exec/build \
		${WRKSRC}/make/build \
		${WRKSRC}/pp/build \
		${WRKSRC}/rss/build \
		${WRKSRC}/un/build
	@${REINPLACE_CMD} -e '\
		s|/usr/lib/icmake|${PREFIX}/lib/icmake-${PORTVERSION}|g; \
		s|/usr/share/icmake|${PREFIX}/share/icmake-${PORTVERSION}|g; \
		s|/etc/icmake/icmake.cf|${PREFIX}/etc/icmake/icmake.rc|g' \
		${WRKSRC}/etc/icmake/icmake.rc

do-build:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_bootstrap ${PREFIX}

do-install:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install strip progs ${STAGEDIR}
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install scripts ${STAGEDIR}
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install skel ${STAGEDIR}
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install etc ${STAGEDIR}
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install man ${STAGEDIR}
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install doc ${STAGEDIR}
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./icm_install docdoc ${STAGEDIR}

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