Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / pkgtools / x11-links / Makefile
blob4de7d12a1473046cf4d4823317698c4320a7b34f
1 # $NetBSD: Makefile,v 1.140 2013/02/24 01:27:16 obache Exp $
3 # NOTE: If you update this package, then you'll likely need to also update
4 # the x11-links dependency in buildlink3.mk to the correct version,
5 # usually the most recent.
7 DISTNAME= x11-links-0.74
8 CATEGORIES= pkgtools x11
9 MASTER_SITES= # empty
10 DISTFILES= # empty
12 MAINTAINER= pkgsrc-users@NetBSD.org
13 HOMEPAGE= http://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html
14 COMMENT= Shadow tree of links to native X11 headers and libraries
15 LICENSE= original-bsd
17 .include "../../mk/bsd.prefs.mk"
18 .if ${OPSYS} == "OpenBSD"
19 CHECK_SHLIBS_SUPPORTED= no
20 .endif
22 PKG_INSTALLATION_TYPES= overwrite pkgviews
24 NOT_FOR_PLATFORM= DragonFly-*-*
26 WRKSRC= ${WRKDIR}
27 USE_LANGUAGES= # empty
28 USE_TOOLS+= pax
30 PLIST_SRC.files= ${WRKDIR}/.PLIST_SRC.files
31 PLIST_SRC= ${PLIST_SRC_DFLT} ${PLIST_SRC.files}
33 OSVERSION_SPECIFIC= yes
35 .include "../../mk/bsd.prefs.mk"
37 .if ${X11_TYPE} == "modular"
38 PKG_FAIL_REASON+= "${PKGNAME} should only be used with X11_TYPE=native."
39 .elif !exists(${X11BASE}/include/X11/X.h)
40 PKG_FAIL_REASON+= "pkgsrc has been configured to use a system provided X11 installation"
41 PKG_FAIL_REASON+= "but one could not be found. Possible solutions:"
42 PKG_FAIL_REASON+= ""
43 PKG_FAIL_REASON+= " *) install X headers and libraries in X11BASE (currently ${X11BASE})"
44 PKG_FAIL_REASON+= " *) set X11_TYPE=modular in mk.conf to use X11 from pkgsrc"
45 PKG_FAIL_REASON+= ""
46 PKG_FAIL_REASON+= "Please note that changing the value of X11_TYPE in existing"
47 PKG_FAIL_REASON+= "pkgsrc installations is not supported!"
48 .endif
50 .if ${OPSYS} == "IRIX"
51 . include "xsgi.mk"
52 .elif ${OPSYS} == "OSF1"
53 . include "xdec.mk"
54 .elif !empty(X11BASE:M*openwin)
55 . include "openwin.mk"
56 .elif exists(${X11BASE}/lib/X11/config/xorgversion.def) || \
57 (exists(${X11BASE}/lib/X11/config/xorg.cf) && \
58 exists(${X11BASE}/lib/X11/config/version.def)) || \
59 exists(${X11BASE}/lib/pkgconfig/xorg-server.pc) || \
60 exists(${X11BASE}/bin/Xquartz)
61 . include "xorg.mk"
62 .else
63 . include "xfree.mk"
64 .endif
66 X11_LINKS_SUBDIR= share/x11-links
67 X11_LINKS_BUILD_DIR= ${WRKSRC}/${X11_LINKS_SUBDIR}
68 X11_LINKS_DIR= ${PREFIX}/${X11_LINKS_SUBDIR}
70 FILES_LIST_CMD= ${SED} -e "s/@ABI@/${ABI}/" ${FILES_LIST} | ${GREP} -v "^\#"
72 CREATE_X11LINK?= ${LN} -fs $$src $$dest
74 .include "../../mk/x11.buildlink3.mk"
76 do-build:
77 ${MKDIR} ${X11_LINKS_BUILD_DIR}
78 ${CHMOD} ${PKGDIRMODE} ${X11_LINKS_BUILD_DIR}
79 ${FILES_LIST_CMD} | ${SED} -e "s,/[^/]*$$,," | ${SORT} -u | \
80 while read dir; do \
81 if [ -d ${X11BASE}/$$dir ]; then \
82 ${MKDIR} ${X11_LINKS_BUILD_DIR}/$$dir; \
83 ${CHMOD} ${PKGDIRMODE} ${X11_LINKS_BUILD_DIR}/$$dir; \
84 elif [ -d /usr/$$dir ]; then \
85 ${MKDIR} ${X11_LINKS_BUILD_DIR}/$$dir; \
86 ${CHMOD} ${PKGDIRMODE} ${X11_LINKS_BUILD_DIR}/$$dir; \
87 fi; \
88 done
89 ${RM} -f ${PLIST_SRC.files}
90 ${FILES_LIST_CMD} | ${SORT} -u | \
91 while read file; do \
92 srcdir=""; \
93 if ${TEST} -r ${X11BASE}/$$file; then \
94 srcdir="${X11BASE}"; \
95 elif ${TEST} -r /usr/$$file; then \
96 srcdir="/usr"; \
97 fi; \
98 if ${TEST} ! -z "$$srcdir"; then \
99 src="$$srcdir/$$file"; \
100 dest="${X11_LINKS_BUILD_DIR}/$$file"; \
101 ${CREATE_X11LINK}; \
102 ${ECHO} "${X11_LINKS_SUBDIR}/$$file" \
103 >> ${PLIST_SRC.files}; \
104 if (${ECHO} $$file | ${GREP} -q '\.la$$'); then \
105 cd $${srcdir} && \
106 ${_LIBTOOL_EXPAND} $${file} | \
107 while read lib; do \
108 src="$$srcdir/$$lib"; \
109 dest="${X11_LINKS_BUILD_DIR}/$$lib"; \
110 ${CREATE_X11LINK}; \
111 ${ECHO} "${X11_LINKS_SUBDIR}/$$lib" \
112 >> ${PLIST_SRC.files}; \
113 done; \
114 fi; \
115 fi; \
116 done
118 do-install:
119 ${INSTALL_DATA_DIR} ${DESTDIR:Q}${X11_LINKS_DIR:Q}
120 cd ${X11_LINKS_BUILD_DIR} && \
121 pax -rw . ${DESTDIR:Q}${X11_LINKS_DIR:Q}
123 .include "../../mk/bsd.pkg.mk"