Blob


1 # $OpenBSD: Makefile,v 1.87 2021/11/06 19:09:10 rsadowski Exp $
3 .if !defined(BSD_OWN_MK)
4 . include <bsd.own.mk>
5 .endif
7 PKGPATH =
8 DISTFILES_DB ?= ${.CURDIR}/infrastructure/db/locate.database
9 INDEX = ${LOCALBASE}/share/ports-INDEX
11 .if defined(SUBDIR)
12 # nothing to do
13 .elif !make(search) && (defined(key) || defined(name) || defined(category) || defined(author))
14 # set up subdirs from the index, assume it's up-to-date
15 _CMD = perl ${.CURDIR}/infrastructure/bin/port-search-helper index='${INDEX}'
16 . if defined(key)
17 _CMD += key='${key}'
18 . endif
19 . if defined(name)
20 _CMD += maintainer='${name}'
21 . endif
22 . if defined(category)
23 _CMD += category='${category}'
24 . endif
25 . if defined(maintainer)
26 _CMD += maintainer='${maintainer}'
27 . endif
28 SUBDIR != ${_CMD}
29 .elif defined(SUBDIRLIST)
30 SUBDIR != sed -e 's,[ ]*\#.*,,' -e '/^[ ]*$$/d' ${SUBDIRLIST}
31 .else
32 SUBDIR += archivers
33 SUBDIR += astro
34 SUBDIR += audio
35 SUBDIR += benchmarks
36 SUBDIR += biology
37 SUBDIR += books
38 SUBDIR += cad
39 SUBDIR += chinese
40 SUBDIR += comms
41 SUBDIR += converters
42 SUBDIR += databases
43 SUBDIR += devel
44 SUBDIR += editors
45 SUBDIR += education
46 SUBDIR += emulators
47 SUBDIR += fonts
48 SUBDIR += games
49 SUBDIR += geo
50 SUBDIR += graphics
51 SUBDIR += inputmethods
52 SUBDIR += japanese
53 SUBDIR += java
54 SUBDIR += korean
55 SUBDIR += lang
56 SUBDIR += mail
57 SUBDIR += math
58 SUBDIR += meta
59 SUBDIR += misc
60 SUBDIR += multimedia
61 SUBDIR += net
62 SUBDIR += news
63 SUBDIR += plan9
64 SUBDIR += print
65 SUBDIR += productivity
66 SUBDIR += security
67 SUBDIR += shells
68 SUBDIR += sysutils
69 SUBDIR += telephony
70 SUBDIR += textproc
71 SUBDIR += wayland
72 SUBDIR += www
73 SUBDIR += x11
74 .endif
76 .include <bsd.port.subdir.mk>
78 ${INDEX}:
79 @if pkg_info -q -e 'portslist-<6.10'; then \
80 echo "Old portslist found"; \
81 echo "Don't mix -current and 6.4"; \
82 fi
83 @echo "Please install portslist"
84 @echo "${SUDO} pkg_add portslist"
85 @exit 1
88 print-index: ${INDEX}
89 @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${INDEX}
91 print-licenses: ${INDEX}
92 @printf "Port PC PF DC DF Maint\n"
93 @awk -F\| '{printf("%-40.39s%-3.2s%-3.2s%-3.2s%-3.2s%-25.25s\n",$$2,$$12,$$13,$$14,$$15,$$6);}' < ${INDEX}
95 search: ${INDEX}
96 .if !defined(key) && !defined(name)
97 @echo "The search target requires a keyword or name parameter,"
98 @echo "e.g.: \"make search key=somekeyword\" \"make search name=somename\""
99 .else
100 . if defined(key)
101 @egrep -i -- "${key}" ${INDEX} | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }'
102 . else
103 @awk -F\| '$$1 ~ /${name}/ { printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }' ${INDEX}
104 . endif
105 .endif
107 fix-permissions:
108 @{ echo "DUMMY_PACKAGE=Yes"; \
109 echo ".include <bsd.port.mk>"; }|${MAKE} -f - fix-permissions
111 distfiles-update-locatedb:
112 @PORTSDIR=${.CURDIR} /bin/sh ${.CURDIR}/infrastructure/fetch/distfiles-update-locatedb ${DISTFILES_DB}
114 create_DEPENDS_CACHE:
115 @${_mk_DEPENDS_CACHE}; echo $${_DEPENDS_CACHE}
117 destroy_DEPENDS_CACHE:
118 @${_PBUILD} rm -rf 2>/dev/null $${_DEPENDS_CACHE}
121 .PHONY: index search distfiles-update-locatedb \
122 print-licenses print-index fix-permissions \
123 create_DEPENDS_CACHE destroy_DEPENDS_CACHE