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