Add files from parent branch HEAD:
[pkgsrcv2.git] / textproc / groff / Makefile
1 # $NetBSD: Makefile,v 1.55 2010/02/04 12:49:03 tnn Exp $
2 #
3
4 DISTNAME=       groff-1.20.1
5 PKGREVISION=    2
6 CATEGORIES=     textproc
7 MASTER_SITES=   ${MASTER_SITE_GNU:=groff/}
8
9 MAINTAINER=     pkgsrc-users@NetBSD.org
10 HOMEPAGE=       http://www.gnu.org/software/groff/groff.html
11 COMMENT=        GNU roff text processing suite
12
13 CHECK_PERMS=            NO
14 MAKE_JOBS_SAFE=         NO
15
16 PKG_DESTDIR_SUPPORT=    user-destdir
17 INSTALLATION_DIRS=      share/groff/site-tmac
18
19 USE_LANGUAGES=          c c++
20 GNU_CONFIGURE=          YES
21 CONFIGURE_ENV+=         PERLPATH=${PERL5:Q}
22 USE_TOOLS+=             perl:run sed:run awk:run
23 USE_FEATURES=           getopt_long
24
25 INFO_FILES=             YES
26
27 REPLACE_AWK+=           font/devlj4/generate/special.awk
28
29 REPLACE_INTERPRETER+=   sed
30 REPLACE.sed.old=        .*/sed
31 REPLACE.sed.new=        ${SED}
32 REPLACE_FILES.sed+=     font/devps/generate/symbol.sed
33
34 .include "options.mk"
35
36 PLIST_SRC+=             ${WRKDIR}/PLIST-local
37 PLIST_SRC+=             PLIST
38
39 .include "../../mk/bsd.prefs.mk"
40
41 .if ${OPSYS} == "SunOS"
42 PLIST_SUBST+=   GNU_PREFIX="g"
43
44 .else
45 PLIST_SUBST+=   GNU_PREFIX=""
46 .endif
47
48 BUILD_DEFS+=    PAPERSIZE
49 .if defined(PAPERSIZE)
50 CONFIGURE_ENV+= PAGE=${PAPERSIZE:Q}
51 .endif
52
53 # Usually the mdoc.local "volume-operating-system" definition is for
54 # the operating system name often displayed on top of man pages. And
55 # "operating-system" is for the default .Os value (operating system
56 # and version/release) and is usually displayed at bottom of man page.
57 # XXX Use "pkgsrc" as default .Os value.
58 post-patch:
59         ${SED}  -e "s,@@VOLUME_OPERATING_SYSTEM@@,${OPSYS},g"   \
60                 -e "s,@@OPERATING_SYSTEM@@,pkgsrc,g"    \
61                 ${FILESDIR}/mdoc.local > ${WRKDIR}/mdoc.local
62
63 # Groff installs its own man and ms macros as mgan and mgs if the
64 # configure script thinks replacing the system ones is not safe. Since
65 # this depends heavily on exactly what the system macros are, each
66 # vendor OS is likely to be different and possibly differ by version.
67 #
68 # It also installs wrappers around the system macros for a variety of
69 # other traditional macro packages, if those macros don't have an FSF
70 # copyright.
71
72 post-install:
73         ${INSTALL_DATA} ${WRKDIR}/mdoc.local \
74                 ${DESTDIR}${PREFIX}/share/groff/site-tmac
75         ${FIND} ${DESTDIR}${PREFIX}/lib/groff/site-tmac -type f -print | \
76                 ${SED} 's;${DESTDIR}${PREFIX}/;;g' > ${WRKDIR}/PLIST-local
77         ${RUN}set -e; for f in an.tmac m.tmac mm.tmac mmse.tmac         \
78           mse.tmac s.tmac; do                                           \
79           for p in "" g; do                                             \
80             line="share/groff/${PKGVERSION_NOREV}/tmac/$$p$$f";         \
81             if [ -e "${DESTDIR}${PREFIX}/$$line" ]; then                \
82               break;                                                    \
83             fi;                                                         \
84           done;                                                         \
85           ${ECHO} "$$line" >> ${WRKDIR}/PLIST-local;                    \
86         done
87
88 # we only want the charset.alias file, so no buildlinkery for libiconv
89 DEPENDS+=       libiconv-[0-9]*:../../converters/libiconv
90 .include "../../mk/bsd.pkg.mk"