Annotation of ports/Makefile, Revision 1.83
1.83 ! espie 1: # $OpenBSD: Makefile,v 1.82 2018/11/16 09:30:47 espie Exp $
1.74 espie 2:
3: .if !defined(BSD_OWN_MK)
4: . include <bsd.own.mk>
5: .endif
1.1 niklas 6:
1.54 espie 7: PKGPATH =
8: DISTFILES_DB ?= ${.CURDIR}/infrastructure/db/locate.database
1.82 espie 9: INDEX = ${LOCALBASE}/share/ports-INDEX
1.54 espie 10:
1.46 espie 11: .if defined(SUBDIR)
12: # nothing to do
1.82 espie 13: .elif !make(search) && (defined(key) || defined(name) || defined(category) || defined(author))
1.23 espie 14: # set up subdirs from the index, assume it's up-to-date
1.81 espie 15: _CMD = perl ${.CURDIR}/infrastructure/bin/port-search-helper index='${INDEX}'
1.54 espie 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
1.23 espie 28: SUBDIR != ${_CMD}
1.28 espie 29: .elif defined(SUBDIRLIST)
30: SUBDIR != sed -e 's,[ ]*\#.*,,' -e '/^[ ]*$$/d' ${SUBDIRLIST}
1.23 espie 31: .else
1.1 niklas 32: SUBDIR += archivers
1.2 angelos 33: SUBDIR += astro
1.3 niklas 34: SUBDIR += audio
1.1 niklas 35: SUBDIR += benchmarks
1.44 xsa 36: SUBDIR += biology
1.41 avsm 37: SUBDIR += books
1.11 marc 38: SUBDIR += cad
1.1 niklas 39: SUBDIR += chinese
40: SUBDIR += comms
1.9 angelos 41: SUBDIR += converters
1.1 niklas 42: SUBDIR += databases
43: SUBDIR += devel
44: SUBDIR += editors
1.31 naddy 45: SUBDIR += education
1.1 niklas 46: SUBDIR += emulators
1.66 jasper 47: SUBDIR += fonts
1.1 niklas 48: SUBDIR += games
1.53 ckuethe 49: SUBDIR += geo
1.1 niklas 50: SUBDIR += graphics
1.52 espie 51: SUBDIR += inputmethods
1.13 marc 52: SUBDIR += japanese
1.32 kevlo 53: SUBDIR += java
1.29 dugsong 54: SUBDIR += korean
1.6 niklas 55: SUBDIR += lang
1.1 niklas 56: SUBDIR += mail
1.10 angelos 57: SUBDIR += math
1.67 ajacouto 58: SUBDIR += meta
1.1 niklas 59: SUBDIR += misc
1.45 xsa 60: SUBDIR += multimedia
1.1 niklas 61: SUBDIR += net
62: SUBDIR += news
1.4 niklas 63: SUBDIR += plan9
1.7 angelos 64: SUBDIR += print
1.27 espie 65: SUBDIR += productivity
1.1 niklas 66: SUBDIR += security
67: SUBDIR += shells
68: SUBDIR += sysutils
1.47 jolan 69: SUBDIR += telephony
1.1 niklas 70: SUBDIR += textproc
71: SUBDIR += www
1.5 niklas 72: SUBDIR += x11
1.23 espie 73: .endif
1.1 niklas 74:
75: .include <bsd.port.subdir.mk>
76:
1.82 espie 77: ${INDEX}:
78: @echo "Please install portslist"
79: @echo "${SUDO} pkg_add portslist"
80: @exit 1
81:
1.1 niklas 82:
1.81 espie 83: print-index: ${INDEX}
84: @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}
1.17 turan 85:
1.81 espie 86: print-licenses: ${INDEX}
1.20 turan 87: @printf "Port PC PF DC DF Maint\n"
1.81 espie 88: @awk -F\| '{printf("%-40.39s%-3.2s%-3.2s%-3.2s%-3.2s%-25.25s\n",$$2,$$12,$$13,$$14,$$15,$$6);}' < ${INDEX}
1.1 niklas 89:
1.81 espie 90: search: ${INDEX}
1.40 pb 91: .if !defined(key) && !defined(name)
92: @echo "The search target requires a keyword or name parameter,"
93: @echo "e.g.: \"make search key=somekeyword\" \"make search name=somename\""
1.1 niklas 94: .else
1.54 espie 95: . if defined(key)
1.81 espie 96: @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); }'
1.54 espie 97: . else
1.81 espie 98: @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}
1.54 espie 99: . endif
1.1 niklas 100: .endif
1.78 espie 101:
102: fix-permissions:
103: @{ echo "COMMENT=test"; \
104: echo "CATEGORIES=test"; \
105: echo "PKGPATH=test/a"; \
106: echo "DISTNAME=test"; \
107: echo "PERMIT_PACKAGE_CDROM=Yes"; \
108: echo "ECHO_MSG=:"; \
109: echo ".include <bsd.port.mk>"; }|${MAKE} -f - fix-permissions
1.21 espie 110:
1.22 espie 111: distfiles-update-locatedb:
112: @PORTSDIR=${.CURDIR} /bin/sh ${.CURDIR}/infrastructure/fetch/distfiles-update-locatedb ${DISTFILES_DB}
113:
1.68 espie 114: .PHONY: index search distfiles-update-locatedb \
1.83 ! espie 115: print-licenses print-index fix-permissions