1 # $NetBSD: Makefile,v 1.46 2001/12/17 02:33:46 dmcmahill Exp $
4 .include "mk/bsd.prefs.mk"
7 SUBDIR+= ${SITE_SPECIFIC_PKGS}
8 SUBDIR+= ${HOST_SPECIFIC_PKGS}
9 SUBDIR+= ${GROUP_SPECIFIC_PKGS}
10 SUBDIR+= ${USER_SPECIFIC_PKGS}
54 .include "mk/bsd.pkg.subdir.mk"
56 # the bulk-cache and clean-bulk-cache targets are a global-pkgsrc
57 # thing and thus it makes sense to run it from the top level pkgsrc
59 .if make(bulk-cache) || make(clean-bulk-cache)
60 .include "${.CURDIR}/mk/bulk/bsd.bulk-pkg.mk"
61 _PKGSRCDIR?=${.CURDIR}
65 @rm -f ${.CURDIR}/INDEX
66 @${MAKE} ${.CURDIR}/INDEX
69 @${ECHO} -n "Generating INDEX - please wait.."
70 @${MAKE} describe ECHO_MSG="${ECHO} > /dev/null" > ${.CURDIR}/INDEX
73 print-index: ${.CURDIR}/INDEX
74 @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArch:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${.CURDIR}/INDEX
76 search: ${.CURDIR}/INDEX
78 @${ECHO} "The search target requires a keyword parameter,"
79 @${ECHO} "e.g.: \"${MAKE} search key=somekeyword\""
81 @grep ${key} ${.CURDIR}/INDEX | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArch:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }'
86 # Generate list of all packages by extracting information from
87 # the category/README.html pages
90 @if [ -f README-all.html ]; then \
91 mv README-all.html README-all.html.BAK ; \
93 @${MAKE} README-all.html
94 @if cmp -s README-all.html README-all.html.BAK ; then \
95 mv README-all.html.BAK README-all.html ; \
97 rm -f README-all.html.BAK ; \
103 @${ECHO} -n "Processing categories for $@:"
104 .for category in ${SUBDIR}
105 @if [ -f ${category}/README.html ]; then \
106 ${ECHO} -n ' ${category}' ; \
107 grep '^<TR>' ${category}/README.html \
108 | sed -e 's|"|"${category}/|' \
109 -e 's| <TD>| <TD>(<A HREF="${category}/README.html">${category}</A>) <TD>|' \
110 -e 's|<TR>|<TR VALIGN=TOP>|' \
111 -e 's|<TD VALIGN=TOP>|<TD>|' \
116 @sort -f -t '">' +2 <$@.new >$@.newsorted
117 @wc -l $@.newsorted | awk '{ print $$1 }' >$@.npkgs
118 @cat templates/README.all \
120 -e '/%%NPKGS%%/r$@.npkgs' \
122 -e '/%%PKGS%%/r$@.newsorted' \
132 @if [ -f README-IPv6.html ]; then \
133 mv README-IPv6.html README-IPv6.html.BAK ; \
135 @${MAKE} README-IPv6.html
136 @if cmp -s README-IPv6.html README-IPv6.html.BAK ; then \
137 mv README-IPv6.html.BAK README-IPv6.html ; \
139 rm -f README-IPv6.html.BAK ; \
143 @grep -l '^BUILD_DEFS.*=.*USE_INET6' */*/Makefile \
144 | sed s,Makefile,, >$@.pkgs
145 @fgrep -f $@.pkgs README-all.html | sort -t/ +1 >$@.trs
146 @cat templates/README.ipv6 \
148 -e '/%%TRS%%/r$@.trs' \
154 show-host-specific-pkgs:
155 @${ECHO} "HOST_SPECIFIC_PKGS= \\"; \
156 ${MAKE} show-pkgsrc-dir | awk '/^===/ { next; } { printf("%s \\\n", $$1) }'; \