blob: e70d7ce63c0ad738932f4834801b09fba60f86a1 (
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
|
# Created by: Marc Fonvieille <blackend@FreeBSD.org>
PORTNAME= freebsd-doc
PORTVERSION= 20220326
PORTEPOCH= 1
CATEGORIES= misc docs
MASTER_SITES= LOCAL/blackend
PKGNAMEPREFIX?= en-
MAINTAINER= doceng@FreeBSD.org
COMMENT?= Documentation from the FreeBSD Documentation Project
LICENSE= BSD2CLAUSE
BUILD_DEPENDS= docproj>=4.0:textproc/docproj
WRKSRC= ${WRKDIR}/doc/documentation
PLIST_SUB= DOCSDIR=${DOCBASE} \
DOCLANG=${DOCLANG} \
DOCLANG_PREFIX=${DOCLANG_PREFIX}
MAKE_ARGS= ${DOCFORMAT} \
DOC_LANG="${DOCLANG}"
NO_ARCH= yes
# To populate correctly the stage directory
TMPDESTDIR= ${STAGEDIR}${DESTDIR}/${PREFIX}/${DOCBASE}
DESTDIRNAME= TMPDESTDIR
PLIST= ${WRKDIR}/pkg-plist
DOCLANG?= en
DOCLANG_PREFIX?= ${DOCLANG:C/_.*$//}
DOCBASE?= share/doc/freebsd
# HTML format disabled until separate localized-only build will work again
#AVAILABLEFORMATS= HTML PDF
AVAILABLEFORMATS= PDF
OPTIONS_DEFINE= ${AVAILABLEFORMATS}
OPTIONS_DEFAULT= PDF
HTML_DESC= Single HTML file per document
PDF_DESC= PDF format
# if PACKAGE_BUILDING=yes, enable all of $AVAILABLEFORMATS.
.if defined(PACKAGE_BUILDING)
OPTIONS_DEFAULT+= ${AVAILABLEFORMATS}
.endif
.include <bsd.port.options.mk>
.for O in ${AVAILABLEFORMATS}
.if ${PORT_OPTIONS:M${O}}
DOCFORMAT+= ${O:tl}
PLIST_FORMATS+= ${O:tl}
.endif
.endfor
# when html is defined as the format, add HTML_COMMON.
.if ${PORT_OPTIONS:MHTML}
PLIST_FORMATS+= html-common
.endif
# example files, scripts, etc. coming with the doc and common
# directories for all formats.
PLIST_FORMATS+= extras common
pre-build:
.for i in ${PLIST_FORMATS:S,^,${.CURDIR}/pkg-plist.,}
if ${TEST} -f ${i}; then \
${CAT} ${i} >> ${PLIST}; \
fi
.endfor
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
do-install:
${MKDIR} ${STAGEDIR}${DESTDIR}${PREFIX}/${DOCBASE}
${CP} -R ${WRKSRC}/public/* ${STAGEDIR}${DESTDIR}${PREFIX}/${DOCBASE}
if ${TEST} -f ${.CURDIR}/pkg-plist.extras; then \
${CAT} ${.CURDIR}/pkg-plist.extras | \
${SED} -e 's|%%DOCSDIR%%/%%DOCLANG%%||' | \
${XARGS} -t -I % ${CP} -v ${WRKSRC}/static/source/% ${STAGEDIR}${DESTDIR}${PREFIX}/${DOCBASE}/${DOCLANG}%; \
fi
.include <bsd.port.mk>
|