aboutsummaryrefslogtreecommitdiff
path: root/en/ports/Makefile
blob: ace0407b65a898aba19a0093f6c710e087e0e102 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# $FreeBSD: www/en/ports/Makefile,v 1.45 2005/11/30 22:46:33 pav Exp $

.if exists(../Makefile.conf)
.include "../Makefile.conf"
.endif
.if exists(../Makefile.inc)
.include "../Makefile.inc"
.endif
.if exists(Makefile.inc)
.include "Makefile.inc"
.endif

FETCH_OPT?=	-am

#
# Force NO_TIDY for the ports web pages, since it takes a long time to
# run tidy on these huge HTML files, and the files are valid HTML when
# generated by portindex, even without tidy.
#
NO_TIDY=	YES

.if defined(PINDEX_OVERRIDE)
${INDEX}: ${PINDEX_OVERRIDE}
	${CP} ${PINDEX_OVERRIDE} ${INDEX}
.elif defined(NOPORTSNET)
${INDEX}: $${PORTSBASE}/${PINDEX}
	${CP} ${PORTSBASE}/${PINDEX} ${INDEX}
.else
${INDEX}:
	${FETCH} ${FETCH_OPT} -o ${INDEX}.bz2 ${INDEXURI}.bz2
	${BUNZIP2} ${INDEX}.bz2
.endif

HOSTNAME!= hostname
.if ${HOSTNAME} == "hub.freebsd.org" || ${HOSTNAME} == "freefall.freebsd.org" || ${HOSTNAME} == "www.freebsd.org"
CLUSTER_MACHINE=	YES
.endif

# Build the list of available packages, but only on the main FreeBSD machines.
# Don't build the list if NO_PACKAGES_LINK is set and not empty.
#
packages.exists:
.if defined(CLUSTER_MACHINE) && (!defined(NO_PACKAGES_LINK) || empty(NO_PACKAGES_LINK))
	@if ${SH} ${.CURDIR}/packages > ${.TARGET}.temp; then \
		${MV} ${.TARGET}.temp ${.TARGET}; \
	else \
		${RM} ${.TARGET}.temp; ${TOUCH} ${.TARGET}; \
	fi;
.else
	${TOUCH} ${.TARGET}
.endif

Makefile.gen: categories-alpha.sgml categories-grouped.sgml index.sgml \
	installing.sgml master-index.sgml references.sgml searching.sgml \
	statistics.ent updating.sgml .NOTMAIN
	${ECHO_CMD} DOCS= *.sgml > Makefile.gen
	${ECHO_CMD} -n "DYNAMIC_DOCS= " >> Makefile.gen
	${ECHO_CMD} -n " categories-alpha.sgml" >> Makefile.gen
	${ECHO_CMD} -n " categories-grouped.sgml" >> Makefile.gen
	${ECHO_CMD} -n " master-index.sgml" >> Makefile.gen
	${ECHO_CMD} -n " statistics.ent" >> Makefile.gen
	for categoryfile in ${CATEGORYLIST}; do \
		${ECHO_CMD} -n " $$categoryfile.sgml" >> Makefile.gen; \
	done
	${ECHO_CMD} >> Makefile.gen
.if defined(NO_TIDY)
	${ECHO_CMD} NO_TIDY=${NO_TIDY} >> Makefile.gen
.endif

.if defined(CLUSTER_MACHINE)
PORTS_TARGZ_URL?= ftp://ftp-master.FreeBSD.org/pub/FreeBSD/ports/ports/ports.tar.gz
.else
PORTS_TARGZ_URL?= ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/ports/ports.tar.gz
.endif

ports.size:
.if defined (NOPORTSNET)
	touch ${.TARGET}
.else
	${RM} -f ${.TARGET}
	${FETCH} -s ${PORTS_TARGZ_URL} > ${.TARGET}
.endif

# this builds: categories-alpha.sgml, categories-grouped.sgml,
# master-index.sgml, statistics.ent, <category>.sgml
CATEGORYLIST=`grep "^[a-z]" categories | sed -e s"/,.*//"`
categories-alpha.sgml: ${INDEX} categories categories.descriptions \
	packages.exists portindex ports.ent ports.size .NOTMAIN
	${RM} -f categories-alpha.sgml categories-grouped.sgml \
		master-index.sgml statistics.ent
	for categoryfile in ${CATEGORYLIST}; do \
		rm -f "$$categoryfile.sgml"; \
	done
	${PORTINDEX} ${INDEX} ${.CURDIR}

install: all beforeinstall

all install clean:
	cd ${.CURDIR}; \
		${MAKE} ${MAKEFLAGS} -f ${.CURDIR}/Makefile.inc0 ${.TARGET}
.if defined(WITH_PORTS_GROWTH)
	cd growth; \
		${MAKE} ${MAKEFLAGS} ${.TARGET}
beforeinstall:
.else
beforeinstall:
	${SED} -i "" -e 's,HREF="growth,href="http://www.FreeBSD.org/ports/growth,' index.html
	${SED} -i "" -e 's,HREF="growth,href="http://www.FreeBSD.org/ports/growth,' references.html
.endif

.include "${WEB_PREFIX}/share/mk/web.site.mk"