aboutsummaryrefslogtreecommitdiff
path: root/german/BBBike/Makefile
blob: f8b717a7e1809cbb4f2779d0946478cd6b165a3d (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
# Created by: Slaven Rezic <eserte@cs.tu-berlin.de>

PORTNAME=	BBBike
PORTVERSION=	3.18
PORTREVISION=	4
CATEGORIES=	german
MASTER_SITES=	SF/${PORTNAME:tl}/${PORTNAME}/${PORTVERSION}

MAINTAINER=	slaven@rezic.de
COMMENT=	Route-finder for cyclists in Berlin and Brandenburg

BUILD_DEPENDS=	p5-Inline-C>=0:devel/p5-Inline-C \
		p5-CDB_File>=0:databases/p5-CDB_File
RUN_DEPENDS=	p5-Tk>=0:x11-toolkits/p5-Tk \
		p5-Inline-C>=0:devel/p5-Inline-C \
		p5-CDB_File>=0:databases/p5-CDB_File

USES=		perl5 shebangfix
perl_OLD_CMD=	/usr/perl5.8.0/bin/perl5.8.0 perl
SHEBANG_FILES=	ESRI/Makefile.PL \
		ESRI/esri2bbd.pl \
		ESRI/t/shapefile.t \
		GIS/globe_to_bbd.pl \
		Makefile.PL \
		bbbikeapplet \
		cgi/*.cgi \
		cgi/bbbike.psgi \
		cgi/httpi \
		cgi/mksymlinks \
		cgi/runbbbikecgi \
		ext/BBBikeXS/Makefile.PL \
		ext/BBBikeXS/t/*.t \
		ext/Strassen-Inline/Makefile.PL \
		ext/Strassen-Inline/t/*.t \
		ext/Strassen-Inline/t/common.pl \
		ext/Strassen-Inline2/Makefile.PL \
		ext/Strassen-Inline2/t/*.t \
		ext/Strassen-Inline2/t/common.pl \
		ext/StrassenNetz-CNetFile/Makefile.PL \
		ext/StrassenNetz-CNetFile/t/base.t \
		ext/VectorUtil-Inline/Makefile.PL \
		ext/VectorUtil-Inline/t/*.t \
		ext/VirtArray/Makefile.PL \
		lib/parse_wetterkarte \
		miscsrc/*.pl \
		tkbikepwr
POD2MAN=	pod2man

MYDESTDIR=	${STAGEDIR}${PREFIX}/BBBike

.include <bsd.port.pre.mk>

# The following != assignment will generate a warning
# with portlint et al. Problem is that the nearest
# replacements ${PERL_VER}/${PERL_ARCH} do not work here:
# the value of PERL_ARCH is always "mach" on FreeBSD systems,
# but $Config{archname} here is something like "amd64-freebsd"
.if exists(${PERL5})
LOCAL_PERL_ARCH!=	${PERL5} -MConfig -e '$$x = qq{$$Config{version}/$$Config{archname}}; $$x =~ s{/}{\\\\/}g; print $$x'
.endif
PLIST_SUB+=		LOCAL_PERL_ARCH=${LOCAL_PERL_ARCH}
BBBIKE_PERL_EXE=	bbbike cbbbike bbbikeclient cmdbbbike smsbbbike

post-patch:
	@${RM} ${WRKSRC}/tmp/.keep_me

do-build:
	cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL} all install
	cd ${WRKSRC}/ext && ${MAKE} PERL=${PERL} clean
	${FIND} ${WRKSRC}/lib -name "*.so" | ${XARGS} ${CHMOD} u+w
	${FIND} ${WRKSRC}/lib -name "*.so" | ${XARGS} ${STRIP_CMD}
	${FIND} ${WRKSRC}/lib -name "*.so" | ${XARGS} ${CHMOD} u-w
	cd ${WRKSRC}; ${POD2MAN} --lax bbbike.pod > bbbike.1
.for f in ${BBBIKE_PERL_EXE}
	${MV} ${WRKSRC}/$f ${WRKSRC}/$f.tmp
	${ECHO_CMD} "#! ${PERL}" > ${WRKSRC}/$f
	${CAT} ${WRKSRC}/$f.tmp >> ${WRKSRC}/$f
	${RM} ${WRKSRC}/$f.tmp
	${CHMOD} 0755 ${WRKSRC}/$f
.endfor

do-install:
	-${RM} -r ${MYDESTDIR}
	${INSTALL_MAN} ${WRKSRC}/bbbike.1 ${STAGEDIR}${PREFIX}/man/man1
	${FIND} ${WRKSRC} | ${XARGS} ${CHMOD} ugo+r
	${FIND} ${WRKSRC} -perm -u=x | ${XARGS} ${CHMOD} go+x
	${CP} -rp ${WRKSRC} ${MYDESTDIR}
	${RM} ${MYDESTDIR}/bbbike.1
.for f in ${BBBIKE_PERL_EXE}
	-${RM} ${STAGEDIR}${PREFIX}/bin/$f
	${LN} -s  ../BBBike/$f ${STAGEDIR}${PREFIX}/bin/$f
.endfor

.include <bsd.port.post.mk>