1 |
# $MidnightBSD: mports/Makefile,v 1.40 2009/01/20 15:32:52 laffer1 Exp $ |
2 |
# |
3 |
|
4 |
SUBDIR += accessibility |
5 |
SUBDIR += archivers |
6 |
SUBDIR += astro |
7 |
SUBDIR += audio |
8 |
SUBDIR += benchmarks |
9 |
SUBDIR += comms |
10 |
SUBDIR += converters |
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 += mbone |
27 |
SUBDIR += misc |
28 |
SUBDIR += multimedia |
29 |
SUBDIR += net |
30 |
SUBDIR += net-im |
31 |
SUBDIR += net-mgmt |
32 |
SUBDIR += net-p2p |
33 |
SUBDIR += news |
34 |
SUBDIR += palm |
35 |
SUBDIR += ports-mgmt |
36 |
SUBDIR += print |
37 |
SUBDIR += science |
38 |
SUBDIR += security |
39 |
SUBDIR += shells |
40 |
SUBDIR += sysutils |
41 |
SUBDIR += textproc |
42 |
SUBDIR += www |
43 |
SUBDIR += x11 |
44 |
SUBDIR += x11-clocks |
45 |
SUBDIR += x11-drivers |
46 |
SUBDIR += x11-fonts |
47 |
SUBDIR += x11-fm |
48 |
SUBDIR += x11-servers |
49 |
SUBDIR += x11-themes |
50 |
SUBDIR += x11-toolkits |
51 |
SUBDIR += x11-wm |
52 |
|
53 |
PORTSTOP= yes |
54 |
|
55 |
.include <bsd.port.subdir.mk> |
56 |
|
57 |
index: |
58 |
@rm -f ${INDEXDIR}/${INDEXFILE} |
59 |
@cd ${.CURDIR} && make ${INDEXDIR}/${INDEXFILE} |
60 |
|
61 |
indexbz2: index |
62 |
@rm -f ${INDEXDIR}/${INDEXFILE}.bz2 |
63 |
@bzip2 ${INDEXDIR}/${INDEXFILE} |
64 |
|
65 |
fetchindex: ${INDEXDIR}/{INDEXFILE}.bz2 |
66 |
@bunzip2 < ${INDEXDIR}/${INDEXFILE}.bz2 > ${INDEXDIR}/${INDEXFILE} && \ |
67 |
chmod a+r ${INDEXDIR}/${INDEXFILE} |
68 |
|
69 |
${INDEXDIR}/{INDEXFILE}.bz2: .PHONY |
70 |
@${FETCHINDEX} ${INDEXDIR}/${INDEXFILE}.bz2 ${MASTER_SITE_INDEX}${INDEXFILE}.bz2 |
71 |
|
72 |
MASTER_SITE_INDEX?= http://www.MidnightBSD.org/ports/ |
73 |
SETENV?= /usr/bin/env |
74 |
FETCHINDEX?= ${SETENV} ${FETCH_ENV} fetch -am -o |
75 |
INDEX_JOBS?= 2 |
76 |
|
77 |
.if !defined(INDEX_VERBOSE) |
78 |
INDEX_ECHO_MSG= echo > /dev/null |
79 |
INDEX_ECHO_1ST= echo -n |
80 |
.else |
81 |
INDEX_ECHO_MSG= echo 1>&2 |
82 |
INDEX_ECHO_1ST= echo |
83 |
.endif |
84 |
|
85 |
${INDEXDIR}/${INDEXFILE}: |
86 |
@${INDEX_ECHO_1ST} "Generating ${INDEXFILE} - please wait.."; \ |
87 |
if [ "${INDEX_PRISTINE}" != "" ]; then \ |
88 |
export LOCALBASE=/nonexistentlocal; \ |
89 |
export X11BASE=/nonexistentx; \ |
90 |
fi; \ |
91 |
tmpdir=`/usr/bin/mktemp -d -t index` || exit 1; \ |
92 |
trap "rm -rf $${tmpdir}; exit 1" 1 2 3 5 10 13 15; \ |
93 |
( cd ${.CURDIR} && make -j${INDEX_JOBS} INDEX_TMPDIR=$${tmpdir} BUILDING_INDEX=1 \ |
94 |
ECHO_MSG="${INDEX_ECHO_MSG}" describe ) || \ |
95 |
(rm -rf $${tmpdir} ; \ |
96 |
if [ "${INDEX_QUIET}" = "" ]; then \ |
97 |
echo; \ |
98 |
echo "********************************************************************"; \ |
99 |
echo "Before reporting this error, verify that you are running a supported"; \ |
100 |
echo "version of MidnightBSD (see http://www.MidnightBSD.org/ports/) and that you"; \ |
101 |
echo "have a complete and up-to-date ports collection. (INDEX builds are"; \ |
102 |
echo "not supported with partial or out-of-date ports collections -- in"; \ |
103 |
echo "particular, if you are using cvsup, you must cvsup the \"ports-all\""; \ |
104 |
echo "collection, and have no \"refuse\" files.) If that is the case, then"; \ |
105 |
echo "report the failure to ports@MidnightBSD.org together with relevant"; \ |
106 |
echo "details of your ports configuration (including MidnightBSD version,"; \ |
107 |
echo "your architecture, your environment, and your /etc/make.conf"; \ |
108 |
echo "settings, especially compiler flags and WITH/WITHOUT settings)."; \ |
109 |
echo; \ |
110 |
echo "Note: the latest pre-generated version of INDEX may be fetched"; \ |
111 |
echo "automatically with \"make fetchindex\"."; \ |
112 |
echo "********************************************************************"; \ |
113 |
echo; \ |
114 |
fi; \ |
115 |
exit 1); \ |
116 |
cat $${tmpdir}/${INDEXFILE}.desc.* | (cd ${.CURDIR} ; perl ${.CURDIR}/Tools/make_index) | \ |
117 |
sed -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' -e 's./..g' | \ |
118 |
sort -t '|' +1 -2 | \ |
119 |
sed -e 's../.g' > ${INDEXDIR}/${INDEXFILE}.tmp; \ |
120 |
if [ "${INDEX_PRISTINE}" != "" ]; then \ |
121 |
sed -e "s,$${LOCALBASE},/usr/local," -e "s,$${X11BASE},/usr/X11R6," \ |
122 |
${INDEXDIR}/${INDEXFILE}.tmp > ${INDEXDIR}/${INDEXFILE}; \ |
123 |
else \ |
124 |
mv ${INDEXDIR}/${INDEXFILE}.tmp ${INDEXDIR}/${INDEXFILE}; \ |
125 |
fi; \ |
126 |
rm -rf $${tmpdir}; \ |
127 |
echo " Done." |
128 |
|
129 |
print-index: ${INDEXDIR}/${INDEXFILE} |
130 |
@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} |
131 |
|
132 |
CVS?= cvs |
133 |
SUP?= csup |
134 |
.if defined(SUPHOST) |
135 |
SUPFLAGS+= -h ${SUPHOST} |
136 |
.endif |
137 |
update: |
138 |
.if defined(SUP_UPDATE) && defined(PORTSSUPFILE) |
139 |
@echo "--------------------------------------------------------------" |
140 |
@echo ">>> Running ${SUP}" |
141 |
@echo "--------------------------------------------------------------" |
142 |
@${SUP} ${SUPFLAGS} ${PORTSSUPFILE} |
143 |
.elif defined(CVS_UPDATE) |
144 |
@echo "--------------------------------------------------------------" |
145 |
@echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT} |
146 |
@echo "--------------------------------------------------------------" |
147 |
cd ${.CURDIR}; ${CVS} -R -q update -A -P -d -I! |
148 |
.elif defined(SUP_UPDATE) && !defined(PORTSSUPFILE) |
149 |
@${ECHO_MSG} "Error: Please define PORTSSUPFILE before doing make update." |
150 |
@exit 1 |
151 |
.else |
152 |
@${ECHO_MSG} "Error: Please define either PORTSNAP_UPDATE, SUP_UPDATE, or CVS_UPDATE first." |
153 |
.endif |