1 |
# $MidnightBSD$ |
2 |
|
3 |
SUBDIR += accessibility |
4 |
SUBDIR += archivers |
5 |
SUBDIR += astro |
6 |
SUBDIR += audio |
7 |
SUBDIR += benchmarks |
8 |
SUBDIR += comms |
9 |
SUBDIR += converters |
10 |
SUBDIR += core |
11 |
SUBDIR += databases |
12 |
SUBDIR += deskutils |
13 |
SUBDIR += devel |
14 |
SUBDIR += dns |
15 |
SUBDIR += editors |
16 |
SUBDIR += emulators |
17 |
SUBDIR += finance |
18 |
SUBDIR += ftp |
19 |
SUBDIR += games |
20 |
SUBDIR += graphics |
21 |
SUBDIR += irc |
22 |
SUBDIR += java |
23 |
SUBDIR += lang |
24 |
SUBDIR += mail |
25 |
SUBDIR += math |
26 |
SUBDIR += misc |
27 |
SUBDIR += multimedia |
28 |
SUBDIR += net |
29 |
SUBDIR += net-im |
30 |
SUBDIR += net-mgmt |
31 |
SUBDIR += net-p2p |
32 |
SUBDIR += news |
33 |
SUBDIR += palm |
34 |
SUBDIR += ports-mgmt |
35 |
SUBDIR += print |
36 |
SUBDIR += science |
37 |
SUBDIR += security |
38 |
SUBDIR += shells |
39 |
SUBDIR += sysutils |
40 |
SUBDIR += textproc |
41 |
SUBDIR += www |
42 |
SUBDIR += x11 |
43 |
SUBDIR += x11-clocks |
44 |
SUBDIR += x11-drivers |
45 |
SUBDIR += x11-fm |
46 |
SUBDIR += x11-fonts |
47 |
SUBDIR += x11-servers |
48 |
SUBDIR += x11-themes |
49 |
SUBDIR += x11-toolkits |
50 |
SUBDIR += x11-wm |
51 |
|
52 |
PORTSTOP= yes |
53 |
|
54 |
.include <bsd.port.subdir.mk> |
55 |
|
56 |
index: |
57 |
@rm -f ${INDEXDIR}/${INDEXFILE} |
58 |
@cd ${.CURDIR} && make ${INDEXDIR}/${INDEXFILE} |
59 |
|
60 |
indexbz2: index |
61 |
@rm -f ${INDEXDIR}/${INDEXFILE}.bz2 |
62 |
@bzip2 ${INDEXDIR}/${INDEXFILE} |
63 |
|
64 |
fetchindex: ${INDEXDIR}/${INDEXFILE}.bz2 |
65 |
@bunzip2 < ${INDEXDIR}/${INDEXFILE}.bz2 > ${INDEXDIR}/${INDEXFILE} && \ |
66 |
chmod a+r ${INDEXDIR}/${INDEXFILE} && ${RM} -f ${INDEXDIR}/${INDEXFILE}.bz2 |
67 |
|
68 |
${INDEXDIR}/${INDEXFILE}.bz2: .PHONY |
69 |
@${FETCHINDEX} ${INDEXDIR}/${INDEXFILE}.bz2 ${MASTER_SITE_INDEX}${INDEXFILE}.bz2 |
70 |
|
71 |
MASTER_SITE_INDEX?= http://www.MidnightBSD.org/ports/ |
72 |
SETENV?= /usr/bin/env |
73 |
FETCHINDEX?= ${SETENV} ${FETCH_ENV} fetch -am -o |
74 |
|
75 |
.if !defined(INDEX_JOBS) |
76 |
INDEX_JOBS!= ${SYSCTL} -n kern.smp.cpus |
77 |
.endif |
78 |
|
79 |
.if !defined(INDEX_VERBOSE) |
80 |
INDEX_ECHO_MSG= true |
81 |
INDEX_ECHO_1ST= echo -n |
82 |
.else |
83 |
INDEX_ECHO_MSG= echo 1>&2 |
84 |
INDEX_ECHO_1ST= echo |
85 |
.endif |
86 |
|
87 |
# /rescue/sh is statically linked and much faster to execute than the |
88 |
# dynamically linked /bin/sh. This is significant for targets like |
89 |
# make index that execute the shell tens of thousands of times. |
90 |
.if exists(/rescue/sh) |
91 |
INDEX_SHELL= /rescue/sh |
92 |
.else |
93 |
INDEX_SHELL= /bin/sh |
94 |
.endif |
95 |
|
96 |
.if !defined(INDEX_PORTS) |
97 |
INDEX_PORTS=. |
98 |
.endif |
99 |
|
100 |
.if exists(/usr/libexec/make_index) |
101 |
MAKE_INDEX= /usr/libexec/make_index /dev/stdin |
102 |
.else |
103 |
MAKE_INDEX= perl ${.CURDIR}/Tools/make_index |
104 |
.endif |
105 |
|
106 |
${INDEXDIR}/${INDEXFILE}: |
107 |
@${INDEX_ECHO_1ST} "Generating ${INDEXFILE} - please wait.."; \ |
108 |
if [ "${INDEX_PRISTINE}" != "" ]; then \ |
109 |
export LOCALBASE=/nonexistentlocal; \ |
110 |
fi; \ |
111 |
tmpdir=`/usr/bin/mktemp -d -t index` || exit 1; \ |
112 |
trap "rm -rf $${tmpdir}; exit 1" 1 2 3 5 10 13 15; \ |
113 |
( cd ${.CURDIR}; for i in ${INDEX_PORTS}; do (cd $${i} && ${MAKE} -j${INDEX_JOBS} INDEX_TMPDIR=$${tmpdir} BUILDING_INDEX=1 \ |
114 |
__MAKE_SHELL=${INDEX_SHELL} \ |
115 |
ECHO_MSG="${INDEX_ECHO_MSG}" describe); done ) || \ |
116 |
(rm -rf $${tmpdir} ; \ |
117 |
if [ "${INDEX_QUIET}" = "" ]; then \ |
118 |
echo; \ |
119 |
echo "********************************************************************"; \ |
120 |
echo "Before reporting this error, verify that you are running a supported"; \ |
121 |
echo "version of MidnightBSD (see http://www.MidnightBSD.org/ports/) "; \ |
122 |
echo "and that you have a complete and up-to-date ports collection. "; \ |
123 |
echo; \ |
124 |
echo "********************************************************************"; \ |
125 |
echo; \ |
126 |
fi; \ |
127 |
exit 1); \ |
128 |
cat $${tmpdir}/${INDEXFILE}.desc.* | \ |
129 |
sed -e 's|${.CURDIR}|${PORTSDIR}|g' | \ |
130 |
(cd ${.CURDIR} ; ${MAKE_INDEX}) | \ |
131 |
sed -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' -e 's./..g' | \ |
132 |
sort -t '|' +1 -2 | \ |
133 |
sed -Ee 's../.g' -e ':a' -e 's|/[^/]+/\.\.||; ta' \ |
134 |
-e 's|${PORTSDIR}|/usr/mports|g' \ |
135 |
-e 's|${.CURDIR}|/usr/mports|g' > ${INDEXDIR}/${INDEXFILE}.tmp; \ |
136 |
if [ "${INDEX_PRISTINE}" != "" ]; then \ |
137 |
sed -e "s,$${LOCALBASE},/usr/local," ${INDEXDIR}/${INDEXFILE}.tmp > ${INDEXDIR}/${INDEXFILE}; \ |
138 |
else \ |
139 |
mv ${INDEXDIR}/${INDEXFILE}.tmp ${INDEXDIR}/${INDEXFILE}; \ |
140 |
fi; \ |
141 |
rm -rf $${tmpdir}; \ |
142 |
echo " Done." |
143 |
|
144 |
print-index: ${INDEXDIR}/${INDEXFILE} |
145 |
@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\nE-deps:\t%s\nP-deps:\t%s\nF-deps:\t%s\nWWW:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$11, $$12, $$13, $$10); }' < ${INDEXDIR}/${INDEXFILE} |
146 |
|
147 |
GIT?= git |
148 |
SVN?= svn |
149 |
RSYNC?= rsync |
150 |
PORTSNAP?= portsnap |
151 |
PORTSNAP_FLAGS?= -p ${.CURDIR} |
152 |
.if !target(update) |
153 |
update: |
154 |
.if exists(${.CURDIR}/.svn) |
155 |
@echo "--------------------------------------------------------------" |
156 |
@echo ">>> Updating ${.CURDIR} using Subversion" |
157 |
@echo "--------------------------------------------------------------" |
158 |
cd ${.CURDIR}; ${SVN} update |
159 |
.elif exists(${.CURDIR}/.git) |
160 |
@echo "--------------------------------------------------------------" |
161 |
@echo ">>> Updating ${.CURDIR} from git+svn repository" |
162 |
@echo "--------------------------------------------------------------" |
163 |
cd ${.CURDIR}; ${GIT} svn rebase |
164 |
.elif defined(RSYNC_UPDATE) && defined(PORTS_RSYNC_SOURCE) |
165 |
@echo "--------------------------------------------------------------" |
166 |
@echo ">>> Updating with ${RSYNC} from ${PORTS_RSYNC_SOURCE}" |
167 |
@echo "--------------------------------------------------------------" |
168 |
@${RSYNC} ${RSYNC_FLAGS} ${PORTS_RSYNC_SOURCE}/ ${.CURDIR}/ |
169 |
.else |
170 |
@echo "--------------------------------------------------------------" |
171 |
@echo ">>> Running ${PORTSNAP}" |
172 |
@echo "--------------------------------------------------------------" |
173 |
.if !exists(${PORTSDIR}/.portsnap.INDEX) |
174 |
@echo "Error: 'make update' uses portsnap(8) by default and" |
175 |
@echo "needs ${PORTSDIR} to be created by portsnap on its first run." |
176 |
@echo "Please run 'portsnap fetch extract' first." |
177 |
.else |
178 |
@${PORTSNAP} ${PORTSNAP_FLAGS} fetch |
179 |
@${PORTSNAP} ${PORTSNAP_FLAGS} update |
180 |
.endif |
181 |
.endif |
182 |
.endif |