Fixup fromcvs/togit conversion
[pkgsrcv2.git] / sysutils / heirloom-doc / Makefile.common
1 # $NetBSD: Makefile.common,v 1.2 2011/05/28 10:03:38 cheusov Exp $
2 # used by archivers/heirloom-tar/Makefile
3 # used by devel/heirloom-common/Makefile
4 # used by devel/heirloom-getopt/Makefile
5 # used by devel/heirloom-libcommon/Makefile
6 # used by devel/heirloom-what/Makefile
7 # used by devel/libuxre/Makefile
8 # used by lang/heirloom-awk/Makefile
9 # used by math/heirloom-factor/Makefile
10 # used by math/heirloom-units/Makefile
11 # used by misc/heirloom-banner/Makefile
12 # used by misc/heirloom-cal/Makefile
13 # used by misc/heirloom-calendar/Makefile
14 # used by misc/heirloom-hd/Makefile
15 # used by misc/heirloom-more/Makefile
16 # used by misc/heirloom-od/Makefile
17 # used by misc/heirloom-printenv/Makefile
18 # used by misc/heirloom-printf/Makefile
19 # used by misc/heirloom-random/Makefile
20 # used by misc/heirloom-sleep/Makefile
21 # used by misc/heirloom-sum/Makefile
22 # used by misc/heirloom-tcopy/Makefile
23 # used by misc/heirloom-time/Makefile
24 # used by news/heirloom-news/Makefile
25 # used by security/heirloom-su/Makefile
26 # used by sysutils/heirloom-basename/Makefile
27 # used by sysutils/heirloom-cat/Makefile
28 # used by sysutils/heirloom-chmod/Makefile
29 # used by sysutils/heirloom-chown/Makefile
30 # used by sysutils/heirloom-cksum/Makefile
31 # used by sysutils/heirloom-cmp/Makefile
32 # used by sysutils/heirloom-copy/Makefile
33 # used by sysutils/heirloom-cp/Makefile
34 # used by sysutils/heirloom-csplit/Makefile
35 # used by sysutils/heirloom-dd/Makefile
36 # used by sysutils/heirloom-dirname/Makefile
37 # used by sysutils/heirloom-doc/Makefile
38 # used by sysutils/heirloom-du/Makefile
39 # used by sysutils/heirloom-env/Makefile
40 # used by sysutils/heirloom-file/Makefile
41 # used by sysutils/heirloom-find/Makefile
42 # used by sysutils/heirloom-getconf/Makefile
43 # used by sysutils/heirloom-groups/Makefile
44 # used by sysutils/heirloom-hostname/Makefile
45 # used by sysutils/heirloom-id/Makefile
46 # used by sysutils/heirloom-listusers/Makefile
47 # used by sysutils/heirloom-ln/Makefile
48 # used by sysutils/heirloom-logins/Makefile
49 # used by sysutils/heirloom-logname/Makefile
50 # used by sysutils/heirloom-ls/Makefile
51 # used by sysutils/heirloom-mesg/Makefile
52 # used by sysutils/heirloom-mkdir/Makefile
53 # used by sysutils/heirloom-mkfifo/Makefile
54 # used by sysutils/heirloom-mknod/Makefile
55 # used by sysutils/heirloom-nice/Makefile
56 # used by sysutils/heirloom-nohup/Makefile
57 # used by sysutils/heirloom-pathchk/Makefile
58 # used by sysutils/heirloom-pgrep/Makefile
59 # used by sysutils/heirloom-priocntl/Makefile
60 # used by sysutils/heirloom-ps/Makefile
61 # used by sysutils/heirloom-psrinfo/Makefile
62 # used by sysutils/heirloom-pwd/Makefile
63 # used by sysutils/heirloom-renice/Makefile
64 # used by sysutils/heirloom-rm/Makefile
65 # used by sysutils/heirloom-rmdir/Makefile
66 # used by sysutils/heirloom-setpgrp/Makefile
67 # used by sysutils/heirloom-shl/Makefile
68 # used by sysutils/heirloom-sleep/Makefile
69 # used by sysutils/heirloom-sort/Makefile
70 # used by sysutils/heirloom-split/Makefile
71 # used by sysutils/heirloom-stty/Makefile
72 # used by sysutils/heirloom-sync/Makefile
73 # used by sysutils/heirloom-tapecntl/Makefile
74 # used by sysutils/heirloom-tee/Makefile
75 # used by sysutils/heirloom-touch/Makefile
76 # used by sysutils/heirloom-tsort/Makefile
77 # used by sysutils/heirloom-tty/Makefile
78 # used by sysutils/heirloom-uname/Makefile
79 # used by sysutils/heirloom-uniq/Makefile
80 # used by sysutils/heirloom-users/Makefile
81 # used by sysutils/heirloom-wc/Makefile
82 # used by sysutils/heirloom-who/Makefile
83 # used by sysutils/heirloom-whoami/Makefile
84 # used by sysutils/heirloom-whodo/Makefile
85 # used by sysutils/heirloom-xargs/Makefile
86 # used by sysutils/heirloom-yes/Makefile
87 # used by textproc/heirloom-bdiff/Makefile
88 # used by textproc/heirloom-bfs/Makefile
89 # used by textproc/heirloom-col/Makefile
90 # used by textproc/heirloom-comm/Makefile
91 # used by textproc/heirloom-cut/Makefile
92 # used by textproc/heirloom-diff3/Makefile
93 # used by textproc/heirloom-ed/Makefile
94 # used by textproc/heirloom-fmt/Makefile
95 # used by textproc/heirloom-fold/Makefile
96 # used by textproc/heirloom-grep/Makefile
97 # used by textproc/heirloom-head/Makefile
98 # used by textproc/heirloom-join/Makefile
99 # used by textproc/heirloom-line/Makefile
100 # used by textproc/heirloom-nl/Makefile
101 # used by textproc/heirloom-paste/Makefile
102 # used by textproc/heirloom-pg/Makefile
103 # used by textproc/heirloom-pr/Makefile
104 # used by textproc/heirloom-sdiff/Makefile
105 # used by textproc/heirloom-sed/Makefile
106 # used by textproc/heirloom-tail/Makefile
107 # used by textproc/heirloom-tr/Makefile
108 # used by textproc/heirloom-ul/Makefile
109 # used by textproc/heirloom-uniq/Makefile
110 # used by textproc/heirloom-wc/Makefile
111 # used by time/heirloom-date/Makefile
112
113 DISTNAME=       heirloom-${HEIRLOOM_VER}
114 MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE:=heirloom/}
115 EXTRACT_SUFX=   .tar.bz2
116 HOMEPAGE=       http://heirloom.sourceforge.net/
117 MAINTAINER=     cheusov@NetBSD.org
118 COMMENT?=       Collection of standard Unix utilities (${PKGBASE:S/heirloom-//})
119
120 HEIRLOOM_VER=           070715
121
122 PKG_DESTDIR_SUPPORT=    user-destdir
123
124 PATCHDIR=       ${.CURDIR}/../../sysutils/heirloom-doc/patches
125 DISTINFO_FILE=  ${.CURDIR}/../../sysutils/heirloom-doc/distinfo
126
127 CONFLICTS+=     heirloom-toolchest-[0-9]*
128
129 DESCR_SRC=      ${.CURDIR}/../../sysutils/heirloom-doc/DESCR.common
130
131 MAKE_FILE=      makefile.hl
132 HLROOT=         heirloom
133 PLIST_SUBST+=   HLROOT=${HLROOT}
134
135 .include "../../mk/bsd.prefs.mk"
136
137 CFLAGS.Linux+=          -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64L
138 CFLAGS.Interix+=        -Dstrtoll=strtol -Dstrtoull=strtoul
139 CFLAGS.Interix+=        -Dintptr_t=int -Datoll=atol -Dinitgroups="(0)"
140
141 .if ${NEED_LIBKVM:U0}
142 LDFLAGS.NetBSD+=        -lkvm
143 LDFLAGS.FreeBSD+=       -lkvm
144 LDFLAGS.OpenBSD+=       -lkvm
145 LDFLAGS.DragonFly+=     -lkvm
146 .endif
147
148 .if ${NEED_LIBSOCKET:U0}
149 LDFLAGS.SunOS+=         -lsocket
150 .endif
151
152 .if ${NEED_LIBCRYPT:U0}
153 LCRYPT= -lcrypt
154 .  if ${OPSYS} == "OpenBSD"
155 LCRYPT=
156 .  endif
157 .endif
158
159 .if ${NEED_LIBCURSES:U0}
160 LCURS=-lcurses
161
162 .  if ${OPSYS} == "NetBSD"
163 CFLAGS+=        -DUSE_TERMCAP
164 LCURS=          -ltermcap
165 .  endif
166 .endif
167
168 .if ${NEED_ZLIB:U0}
169 LDFLAGS+=       -lz
170 .endif
171
172 .if ${NEED_BZLIB:U0}
173 LDFLAGS+=       -lbz2
174 .endif
175
176 HLPREFIX=       ${PREFIX:Q}/${HLROOT}
177
178 MAKE_FLAGS+=    UCBINST=${INSTALL:Q}
179 MAKE_FLAGS+=    ROOT=${DESTDIR}
180 MAKE_FLAGS+=    DEFBIN=${HLPREFIX:Q}/bin
181 MAKE_FLAGS+=    SV3BIN=${HLPREFIX:Q}/bin
182 MAKE_FLAGS+=    S42BIN=${HLPREFIX:Q}/bin/s42
183 MAKE_FLAGS+=    SUSBIN=${HLPREFIX:Q}/bin/posix
184 MAKE_FLAGS+=    SU3BIN=${HLPREFIX:Q}/bin/posix2001
185 MAKE_FLAGS+=    UCBBIN=${HLPREFIX:Q}/ucb
186 MAKE_FLAGS+=    CCSBIN=${HLPREFIX:Q}/bin/ccs
187 MAKE_FLAGS+=    DEFLIB=${HLPREFIX:Q}/lib
188 MAKE_FLAGS+=    DEFSBIN=${HLPREFIX:Q}/sbin
189 MAKE_FLAGS+=    MANDIR=${HLPREFIX:Q}/man
190 MAKE_FLAGS+=    DFLDIR=${HLPREFIX:Q}/etc/default
191 MAKE_FLAGS+=    SPELLHIST=${HLPREFIX:Q}/var/adm/spellhist
192 MAKE_FLAGS+=    SULOG=${HLPREFIX:Q}/var/log/sulog
193 MAKE_FLAGS+=    MANINST=${INSTALL_MAN:Q}
194 MAKE_FLAGS+=    LCURS=${LCURS}
195 MAKE_FLAGS+=    LIBZ=-lz
196 MAKE_FLAGS+=    USE_ZLIB=${USE_ZLIB}
197 MAKE_FLAGS+=    LIBBZ2=-lbz2
198 MAKE_FLAGS+=    USE_BZLIB=${USE_BZLIB}
199 MAKE_FLAGS+=    LD=${CC:Q}
200 MAKE_FLAGS+=    LDFLAGS=${LDFLAGS:Q}
201 MAKE_FLAGS+=    CPPFLAGS=${CPPFLAGS:Q}
202 MAKE_FLAGS+=    CFLAGS=${CFLAGS:Q}
203 MAKE_FLAGS+=    CFLAGSS=${CFLAGS:Q}
204 MAKE_FLAGS+=    CFLAGS2=${CFLAGS:Q}
205 MAKE_FLAGS+=    CFLAGS=${CFLAGS:Q}
206 MAKE_FLAGS+=    STRIP=true
207 MAKE_FLAGS+=    LCRYPT=${LCRYPT}
208 MAKE_FLAGS+=    UCBINST=${INSTALL:Q}
209 MAKE_FLAGS+=    ICOMMON=
210 MAKE_FLAGS+=    LCOMMON=
211 MAKE_FLAGS+=    IUXRE=
212
213 .if ${NEED_LIBUXRE:U0}
214 MAKE_FLAGS+=    LUXRE=-luxre
215 .endif
216
217 .if empty(PKGNAME:Mheirloom-doc-*)
218 MAKE_FLAGS+=    NO_INSTALL_INTRO=1
219 .endif
220
221 .if empty(PKGNAME:Mheirloom-doc-*) && empty(PKGNAME:Mheirloom-libcommon-*)
222 LDFLAGS+=       -lheirloomcommon
223 .endif
224
225 .if empty(PKGNAME:Mheirloom-doc-*)
226 DEPENDS+=       heirloom-doc-${HEIRLOOM_VER}:../../sysutils/heirloom-doc
227 .endif
228
229 # makefile.hl is for case insensitive HFS+ (Darwin)
230 .if ${NEED_PRE_BUILD:U1}
231 pre-build:
232         set -e; cd ${WRKSRC}; \
233         ${TEST} -f makefile.hl || mv makefile makefile.hl; \
234         ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} -f makefile.hl makefiles
235 .endif