Update deskutils/treesheets to version 0.0.20150711
[dports.git] / x11-themes / kde-icons-noia / Makefile.icons
1 # Created by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
2 # $FreeBSD$
3
4 CATEGORIES?=    x11-themes kde
5 PKGNAMEPREFIX=  kde-icons-
6 DIST_SUBDIR=    KDE
7
8 MAINTAINER?=    ports@FreeBSD.org
9 COMMENT?=       KDE iconset theme
10
11 NO_BUILD=       yes
12
13 # default installation directory
14 PORT_SHAREDIR?= ${DISTNAME}
15
16 .ifndef(WITHOUT_RESTRICTIONS)
17 RESTRICTED?=    It may contain iconic, visual, graphical or other\
18                 elements that may not be distributed without the\
19                 consent of either the trademark or the patent holder
20 .endif
21
22 INDEX_FILES=    index.desktop index.theme
23
24 # do not create some dirs
25 PLIST_DIR_PATTERN=      -v ^\.$$
26 PLIST_DIR_PATTERN_EXTRA?=       ^\./
27
28 # do not install some files
29 PLIST_FILE_PATTERN=     -i -v "(Thumbs\.db|(\.(bak|txt)|/(copying|readme))\$$)"
30 PLIST_FILE_PATTERN_EXTRA?=      .
31
32 post-patch:
33 # correctly inherits crystal per default
34 .for file in ${INDEX_FILES}
35         @if [ -f ${WRKSRC:Q}/${file:Q} ]; then \
36                 ${REINPLACE_CMD} -E \
37                 -e 's|\r||' \
38                 -e 's|^Inherits.*$$|Inherits=crystalsvg|' \
39                 ${WRKSRC:Q}/${file:Q} ; \
40                 fi
41 .endfor
42
43 # annotate what should be installed
44 annotate-install:
45 # annotate dirs
46         @cd ${WRKSRC} ; ${FIND} . -type d ! -empty \
47                 | ${GREP} -E ${PLIST_DIR_PATTERN} \
48                 | ${GREP} -E ${PLIST_DIR_PATTERN_EXTRA} \
49                 | ${SORT} -r \
50                 > ${WRKDIR}/dirs.list
51 # annotate files
52         @cd ${WRKSRC} ; ${FIND} . -type f ! -empty \
53                 | ${GREP} -E ${PLIST_FILE_PATTERN} \
54                 | ${GREP} -E ${PLIST_FILE_PATTERN_EXTRA} \
55                 | ${SORT} \
56                 > ${WRKDIR}/files.list
57
58 # prepare scripts for installation based on aforementioned annotations
59 generate-install-scripts:
60 # annotate dirs
61         @${CAT} ${WRKDIR}/dirs.list \
62                 | ${SED} -E \
63                         -e 's|^\.(.+)$$|${MKDIR} -m 755 ${STAGEDIR}${PREFIX:Q}/share/icons/${PORT_SHAREDIR:S/"//g:Q}/\"\1\"|' \
64                         > ${WRKDIR}/dirs.sh
65 # annotate files
66         @${CAT} ${WRKDIR}/files.list \
67                 | ${SED} -E \
68                         -e 's|^\./(.+)$$|${INSTALL_DATA} ${WRKSRC:Q}/\"\1\" ${STAGEDIR}${PREFIX:Q}/share/icons/${PORT_SHAREDIR:S/"//g:Q}/\"\1\"|' \
69                         > ${WRKDIR}/files.sh
70
71 # generate on the fly packaging lists based on aforementioned annotations
72 generate-tmpplist:
73 # annotate files
74         @${CAT} ${WRKDIR}/files.list \
75                 | ${SED} -E \
76                         -e 's|^\.|share/icons/${PORT_SHAREDIR:S/"//g}|' \
77                         > ${TMPPLIST}
78
79 # use generated installation scripts
80 install-run-scripts:
81 .for script in dirs files
82         @${SH} ${WRKDIR}/${script}.sh
83 .endfor
84
85 do-install: annotate-install generate-install-scripts generate-tmpplist install-run-scripts
86
87 .include <bsd.port.pre.mk>
88
89 .if ${ARCH} == "powerpc" && ${PORTNAME} == "crystal-project"
90 BROKEN=         Does not install on powerpc: syntax error in files.sh
91 .endif
92
93 .include <bsd.port.post.mk>