Tweak x11-toolkits/p5-Wx version 0.99.23_2
[dports.git] / x11-toolkits / tkshape / Makefile
1 # Created by: nivit@users.sourceforge.net
2 # $FreeBSD$
3
4 PORTNAME=               tkshape
5 PORTVERSION=            0.4
6 PORTREVISION=           2
7 CATEGORIES=             x11-toolkits
8 MASTER_SITES=           http://www.cs.man.ac.uk/~fellowsd/tcl/ \
9                         http://nivi.interfree.it/distfiles/${PORTNAME}/${PORTVERSION}/
10 DISTNAME=               shape${PORTVERSION:S/.//g}
11
12 MAINTAINER=             nivit@FreeBSD.org
13 COMMENT=                Tk library to access to X Shaped Window Extension
14
15 USES=                   gmake tk:85+
16
17 USE_XORG=               x11 xext
18
19 PLIST_SUB=              PORTNAME="${PORTNAME}"
20
21 USE_LDCONFIG=           yes
22
23 OPTIONS_DEFINE=         MANPAGES
24 OPTIONS_DEFAULT=        MANPAGES
25 MANPAGES_DESC=  Install manual pages
26
27 .include <bsd.port.options.mk>
28
29 .if ${PORT_OPTIONS:MMANPAGES}
30 PLIST_SUB+=             MAN=""
31 .else
32 PLIST_SUB+=             MAN="@comment "
33 .endif
34
35 WRKSRC=                 ${WRKDIR}/${PORTNAME:C/^tk//1}${PORTVERSION}
36
37 GNU_CONFIGURE=          yes
38 CONFIGURE_ARGS=         --with-tclconf=${TCL_LIBDIR} \
39                         --with-tkconf=${TK_LIBDIR}
40 CONFIGURE_WRKSRC=       ${WRKSRC}/unix
41 BUILD_WRKSRC=           ${CONFIGURE_WRKSRC}
42
43 WHERE_REPLACE=          ${WRKSRC}/demos
44 REPLACE_FILES=          ${WHERE_REPLACE}/dragger.tcl \
45                         ${WHERE_REPLACE}/fancytext.tcl \
46                         ${WHERE_REPLACE}/fingerprint.tcl
47
48 post-patch: .SILENT
49         for FILE in ${REPLACE_FILES}; do \
50                 ${REINPLACE_CMD} -e "/%%WISH%%/s//${WISH:S/\//\\\//g}/g" \
51                 $${FILE}; \
52         done;
53         ${REINPLACE_CMD} -E 's,(^CFLAGS = )-g,\1${CFLAGS},' \
54                 ${BUILD_WRKSRC}/Makefile.in
55
56 FIND_DIRS=              -type d \! -empty
57 FIND_DEMOS=             demos -type f -and -name "*.tcl" -maxdepth 1
58 FIND_IMAGES=            demos/images -type f \
59                         -and \( -name "*.gif" -or -name "*.xbm" \
60                         -or -name "*.cur" \)
61
62 TARGET_DIR=             ${STAGEDIR}${PREFIX}/lib/${PORTNAME}
63 MANPAGES=               CombShape.3 QuryShape.3 shape.n
64
65 do-install:
66 # script, library
67         cd ${WRKSRC}; \
68         ${MKDIR} ${TARGET_DIR}/demos; \
69         FILES=$$(${FIND} ${FIND_DEMOS}); \
70         for FILE in $${FILES}; do \
71                 ${INSTALL_SCRIPT} $${FILE} ${TARGET_DIR}/$${FILE}; \
72         done; \
73         ${INSTALL_SCRIPT} unix/libshape04.so.1.0 ${TARGET_DIR}/libshape04.so.1;
74
75 # images, pkgIndex.tcl
76         cd ${WRKSRC}; \
77         ${MKDIR} ${TARGET_DIR}/demos/images; \
78         FILES=$$(${FIND} ${FIND_IMAGES}); \
79         for FILE in $${FILES}; do \
80                 ${INSTALL_DATA} $${FILE} ${TARGET_DIR}/$${FILE}; \
81         done; \
82         ${INSTALL_DATA} unix/pkgIndex.tcl ${TARGET_DIR}/pkgIndex.tcl;
83
84 # manpages
85 .if ${PORT_OPTIONS:MMANPAGES}
86         cd ${WRKSRC}; \
87         for m in ${MANPAGES} ; do \
88             s=$${m##*.}; \
89             ${INSTALL_MAN} doc/$${m} ${STAGEDIR}${PREFIX}/man/man$${s}/$${m}; \
90         done;
91 .endif
92
93 .include <bsd.port.mk>