ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/Mk/bsd.mport.mk
Revision: 1362
Committed: Thu Apr 5 00:57:01 2007 UTC (17 years, 1 month ago) by ctriv
File size: 198504 byte(s)
Log Message:
Various bug fixes.
imake now works properly.
linux ports now see /compat/linux in their fake dirs.
you can now move FAKE_INSTALLDIR upwards from $WRKDIR, and make clean will
still delete it.

File Contents

# Content
1 #-*- mode: makefile; tab-width: 4; -*-
2 # ex:ts=4
3 #
4 # $MidnightBSD: mports/Mk/bsd.mport.mk,v 1.8 2007/04/04 16:00:22 ctriv Exp $
5 # $FreeBSD: ports/Mk/bsd.port.mk,v 1.540 2006/08/14 13:24:18 erwin Exp $
6 #
7 # bsd.port.mk - 940820 Jordan K. Hubbard.
8 # This file is in the public domain.
9 #
10 # Please view me with 4 column tabs!
11
12 # This is the master file for the most common elements to all port
13 # Makefile in the ports system. For a more general overview of its
14 # use and importance, see the Porter's Handbook.
15
16 # There are two different types of "maintainers" in the ports framework.
17 # The maintainer alias of the bsd.port.mk file is listed below in the
18 # FreeBSD_MAINTAINER entry. You should consult them if you have any
19 # questions/suggestions regarding this file.
20 #
21 # DO NOT COMMIT CHANGES TO THIS FILE BY YOURSELF, EVEN IF YOU DID NOT GET
22 # A RESPONSE FROM THE MAINTAINER(S) WITHIN A REASONABLE TIMEFRAME! ALL
23 # UNAUTHORISED CHANGES WILL BE UNCONDITIONALLY REVERTED!
24
25 FreeBSD_MAINTAINER= portmgr@MidnightBSD.org
26
27 # For each port, the MAINTAINER variable is what you should consult for
28 # contact information on the person(s) to contact if you have questions/
29 # suggestions about that specific port. By default (if no MAINTAINER
30 # is listed), a port is maintained by the subscribers of the ports@FreeBSD.org
31 # mailing list, and any correspondence should be directed there.
32 #
33 # MAINTAINER - The e-mail address of the contact person for this port.
34 # Default: ports@midnightbsd.org
35 #
36 # These are meta-variables that are automatically set to the system
37 # you are running on. These are provided in case you need to take
38 # different actions for different values.
39 #
40 # ARCH - The architecture of the target machine, such as would be
41 # returned by "uname -p". (Note: Ports should test against
42 # ARCH, and not the host machine's architecture which is
43 # MACHINE_ARCH, to enable ports to be cross-built.)
44 # OPSYS - Portability clause. This is the operating system the
45 # makefile is being used on. Automatically set to
46 # "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
47 # OSREL - The release version (numeric) of the operating system.
48 # OSVERSION - The value of __FreeBSD_version.
49 # PORTOBJFORMAT - The object format ("aout" or "elf").
50 #
51 # This is the beginning of the list of all variables that need to be
52 # defined in a port, listed in order that they should be included
53 # to fit in with existing conventions. (Exception: MAINTAINER actually
54 # should appear after EXTRACT_ONLY and before MASTER_SITE_BACKUP).
55 #
56 # These variables are used to identify your port.
57 #
58 # PORTNAME - Name of software. Mandatory.
59 # PORTVERSION - Version of software. Mandatory when no DISTVERSION is given.
60 # PORTREVISION - Version of port. Optional. Commonly used to indicate
61 # that an update has happened that affects the port
62 # framework itself, but not the distributed software
63 # (e.g., local patches or Makefile changes).
64 # PORTEPOCH - Optional. In certain odd cases, the PORTREVISION logic
65 # can be fooled by ports that appear to go backwards
66 # numerically (e.g. if port-0.3 is newer than port-1998).
67 # In this case, incrementing PORTEPOCH forces the revision.
68 # Default: 0 (no effect).
69 # PKGNAME - Always defined as
70 # ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}.
71 # Do not define this in your Makefile.
72 # PKGNAMEPREFIX - Prefix to specify that port is language-specific, etc.
73 # Optional.
74 # PKGNAMESUFFIX - Suffix to specify compilation options. Optional.
75 # PKGVERSION - Always defined as
76 # ${PORTVERSION},
77 # Do not define this in your Makefile.
78 # UNIQUENAME - A name for your port that is globally unique. By default,
79 # this is set to ${LATEST_LINK} when LATEST_LINK is set,
80 # and to ${PKGNAMEPREFIX}${PORTNAME} otherwise.
81 # DISTVERSION - Vendor version of the distribution.
82 # Default: ${PORTVERSION}
83 # DISTNAME - Name of port or distribution used in generating
84 # WRKSRC and DISTFILES below.
85 # Default:
86 # ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
87 # CATEGORIES - A list of descriptive categories into which this port falls.
88 # Mandatory.
89 #
90 # These variable describe how to fetch files required for building the port.
91 #
92 # DISTFILES - Name(s) of archive file(s) containing distribution.
93 # Set this to an empty string if the port doesn't require it.
94 # Default: ${DISTNAME}${EXTRACT_SUFX}
95 # EXTRACT_SUFX - Suffix for archive names
96 # You never have to set both DISTFILES and EXTRACT_SUFX.
97 # Default: .tar.bz2 if USE_BZIP2 is set, .zip if USE_ZIP is
98 # set, .tar.gz otherwise.
99 # MASTER_SITES - Primary location(s) for distribution files if not found
100 # locally. See bsd.sites.mk for common choices for
101 # MASTER_SITES.
102 # MASTER_SITE_SUBDIR
103 # - Subdirectory of MASTER_SITES. Will sometimes need to be
104 # set to ${PORTNAME} for (e.g.) MASTER_SITE_SOURCEFORGE.
105 # Only guaranteed to work for choices of ${MASTER_SITES}
106 # defined in bsd.sites.mk.
107 # Default: not set.
108 # PATCHFILES - Name(s) of additional files that contain distribution
109 # patches. Make will look for them at PATCH_SITES (see below).
110 # They will automatically be uncompressed before patching if
111 # the names end with ".gz", ".bz2" or ".Z".
112 # Default: not set.
113 # PATCH_SITES - Primary location(s) for distribution patch files
114 # if not found locally.
115 # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES} and
116 # ${PATCHFILES} will be put in this subdirectory of
117 # ${DISTDIR} (see below). Also they will be fetched in this
118 # subdirectory from FreeBSD mirror sites.
119 # ALLFILES - All of ${DISTFILES} and ${PATCHFILES}.
120 # IGNOREFILES - If set, don't perform checksum checks on these files.
121 # NOFETCHFILES - If set, don't download these files from the ${MASTER_SITES}
122 # or ${MASTER_SITE_BACKUP} (but do from
123 # ${MASTER_SITE_OVERRIDE})
124 # EXTRACT_ONLY - If set, a subset of ${DISTFILES} you want to
125 # actually extract.
126 # ALWAYS_KEEP_DISTFILES
127 # - If set, the package building cluster will save the distfiles
128 # along with the packages. This may be required to comply with
129 # some licenses, e.g. GPL in some cases.
130 # Default: not set.
131 #
132 # (NOTE: by convention, the MAINTAINER entry (see above) should go here.)
133 #
134 # These variables are typically set in /etc/make.conf to indicate
135 # the user's preferred location to fetch files from. You should
136 # rarely need to set these.
137 #
138 # MASTER_SITE_BACKUP
139 # - Backup location(s) for distribution files and patch
140 # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
141 # Default:
142 # ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
143 # MASTER_SITE_OVERRIDE
144 # - If set, override the MASTER_SITES setting with this
145 # value.
146 # MASTER_SITE_FREEBSD
147 # - If set, only use ${MASTER_SITE_BACKUP} for
148 # MASTER_SITES.
149 # CD_MOUNTPTS - List of CDROM mountpoints to look for distfiles under.
150 # This variable supercedes CD_MOUNTPT, which is
151 # obsolete.
152 #
153 # Set these if your port should not be built under certain circumstances.
154 # These are string variables; you should set them to the reason why
155 # they are necessary.
156 #
157 # RESTRICTED - Prevent the distribution of distfiles and packages to
158 # the FTP sites or on CDROM (e.g. forbidden by license
159 # considerations).
160 # NO_CDROM - Packages and distfiles may not go on CDROM (e.g. must
161 # not be re-sold) but can go on FTP sites.
162 # NO_PACKAGE - Port should not be packaged for ftp sites or CDROMs,
163 # but distfiles can be put on ftp sites and CDROMs.
164 # FORBIDDEN - Package build should not be attempted because of
165 # security vulnerabilities.
166 # IGNORE - Package build should be skipped entirely (e.g.
167 # because of serious unfixable problems in the build,
168 # because it cannot be manually fetched, etc). Error
169 # logs will not appear on pointyhat, so this should be
170 # used sparingly.
171 # BROKEN - Port is believed to be broken. Package builds will
172 # still be attempted on the pointyhat package cluster to
173 # test this assumption.
174 # DEPRECATED - Port is deprecated to install. Advisory only.
175 # EXPIRATION_DATE
176 # - If DEPRECATED is set, determines a date when
177 # the port is planed to remove. The date format is
178 # ISO 8601 (YYYY-MM-DD).
179 #
180 # DISABLE_VULNERABILITIES
181 # - If set, do not check if the port is listed in the
182 # vulnerabilities database.
183 #
184 # In addition to RESTRICTED or NO_CDROM, if only a subset of distfiles
185 # or patchfiles have redistribution restrictions, set the following
186 # to the list of such files.
187 #
188 # RESTRICTED_FILES
189 # - List of files that cannot be redistributed.
190 # Default: "${DISTFILES} ${PATCHFILES}" if RESTRICTED
191 # or NO_CDROM is set, empty otherwise.
192 #
193 # These variables are booleans, so you don't need to set them to the reason.
194 #
195 # IS_INTERACTIVE
196 # - Set this if your port needs to interact with the user
197 # during any step in a package build. User can then decide
198 # to skip this port by setting ${BATCH}, or compiling only
199 # the interactive ports by setting ${INTERACTIVE}.
200 # Default: not set.
201 # USE_SUBMAKE - Set this if you want that each of the port's main 6 targets
202 # (extract, patch, configure, build, install and package) to be
203 # executed in a separate make(1) process. Useful when one of
204 # the stages needs to influence make(1) variables of the later
205 # stages using ${WRKDIR}/Makefile.inc generated on the fly.
206 # Default: not set.
207 #
208 # Set these if your port only makes sense to certain architectures.
209 # They are lists containing names for them (e.g., "alpha i386").
210 # (Defaults: not set.)
211 #
212 # ONLY_FOR_ARCHS
213 # - Only build ports if ${ARCH} matches one of these.
214 # NOT_FOR_ARCHS - Only build ports if ${ARCH} doesn't match one of these.
215 # ONLY_FOR_ARCHS_REASON
216 # ONLY_FOR_ARCHS_REASON_${ARCH}
217 # - Reason why it's only for ${ONLY_FOR_ARCHS}s
218 # NOT_FOR_ARCHS_REASON
219 # NOT_FOR_ARCHS_REASON_${ARCH}
220 # - Reason why it's not for ${NOT_FOR_ARCHS}s
221 # IA32_BINARY_PORT - Set this instead of ONLY_FOR_ARCHS if the given port
222 # fetches and installs compiled i386 binaries.
223 #
224 # Dependency checking. Use these if your port requires another port
225 # not in the list below. (Default: empty.)
226 #
227 # EXTRACT_DEPENDS
228 # - A list of "path:dir[:target]" tuples of other ports this
229 # package depends on in the "extract" stage. "path" is
230 # the name of a file if it starts with a slash (/), an
231 # executable otherwise. make will test for the existence
232 # (if it is a full pathname) or search for it in your
233 # $PATH (if it is an executable) and go into "dir" to do
234 # a "make all install" if it's not found. If the third
235 # field ("target") exists, it will be used instead of
236 # ${DEPENDS_TARGET}.
237 # PATCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
238 # package depends on in the "patch" stage. "path" is the
239 # name of a file if it starts with a slash (/), an
240 # executable otherwise. make will test for the existence
241 # (if it is a full pathname) or search for it in your
242 # $PATH (if it is an executable) and go into "dir" to do
243 # a "make all install" if it's not found. If the third
244 # field ("target") exists, it will be used instead of
245 # ${DEPENDS_TARGET}.
246 # FETCH_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
247 # package depends in the "fetch" stage. "path" is the
248 # name of a file if it starts with a slash (/), an
249 # executable otherwise. make will test for the
250 # existence (if it is a full pathname) or search for
251 # it in your $PATH (if it is an executable) and go
252 # into "dir" to do a "make all install" if it's not
253 # found. If the third field ("target") exists, it will
254 # be used instead of ${DEPENDS_TARGET}.
255 # BUILD_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
256 # package depends to build (between the "extract" and
257 # "build" stages, inclusive). The test done to
258 # determine the existence of the dependency is the
259 # same as FETCH_DEPENDS. If the third field ("target")
260 # exists, it will be used instead of ${DEPENDS_TARGET}.
261 # RUN_DEPENDS - A list of "path:dir[:target]" tuples of other ports this
262 # package depends to run. The test done to determine
263 # the existence of the dependency is the same as
264 # FETCH_DEPENDS. This will be checked during the
265 # "install" stage and the name of the dependency will
266 # be put into the package as well. If the third field
267 # ("target") exists, it will be used instead of
268 # ${DEPENDS_TARGET}.
269 # LIB_DEPENDS - A list of "lib:dir[:target]" tuples of other ports this
270 # package depends on. "lib" is the name of a shared library.
271 # make will use "ldconfig -r" to search for the library.
272 # lib can contain extended regular expressions.
273 # DEPENDS - A list of "dir[:target]" tuples of other ports this
274 # package depends on being made first. Use this only for
275 # things that don't fall into the above four categories.
276 # If the second field ("target") exists, it will be used
277 # instead of ${DEPENDS_TARGET}.
278 #
279 # DEPENDS_TARGET
280 # - The default target to execute when a port is calling a
281 # dependency.
282 # Default: install
283 #
284 # These variables control options about how a port gets built and/or
285 # are shorthand notations for common sets of dependencies.
286 # Use these if your port uses some of the common software packages. By
287 # convention these should be set to 'yes', although they only need to be
288 # defined. Defaults: not set, unless explicitly indicated below.
289 #
290 # Note: the distinction between the USE_* and WANT_* variables, and the
291 # WITH_* and WITHOUT_* variables, are that the former are restricted to
292 # usage inside the ports framework, and the latter are reserved for user-
293 # settable options. (Setting USE_* in /etc/make.conf is always wrong).
294 #
295 # WITH_DEBUG - If set, debugging flags are added to CFLAGS and the
296 # binaries don't get stripped by INSTALL_PROGRAM.
297 # Besides, individual ports might add their specific
298 # to produce binaries for debugging purposes.
299 # You can override the debug flags that are passed to
300 # the compiler by setting DEBUG_FLAGS. It is set to
301 # "-g" at default.
302 #
303 # USE_BZIP2 - If set, this port tarballs use bzip2, not gzip, for
304 # compression.
305 # USE_ZIP - If set, this port distfile uses zip, not tar w/[bg]zip
306 # for compression.
307 # USE_DOS2UNIX - If set to "YES", remove the ^M from all files
308 # under ${WRKSRC}. If set to a string, remove in all
309 # files under ${WRKSRC} with one of these names the ^Ms.
310 # USE_GCC - If set, this port requires this version of gcc, either in
311 # the system or installed from a port.
312 # USE_GMAKE - If set, this port uses gmake.
313 # GMAKE - Set to path of GNU make if not in $PATH.
314 # Default: gmake
315 ##
316 # USE_GETOPT_LONG
317 # - If set, this port uses getopt_long. If OSVERSION
318 # less than 500041, automatically adds devel/libgnugeopt
319 # to LIB_DEPENDS, and pass adjusted values of
320 # CPPFLAGS and LDFLAGS in CONFIGURE_ENV.
321 ##
322 # USE_ICONV - If set, this port uses libiconv.
323 # USE_GETTEXT - If set, this port uses GNU gettext (libintl).
324 ##
325 # USE_PERL5 - If set, this port uses perl5 in one or more of the extract,
326 # patch, build, install or run phases.
327 # USE_PERL5_BUILD
328 # - If set, this port uses perl5 in one or more of the extract,
329 # patch, build or install phases.
330 # USE_PERL5_RUN - If set, this port uses perl5 for running.
331 # PERL5 - Set to full path of perl5, either in the system or
332 # installed from a port.
333 # PERL - Set to full path of perl5, either in the system or
334 # installed from a port, but without the version number.
335 # Use this if you need to replace "#!" lines in scripts.
336 # PERL_VERSION - Full version of perl5 (see below for current value).
337 # PERL_VER - Short version of perl5 (see below for current value).
338 # PERL_LEVEL - Perl version as an integer of the form MNNNPP, where
339 # M is major version, N is minor version, and P is
340 # the patch level. E.g., PERL_VERSION=5.6.1 would give
341 # a PERL_LEVEL of 500601. This can be used in comparisons
342 # to determine if the version of perl is high enough,
343 # whether a particular dependency is needed, etc.
344 # PERL_ARCH - Directory name of architecture dependent libraries
345 # (value: ${ARCH}-freebsd).
346 # PERL_PORT - Name of the perl port that is installed
347 # (value: perl5)
348 # SITE_PERL - Directory name where site specific perl packages go.
349 # This value is added to PLIST_SUB.
350 # PERL_MODBUILD - Use Module::Build to configure, build and install port.
351 ##
352 # USE_GHOSTSCRIPT
353 # - If set, this port needs ghostscript to both
354 # build and run.
355 # USE_GHOSTSCRIPT_BUILD
356 # - If set, this port needs ghostscript to build.
357 # USE_GHOSTSCRIPT_RUN
358 # - If set, this port needs ghostscript to run.
359 # GHOSTSCRIPT_PORT
360 # - The port that provides postscript functionality.
361 # Some installations may wish to override the default
362 # to specify a version without X11 and/or localized
363 # versions for their nationality.
364 # WITH_GHOSTSCRIPT_GPL
365 # - If set, this port uses the GPL version of the ghostscript
366 # software instead of the GNU version, which is used otherwise.
367 # WITH_GHOSTSCRIPT_AFPL
368 # - If set, this port uses the AFPL version of the ghostscript
369 # software instead of the GNU version, which is used otherwise.
370 ##
371 # USE_BISON - If set, this port uses bison for building.
372 ##
373 # USE_IMAKE - If set, this port uses imake.
374 # XMKMF - Set to path of `xmkmf' if not in $PATH
375 # Default: xmkmf -a
376 # USE_X_PREFIX - If set, this port installs in ${X11BASE}.
377 # USE_XLIB - If set, this port uses the X libraries. In the USE_LINUX
378 # case the linux X libraries are referenced.
379 #
380 # USE_FREETYPE - If set, this port uses the freetype print libraries.
381 # USE_GL - If set, this port uses libGL
382 # USE_MOTIF - If set, this port uses a Motif toolkit. Implies USE_XPM.
383 # NO_OPENMOTIF - If set, this port uses a custom Motif toolkit
384 # instead of Openmotif.
385 # Used only when USE_MOTIF is set.
386 # WANT_LESSTIF - If set, this port uses Lesstif as Motif toolkit.
387 # Used only when USE_MOTIF is set. Implies
388 # NO_OPENMOTIF.
389 ##
390 # USE_SDL - If set, this port uses the sdl libraries.
391 # See bsd.sdl.mk for more information.
392 # USE_XPM - If set, this port uses the xpm graphics libraries.
393 ##
394 # USE_OPENSSL - If set, this port relies on the OpenSSL package.
395 ##
396 # USE_OPENLDAP - If set, this port uses the OpenLDAP libraries.
397 # Implies: WANT_OPENLDAP_VER?=23
398 # WANT_OPENLDAP_VER
399 # - Legal values are: 22, 23, 24
400 # If set to an unkown value, the port is marked BROKEN.
401 # WANT_OPENLDAP_SASL
402 # - If set, the system should use OpenLDAP libraries
403 # with SASL support.
404 ##
405 # USE_FAM - If set, this port uses the File Alteration Monitor.
406 #
407 # WANT_FAM_SYSTEM
408 # - Legal values are: gamin (default),fam
409 # If set to an unknown value, the port is marked IGNORE.
410 ##
411 # USE_AUTOTOOLS - If set, this port uses various GNU autotools
412 # (libtool, autoconf, autoheader, automake et al.)
413 # See bsd.autotools.mk for more details.
414 ##
415 # USE_SCONS - If set, this port uses the Python-based SCons build system
416 # See bsd.scons.mk for more details.
417 ##
418 # USE_JAVA - If set, this port relies on the Java language.
419 # Implies inclusion of bsd.java.mk. (Also see
420 # that file for more information on USE_JAVA_*).
421 # USE_PYTHON - If set, this port relies on the Python language.
422 # Implies inclusion of bsd.python.mk. (Also see
423 # that file for more information on USE_PYTHON_*
424 # and USE_PYDISTUTILS).
425 # USE_RUBY - If set, this port relies on the Ruby language.
426 # Implies inclusion of bsd.ruby.mk. (Also see
427 # that file for more information on USE_RUBY_*).
428 # USE_GNUSTEP - If set, this port relies on the GNUstep system.
429 # Implies the inclusion of bsd.gnustep.mk.
430 # (Also see that file for more information on
431 # USE_GNUSTEP_*).
432 ##
433 # USE_GNOME - A list of the Gnome dependencies the port has (e.g.,
434 # glib12, gtk12). Implies that the port needs Gnome.
435 # Implies inclusion of bsd.gnome.mk. See bsd.gnome.mk
436 # or http://www.FreeBSD.org/gnome/docs/porting.html
437 # for more details.
438 ##
439 # USE_WX - If set, this port uses the WxWidgets library and related
440 # components. See bsd.wx.mk for more details.
441 # USE_KDEBASE_VER
442 # - Set to 3 to use the KDE windowing system.
443 # Implies inclusion of bsd.kde.mk.
444 # USE_KDELIBS_VER
445 # - Set to 3 to use the KDE libraries.
446 # Implies inclusion of bsd.kde.mk.
447 # USE_QT_VER - Set to 3 to use the QT libraries.
448 # Implies inclusion of bsd.kde.mk.
449 ##
450 # USE_LINUX - Set to yes to say the port needs the default linux base port.
451 # Set to value <X>, if the port needs emulators/linux_base-<X>.
452 # If set to "7", a dependency is registered to emulators/linux_base.
453 # Implies appropriate settings for NO_FILTER_SHLIBS,
454 # STRIP and STRIP_CMD.
455 # USE_LINUX_PREFIX
456 # - controls the action of PREFIX (see above). Only use this
457 # if the port is a linux infrastructure port (e.g. contains libs
458 # or a sound server which supports the FreeBSD native one),
459 # use the default or the X11 prefix if it's a leaf port
460 # (e.g. a game or program).
461 # Implies NO_MTREE=yes, and, if INSTALLS_SHLIB is defined:
462 # - USE_LINUX=yes
463 # - appropriate invocation of the Linux ldconfig
464 # USE_LINUX_RPM - Set to yes to pull in variables and targets useful to Linux
465 # RPM ports.
466 # Implies inclusion of bsd.linux-rpm.mk.
467 # AUTOMATIC_PLIST
468 # - Set to yes to enable automatic packing list generation.
469 # Currently has no effect unless USE_LINUX_RPM is set.
470 #
471 # OVERRIDE_LINUX_BASE_PORT
472 # - This specifies the default linux base to use, for valid
473 # values have a look at the description of USE_LINUX. This is
474 # an user-only variable. Don't use it in any port, it's meant
475 # to be used in make.conf.
476 #
477 # LINUX_BASE_PORT
478 # - This is a read-only variable, it gets set to a value which is
479 # usable in *_DEPENDS (e.g. BUILD_DEPENDS=${LINUX_BASE_PORT}).
480 # It honors USE_LINUX=foo and OVERRIDE_LINUX_BASE_PORT.
481 # USE_RC_SUBR - If set, the ports startup/shutdown script uses the common
482 # routines found in etc/rc.subr and may need to
483 # depend on the sysutils/rc_subr port.
484 # If this is set to a list of files, these files will be
485 # automatically added to ${SUB_FILES}, some %%VAR%%'s will
486 # automatically be expanded, they will be installed in
487 # ${TARGETDIR}/etc/rc.d and added to the packing list.
488 # USE_RCORDER - List of rc.d startup scripts to be called early in the boot
489 # process. This acts exactly like USE_RC_SUBR except that
490 # scripts are installed in /etc/rc.d.
491 # RC_SUBR - Set to path of rc.subr.
492 # Default: ${LOCALBASE}/etc/rc.subr.
493 ##
494 # USE_APACHE - If set, this port relies on an apache webserver.
495 #
496 # Conflict checking. Use if your port cannot be installed at the same time as
497 # another package.
498 #
499 # CONFLICTS - A list of package name patterns that the port conflicts
500 # with, separated by blanks. The names may include shell
501 # pattern meta-characters "*", "?", "[", "]", and "!".
502 # Example: apache*-1.2* apache*-1.3.[012345] apache-*+ssl_*
503 #
504 # Various directory definitions and variables to control them.
505 # You rarely need to redefine any of these except WRKSRC and NO_WRKSUBDIR.
506 #
507 # TARGETDIR - The fully qualified path, where everything is installed.
508 # See the other variables below.
509 # Default: ${DESTDIR}${PREFIX}
510 #
511 # DESTDIR - The path to the environment we are installing to. Define
512 # this if you want to install packages into a jail
513 # or into an another FreeBSD environment mounted
514 # elsewhere than /. ${PREFIX} is relative to
515 # ${DESTDIR}. E.g. setting DESTDIR=/bla PREFIX=/opt will
516 # result packages installed under /bla/opt and registered
517 # under /bla/var/db/pkg.
518 # Default: not set (means /)
519 #
520 # X11BASE - Where X11 ports install things.
521 # Default: ${DESTDIR}/usr/X11R6
522 # X11BASE_REL - Same as X11BASE, but relative to DESTDIR
523 # Default: /usr/X11R6
524 # LOCALBASE - Where non-X11 ports install things.
525 # Default: ${DESTDIR}/usr/local
526 # LOCALBASE_REL - Same as LOCALBASE, but relative to DESTDIR
527 # Default: /usr/local
528 # LINUXBASE - Where Linux ports install things.
529 # Default: ${DESTDIR}/compat/linux
530 # LINUXBASE_REL - Same as LINUXBASE, but relative to DESTDIR
531 # Default: /compat/linux
532 # PREFIX - Where *this* port installs its files.
533 # Default: ${X11BASE_REL} if USE_X_PREFIX is set,
534 # ${LINUXBASE_REL} if USE_LINUX_PREFIX is set,
535 # otherwise ${LOCALBASE_REL}
536 #
537 # IGNORE_PATH_CHECKS - There are some sanity checks against PREFIX and DESTDIR.
538 # You can diasble these checks with defining
539 # this variable, but this is not recommended!
540 # Only do this if you really know what you are
541 # doing. These sanity checks are the following:
542 # - DESTDIR can't be /. Just leave it undefined
543 # if you want to install to /.
544 # - DESTDIR has to be an absolute path.
545 # - DESTDIR can't have a trailing slash.
546 # - PREFIX has to be an absolute path.
547 # - PREFIX can't have a trailing slash.
548 #
549 # MASTERDIR - Where the port finds patches, package files, etc. Define
550 # this is you have two or more ports that share most of the
551 # files.
552 # Default: ${.CURDIR}
553 # PORTSDIR - The root of the ports tree.
554 # Default: /usr/mports
555 # DISTDIR - Where to search for and store copies of original sources
556 # Default: ${PORTSDIR}/distfiles
557 # PACKAGES - A top level directory where all packages go (rather than
558 # going locally to each port).
559 # Default: ${PORTSDIR}/Packages
560 # WRKDIRPREFIX - The place to root the temporary working directory
561 # hierarchy.
562 # Default: none
563 # WRKDIR - A temporary working directory that gets *clobbered* on clean
564 # Default: ${WRKDIRPREFIX}${.CURDIR}/work
565 # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
566 # unpacks to.
567 # Default: ${WRKDIR}/${DISTNAME} unless NO_WRKSUBDIR is set,
568 # in which case simply ${WRKDIR}
569 # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
570 # PATCHDIR - A directory containing any additional patches you made
571 # to port this software to FreeBSD.
572 # Default: ${MASTERDIR}/files
573 # SCRIPTDIR - A directory containing any auxiliary scripts
574 # Default: ${MASTERDIR}/scripts
575 # FILESDIR - A directory containing any miscellaneous additional files.
576 # Default: ${MASTERDIR}/files
577 # PKGDIR - A directory containing any package creation files.
578 # Default: ${MASTERDIR}
579 #
580 # FAKE_INSTALLDIR - A directory used to creating packages. An install is "faked" into
581 # this dir.
582 # Default: "fake-inst"
583 #
584 # Variables that serve as convenient "aliases" for your *-install targets.
585 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
586 #
587 # INSTALL_PROGRAM
588 # - A command to install binary executables. (By
589 # default, also strips them, unless ${STRIP} is
590 # overridden to be the empty string).
591 # INSTALL_SCRIPT
592 # - A command to install executable scripts.
593 # INSTALL_DATA - A command to install sharable data.
594 # INSTALL_MAN - A command to install manpages. May or not compress,
595 # depending on the value of MANCOMPRESSED (see below).
596 #
597 # Boolean to control whether manpages are installed.
598 #
599 # NO_INSTALL_MANPAGES
600 # - If set, this port doesn't want to install any manpages.
601 # Default: not set, i.e. manpages are installed by default.
602 #
603 # Set the following to specify all manpages that your port installs.
604 # These manpages will be automatically listed in ${PLIST}. Depending
605 # on the setting of NOMANCOMPRESS, the make rules will compress the
606 # manpages for you.
607 #
608 # MAN<sect> - A list of manpages, categorized by section. For
609 # example, if your port has "man/man1/foo.1" and
610 # "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".
611 # The available sections chars are "123456789LN".
612 # MLINKS - A list of <source, target> tuples for creating links
613 # for manpages. For example, "MLINKS= a.1 b.1 c.3 d.3"
614 # will do an "ln -sf a.1 b.1" and "ln -sf c.3 d.3" in
615 # appropriate directories. (Use this even if the port
616 # installs its own manpage links so they will show up
617 # correctly in ${PLIST}.)
618 # MANPREFIX - The directory prefix for ${MAN<sect>} and ${MLINKS}.
619 # Default: ${TARGETDIR}
620 # MAN<sect>PREFIX
621 # - If manual pages of some sections install in different
622 # locations than others, use these.
623 # Default: ${MANPREFIX}
624 # MANCOMPRESSED - This variable can take values "yes", "no" or
625 # "maybe". "yes" means manpages are installed
626 # compressed; "no" means they are not; "maybe" means
627 # it changes depending on the value of NOMANCOMPRESS.
628 # Default: "yes" if USE_IMAKE is set and NO_INSTALL_MANPAGES
629 # is not set, and "no" otherwise.
630 #
631 # Set the following to specify all .info files your port installs.
632 #
633 # INFO - A list of .info files (omitting the trailing ".info");
634 # only one entry per document!
635 # INFO_PATH - Path, where all .info files will be installed by your
636 # port, relative to ${PREFIX}
637 # Default: "share/info" if ${PREFIX} is equal to /usr
638 # and "info" otherwise.
639 #
640 # Set the following to specify all documentation your port installs into
641 # ${DOCSDIR}
642 #
643 # PORTDOCS - A list of files and directories relative to DOCSDIR.
644 # Shell glob patterns can be used, directories include
645 # the entire subtree of contained files and directories.
646 # Should not be set when no documentation files are
647 # installed (for example because NOPORTDOCS is defined).
648 # Useful for dynamically generated documentation.
649 #
650 # Default targets and their behaviors:
651 #
652 # fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined)
653 # into ${DISTDIR} as necessary.
654 # fetch-list - Show list of files that would be retrieved by fetch.
655 # fetch-recursive
656 # - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined),
657 # for port and dependencies into ${DISTDIR} as necessary.
658 # fetch-recursive-list
659 # - Show list of files that would be retrieved by
660 # fetch-recursive.
661 # fetch-required-list
662 # - Show list of files that would be retrieved by
663 # fetch-required.
664 # fetch-required
665 # - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined),
666 # for port and dependencies that are not already installed
667 # into ${DISTDIR}.
668 # all-depends-list
669 # - Show all directories which are dependencies
670 # for this port.
671 # build-depends-list
672 # - Show all directories which are build-dependencies
673 # for this port.
674 # package-depends-list
675 # - Show all directories which are
676 # package-dependencies for this port.
677 # run-depends-list
678 # - Show all directories which are run-dependencies
679 # for this port.
680 #
681 # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
682 # patch - Apply any provided patches to the source.
683 # configure - Runs either GNU configure, one or more local configure
684 # scripts or nothing, depending on what's available.
685 # build - Actually compile the sources.
686 # install - Install the results of a build.
687 # reinstall - Install the results of a build, ignoring "already installed"
688 # flag.
689 # deinstall - Remove the installation.
690 # deinstall-all - Remove all installations with the same PKGORIGIN.
691 # package - Create a package from an _installed_ port.
692 # package-recursive
693 # - Create a package for a port and _all_ of its dependancies.
694 # describe - Try to generate a one-line description for each port for
695 # use in INDEX files and the like.
696 # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
697 # give incorrect results if multiple patches deal with
698 # the same file.
699 # checksum - Use distinfo to ensure that your distfiles are valid.
700 # checksum-recursive
701 # - Run checksum in this port and all dependencies.
702 # makesum - Generate distinfo (only do this for your own ports!).
703 # clean - Remove ${WRKDIR} and other temporary files used for building.
704 # clean-depends - Do a "make clean" for all dependencies.
705 # config - Configure options for this port (using ${DIALOG}).
706 # Automatically run prior to extract, patch, configure, build,
707 # install, and package.
708 # config-recursive
709 # - Configure options for this port for this port and all dependencies.
710 # showconfig - Display options config for this port.
711 # rmconfig - Remove the options config for this port.
712 # rmconfig-recursive
713 # - Remove the options config for this port and all dependencies.
714 #
715 # Default sequence for "all" is:
716 #
717 # check-sanity fetch checksum extract patch configure build
718 #
719 # Please read the comments in the targets section below; you
720 # should be able to use the pre-* or post-* targets/scripts
721 # (which are available for every stage except checksum) or
722 # override the do-* targets to do pretty much anything you want.
723 #
724 # NEVER override the "regular" targets unless you want to open
725 # a major can of worms.
726 #
727 # Set these variables if your port doesn't need some of the steps.
728 # Note that there are no NO_PATCH or NO_CONFIGURE variables because
729 # those steps are empty by default. NO_EXTRACT is not allowed anymore
730 # since we need to at least create ${WRKDIR}. Also, NO_CHECKSUM is a user
731 # variable and is not to be set in a port's Makefile. See above for NO_PACKAGE.
732 #
733 # NO_BUILD - Use a dummy (do-nothing) build target.
734 # NO_INSTALL - Use a dummy (do-nothing) install target.
735 #
736 # Here are some variables used in various stages.
737 #
738 # For options:
739 # OPTIONS - List of what WITH_<option> options this port accept. The
740 # format is <option> "<description>" [on|off]
741 # Example:
742 # FLEXRESP "Flexible response to events" off
743 # which tell that an option WITH_FLEXRESP exists for this port,
744 # that by default it is not defined, and that the description to
745 # show to a user in the config dialog is "Flexible response to
746 # events". If you have more than one option, just chain them
747 # into a single variable. NOTE: To make options work, you need
748 # to include bsd.port.pre.mk before you start testing the
749 # WITH_xyz variables.
750 #
751 # For fetch:
752 #
753 # FETCH_CMD - Full path to ftp/http fetch command if not in $PATH.
754 # Default: "/usr/bin/fetch -ARr"
755 # FETCH_BEFORE_ARGS
756 # - Arguments to ${FETCH_CMD} before filename.
757 # Default: none
758 # FETCH_AFTER_ARGS
759 # - Arguments to ${FETCH_CMD} following filename.
760 # Default: none
761 # FETCH_ENV - Environment to pass to ${FETCH_CMD}.
762 # Default: none
763 # FETCH_REGET - Times to retry fetching of files on checksum errors.
764 # Default: 1
765 #
766 # For extract:
767 #
768 # EXTRACT_CMD - Command for extracting archive: "bzip2" if USE_BZIP2
769 # is set, "unzip" if USE_ZIP is set, "gzip" otherwise.
770 # EXTRACT_BEFORE_ARGS
771 # - Arguments to ${EXTRACT_CMD} before filename.
772 # Default: "-dc"
773 # EXTRACT_AFTER_ARGS
774 # - Arguments to ${EXTRACT_CMD} following filename.
775 # default: "| tar -xf -"
776 # EXTRACT_PRESERVE_OWNERSHIP
777 # - Normally, when run as "root", the extract stage will
778 # change the owner and group of all files under ${WRKDIR}
779 # to 0:0. Set this variable if you want to turn off this
780 # feature.
781 #
782 # For makesum:
783 #
784 # NO_SIZE - Don't record size data in distinfo, needed
785 # when the master site does not report file
786 # sizes, or when multiple valid versions of
787 # a distfile, having different sizes, exist.
788 #
789 # For patch:
790 #
791 # EXTRA_PATCHES - Define this variable if you have patches not in
792 # ${PATCHDIR}. This usually happens when you need to
793 # do some pre-processing before some distribution
794 # patches can be applied. In that case, fetch them as
795 # extra distfiles, put the processed results in
796 # ${WRKDIR}, then point EXTRA_PATCHES to them.
797 # The patches specified by this variable will be
798 # applied after the normal distribution patches but
799 # before those in ${PATCHDIR}.
800 # PATCH_WRKSRC - Directory to apply patches in.
801 # Default: ${WRKSRC}
802 #
803 # For configure:
804 #
805 # HAS_CONFIGURE - If set, this port has its own configure script. The
806 # configure stage will not do anything if this is not set.
807 # GNU_CONFIGURE - If set, you are using GNU configure (optional). Implies
808 # HAS_CONFIGURE.
809 # PERL_CONFIGURE
810 # - Configure using Perl's MakeMaker. Implies USE_PERL5.
811 # CONFIGURE_WRKSRC
812 # - Directory to run configure in.
813 # Default: ${WRKSRC}
814 # CONFIGURE_SCRIPT
815 # - Name of configure script, relative to ${CONFIGURE_WRKSRC}.
816 # Default: "Makefile.PL" if PERL_CONFIGURE is set,
817 # "configure" otherwise.
818 # CONFIGURE_TARGET
819 # - The name of target to call when GNU_CONFIGURE is
820 # defined.
821 # Default: ${ARCH}-portbld-freebsd${OSREL}
822 # CONFIGURE_ARGS
823 # - Pass these args to configure if ${HAS_CONFIGURE} is set.
824 # Default: "--prefix=${PREFIX} ${CONFIGURE_TARGET}" if
825 # GNU_CONFIGURE is set, "CC=${CC} CCFLAGS=${CFLAGS}
826 # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
827 # INSTALLARCHLIB=${PREFIX}/lib" if PERL_CONFIGURE is set,
828 # empty otherwise.
829 # CONFIGURE_ENV - Pass these env (shell-like) to configure if
830 # ${HAS_CONFIGURE} is set.
831 # CONFIGURE_LOG - The name of configure log file. It will be printed to
832 # the screen if configure fails.
833 # Default: config.log
834 # CONFIGURE_FAIL_MESSAGE
835 # - A message displayed to users when configure
836 # fails (note: this assumes the do-configure
837 # target has not been overwritten). This message
838 # will be passed through /usr/bin/fmt before
839 # being shown to the user.
840 #
841 # For build and install:
842 #
843 # MAKEFILE - Name of the makefile.
844 # Default: Makefile
845 # ALL_TARGET - Default target for sub-make in build stage.
846 # Default: all
847 # BUILD_WRKSRC - Directory to do build in (default: ${WRKSRC}).
848 # MAKE_ENV - Additional environment vars passed to sub-make in build
849 # and install stages.
850 # Default: see below
851 # MAKE_ARGS - Any extra arguments to sub-make in build and install stages.
852 # Default: none
853 #
854 # NO_STACK_PROTECTOR - If set, Propolice stack protection will be disabled. Only set
855 # this if there is no way for the port to work with propolice.
856 #
857 #
858 # For install:
859 #
860 # INSTALL_TARGET
861 # - Default target for sub-make in install stage.
862 # Default: install
863 # INSTALL_WRKSRC
864 # - Directory to install from
865 # Default: ${WRKSRC}
866 # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
867 # the "install" target.
868 # MTREE_FILE - The name of the mtree file.
869 # Default: /etc/mtree/BSD.x11.dist if USE_X_PREFIX is set,
870 # /etc/mtree/BSD.local.dist otherwise.
871 # PLIST_DIRS - Directories to be added to packing list
872 # PLIST_FILES - Files and symbolic links to be added to packing list
873 #
874 # PLIST - Name of the `packing list' file.
875 # Change this to ${WRKDIR}/PLIST or something if you
876 # need to write to it. (It is not a good idea for a port
877 # to write to any file outside ${WRKDIR} during a normal
878 # build.)
879 # Default: ${PKGDIR}/pkg-plist
880 # TMPPLIST - Name of the `packing list' file after processing
881 # Default: ${WRKDIR}/.PLIST.mktmp
882 # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST}
883 # Default: see below
884 #
885 # SUB_FILES - Files that should be passed through sed and redirected to
886 # ${WRKDIR}.
887 # - For each file specified in SUB_FILES, there must be a
888 # corresponding file in ${FILESDIR} whose suffix is ".in". For
889 # instance, if the Makefile specifies "SUB_FILES= pkg-message"
890 # then there must be a file called pkg-message.in in
891 # ${FILESDIR}.
892 # - The substitution process is the same as PLIST_FILES, as
893 # described below except that any line beginning with @comment
894 # is deleted.
895 # SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES}
896 # Some pairs are added by default: eg. PREFIX=${PREFIX}
897 #
898 # INSTALLS_SHLIB
899 # - If set, bsd.port.mk will automatically run ldconfig commands
900 # from post-install and also add appropriate @exec/@unexec
901 # directives to directories listed in LDCONFIG_DIRS. (deprecated)
902 # If USE_LINUX_PREFIX is defined, the Linux version of ldconfig
903 # will be used instead of the native FreeBSD version (in such
904 # case, LDCONFIG_DIRS is ignored).
905 # LDCONFIG_DIRS - List of directories to run ldconfig if INSTALLS_SHLIB is set.
906 # Note that this is passed through sed just like the
907 # rest of PLIST, so ${PLIST_SUB} substitutions also
908 # apply here. It is recommended that you use
909 # %%PREFIX%% for ${PREFIX}, %%LOCALBASE%% for
910 # ${LOCALBASE_REL} and %%X11BASE%% for ${X11BASE_REL}.
911 # Default: %%PREFIX%%/lib
912 # USE_LDCONFIG - If set to "yes", it replaces the old variable INSTALLS_SHLIB.
913 # Otherwise, it can be set to a list of directories to be added to
914 # ${PREFIX}/libdata/ldconfig/${UNIQUENAME}. Note that this
915 # directory is used by ldconfig startup script, it is meant to
916 # replace ldconfig scripts installed by some ports as (sometimes)
917 # 000.${UNQUENAME}.sh.
918 # USE_LDCONFIG32
919 # - Same as USE_LDCONFIG but the target file is
920 # ${PREFIX}/libdata/ldconfig32/${UNIQUENAME} instead.
921 # Note: that should only be used on 64-bit architectures.
922 #
923 # DOCSDIR - Name of the directory to install the packages docs in.
924 # Default: ${TARGETDIR}/share/doc/${PORTNAME}
925 # EXAMPLESDIR - Name of the directory to install the packages examples in.
926 # Default: ${TARGETDIR}/share/examples/${PORTNAME}
927 # DATADIR - Name of the directory to install the packages shared data in.
928 # Default: ${TARGETDIR}/share/${PORTNAME}
929 #
930 # DESKTOPDIR - Name of the directory to install ${DESKTOP_ENTRIES} in.
931 # Default: ${TARGETDIR}/share/applications
932 # DESKTOP_ENTRIES
933 # - List of desktop entry files to generate and install in
934 # ${DESKTOPDIR}. The format is
935 # "Name" "Comment" "Icon" "Exec" "Categories" StartupNotify
936 # Rules:
937 # * Only add desktop entries for applications which do not
938 # require a terminal (ie. X applications).
939 # * If the upstream distribution already installs .desktop
940 # files, you do not need to use this.
941 # * If you require a more elaborate .desktop file than this
942 # variable permits, write it yourself and install it
943 # in ${DESKTOPDIR}.
944 # Notes:
945 # * Comment and Icon may be empty strings (""). Categories
946 # may be an empty string in some cases (see below). The
947 # other fields are mandatory.
948 # * If Categories is an empty string, bsd.port.mk will try
949 # to deduce a default value using the CATEGORIES variable.
950 # If the deduction fails, you will have to set Categories
951 # manually. You should check the generated value using
952 # "make desktop-categories", and override it if necessary.
953 # * Exec will also be used to name the .desktop file.
954 # * The files will be automatically added to ${PLIST}.
955 # Example:
956 # "X Window Information" \
957 # "Get information about X windows" \
958 # "wininfo.png" \
959 # "wininfo" \
960 # "Application;System;" \
961 # true
962 # See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
963 # for an explanation of the fields. If you need to create more
964 # than one file, just chain them into a single variable.
965 #
966 # Note that the install target will automatically add manpages (see
967 # above) and also substitute special sequences of characters (delimited
968 # by "%%") as defined in PLIST_SUB to generate ${TMPPLIST}. For
969 # instance, "OSREL=${OSREL}" in PLIST_SUB causes all occurrences of
970 # "%%OSREL%%" in ${PLIST} to be substituted by the value of OSREL.
971 # ${TMPPLIST} is generated before the do-install stage. If you are
972 # generating the packing list on-the-fly, make sure it's generated before
973 # do-install is called!
974 #
975 # For package:
976 #
977 # NO_LATEST_LINK
978 # - Do not install the "Latest" link for package. Define this
979 # if this port is a beta version of another stable port
980 # which is also in the tree.
981 # LATEST_LINK - Install the "Latest" link for the package as ___. Define
982 # this if the "Latest" link name will be incorrectly determined.
983 #
984 # This is used in all stages:
985 #
986 # SCRIPTS_ENV - Additional environment vars passed to scripts in
987 # ${SCRIPTDIR} executed by bsd.port.mk.
988 # Default: see below
989 #
990 # Finally, variables to change if you want a special behavior. These
991 # are for debugging purposes. Don't set them in your Makefile.
992 #
993 # ECHO_MSG - Used to print all the '===>' style prompts - override this
994 # to turn them off.
995 # Default: ${ECHO_CMD}
996 # PATCH_DEBUG - If set, print out more information about the patches as
997 # it attempts to apply them.
998 # PKG_DBDIR - Where package installation is recorded; this directory
999 # must not contain anything else.
1000 # Default: ${DESTDIR}/var/db/pkg
1001 # PORT_DBDIR - Where port configuration options are recorded.
1002 # Default: ${DESTDIR}/var/db/ports
1003 # NO_PKG_REGISTER
1004 # - Don't register a port installation as a package.
1005 # FORCE_PKG_REGISTER
1006 # - If set, it will overwrite any existing package
1007 # registration information in ${PKG_DBDIR}/${PKGNAME}.
1008 # NO_DEPENDS - Don't verify build of dependencies.
1009 # CHECKSUM_ALGORITHMS
1010 # - Different checksum algorithms to check for verifying the
1011 # integrity of the distfiles. The absence of the algorithm
1012 # in distinfo doesn't make it fail.
1013 # Default: md5 sha256
1014 # NO_CHECKSUM - Don't verify the checksum. Typically used when
1015 # when you noticed the distfile you just fetched has
1016 # a different checksum and you intend to verify if
1017 # the port still works with it.
1018 # USE_PACKAGE_DEPENDS
1019 # - Install dependencies from existing packages instead
1020 # of building the port from scratch.
1021 # INSTALL_AS_USER
1022 # - Define this to install as the current user, intended
1023 # for systems where you have no root access.
1024 # DISABLE_SIZE - Do not check the size of a distfile even if the SIZE field
1025 # has been specified in distinfo. This is useful
1026 # when using an alternate FETCH_CMD.
1027 #
1028 # End of the list of all variables that need to be defined in a port.
1029 # Most port authors should not need to understand anything after this point.
1030 #
1031
1032 # Look for ${WRKSRC}/.../*.orig files, and (re-)create
1033 # ${FILEDIR}/patch-* files from them.
1034
1035 .if !target(makepatch)
1036 makepatch:
1037 @cd ${.CURDIR} && ${MKDIR} ${FILESDIR}
1038 @(cd ${WRKSRC}; \
1039 for i in `find . -type f -name '*.orig'`; do \
1040 ORG=$$i; \
1041 NEW=$${i%.orig}; \
1042 OUT=${FILESDIR}`${ECHO} $${NEW} | \
1043 ${SED} -e 's|/|__|g' \
1044 -e 's|^\.__|/patch-|'`; \
1045 ${ECHO} ${DIFF} -ud $${ORG} $${NEW} '>' $${OUT}; \
1046 ${DIFF} -ud $${ORG} $${NEW} > $${OUT} || ${TRUE}; \
1047 done \
1048 )
1049 .endif
1050
1051
1052 # Start of pre-makefile section.
1053 .if !defined(AFTERPORTMK)
1054
1055 .if defined(_PREMKINCLUDED)
1056 check-makefile::
1057 @${ECHO_MSG} "${PKGNAME}: Makefile error: you cannot include bsd.port[.pre].mk twice"
1058 @${FALSE}
1059 .endif
1060
1061 _PREMKINCLUDED= yes
1062
1063 .if defined(MAKE_VERSION)
1064 .if ${MAKE_VERSION} >= 5200408030 || ${MAKE_VERSION} >= 4200408030 && ${MAKE_VERSION} < 5000000000
1065 NOPRECIOUSSOFTMAKEVARS= yes
1066 .endif
1067 .endif
1068
1069 _MAKE_CMD= /usr/bin/make
1070
1071 AWK?= /usr/bin/awk
1072 BASENAME?= /usr/bin/basename
1073 BRANDELF?= /usr/bin/brandelf
1074 BZCAT?= /usr/bin/bzcat
1075 BZIP2_CMD?= /usr/bin/bzip2
1076 CAT?= /bin/cat
1077 CHGRP?= /usr/bin/chgrp
1078 CHMOD?= /bin/chmod
1079 CHOWN?= /usr/sbin/chown
1080 CHROOT?= /usr/sbin/chroot
1081 COMM?= /usr/bin/comm
1082 CP?= /bin/cp
1083 CPIO?= /usr/bin/cpio
1084 CUT?= /usr/bin/cut
1085 DC?= /usr/bin/dc
1086 DIALOG?= /usr/bin/dialog
1087 DIFF?= /usr/bin/diff
1088 DIRNAME?= /usr/bin/dirname
1089 EGREP?= /usr/bin/egrep
1090 EXPR?= /bin/expr
1091 FALSE?= false # Shell builtin
1092 FILE?= /usr/bin/file
1093 FIND?= /usr/bin/find
1094 FMT?= /usr/bin/fmt
1095 GREP?= /usr/bin/grep
1096 GUNZIP_CMD?= /usr/bin/gunzip -f
1097 GZCAT?= /usr/bin/gzcat
1098 GZIP?= -9
1099 GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
1100 HEAD?= /usr/bin/head
1101 ID?= /usr/bin/id
1102 IDENT?= /usr/bin/ident
1103 LDCONFIG?= /sbin/ldconfig
1104 LN?= /bin/ln
1105 LS?= /bin/ls
1106 MKDIR?= /bin/mkdir -p
1107 MKTEMP?= /usr/bin/mktemp
1108 MV?= /bin/mv
1109 OBJCOPY?= /usr/bin/objcopy
1110 OBJDUMP?= /usr/bin/objdump
1111 PASTE?= /usr/bin/paste
1112 PAX?= /bin/pax
1113 PRINTF?= /usr/bin/printf
1114 REALPATH?= /bin/realpath
1115 RM?= /bin/rm
1116 RMDIR?= /bin/rmdir
1117 SED?= /usr/bin/sed
1118 SETENV?= /usr/bin/env
1119 SH?= /bin/sh
1120 SORT?= /usr/bin/sort
1121 STRIP_CMD?= /usr/bin/strip
1122 SU_CMD?= /usr/bin/su root -c
1123 SYSCTL?= /sbin/sysctl
1124 TAIL?= /usr/bin/tail
1125 TEST?= test # Shell builtin
1126 TR?= LANG=C /usr/bin/tr
1127 TRUE?= true # Shell builtin
1128 UNAME?= /usr/bin/uname
1129 UNZIP_CMD?= ${LOCALBASE}/bin/unzip
1130 WHICH?= /usr/bin/which
1131 XARGS?= /usr/bin/xargs
1132 YACC?= /usr/bin/yacc
1133
1134 # ECHO is defined in /usr/share/mk/sys.mk, which can either be "echo",
1135 # or "true" if the make flag -s is given. Use ECHO_CMD where you mean
1136 # the echo command.
1137 ECHO_CMD?= echo # Shell builtin
1138
1139 # Used to print all the '===>' style prompts - override this to turn them off.
1140 ECHO_MSG?= ${ECHO_CMD}
1141
1142 # Get the default maintainer
1143 MAINTAINER?= ports@MidnightBSD.org
1144
1145 # Get the architecture
1146 .if !defined(ARCH)
1147 ARCH!= ${UNAME} -p
1148 .endif
1149
1150 # Kludge for pre-3.0 systems
1151 MACHINE_ARCH?= i386
1152
1153 # Get the operating system type
1154 .if !defined(OPSYS)
1155 OPSYS!= ${UNAME} -s
1156 .endif
1157
1158 # Get the operating system revision
1159 .if !defined(OSREL)
1160 OSREL!= ${UNAME} -r | ${SED} -e 's/[-(].*//'
1161 .endif
1162
1163 # Get __FreeBSD_version
1164 .if !defined(OSVERSION)
1165 .if exists(${DESTDIR}/usr/include/sys/param.h)
1166 OSVERSION!= ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < ${DESTDIR}/usr/include/sys/param.h
1167 .elif exists(${DESTDIR}/usr/src/sys/sys/param.h)
1168 OSVERSION!= ${AWK} '/^\#define __FreeBSD_version/ {print $$3}' < ${DESTDIR}/usr/src/sys/sys/param.h
1169 .else
1170 OSVERSION!= ${SYSCTL} -n kern.osreldate
1171 .endif
1172 .endif
1173
1174 # Get the object format.
1175 .if !defined(PORTOBJFORMAT)
1176 PORTOBJFORMAT!= ${TEST} -x /usr/bin/objformat && /usr/bin/objformat || ${ECHO_CMD} aout
1177 .endif
1178
1179 MASTERDIR?= ${.CURDIR}
1180
1181 .if ${MASTERDIR} != ${.CURDIR}
1182 SLAVE_PORT?= yes
1183 MASTER_PORT?=${MASTERDIR:C/[^\/]+\/\.\.\///:C/[^\/]+\/\.\.\///:C/^.*\/([^\/]+\/[^\/]+)$/\\1/}
1184 .else
1185 SLAVE_PORT?= no
1186 MASTER_PORT?=
1187 .endif
1188
1189 # Check the compatibility layer for amd64/ia64
1190
1191 .if ${ARCH} == "amd64" || ${ARCH} =="ia64"
1192 .if exists(/usr/lib32)
1193 HAVE_COMPAT_IA32_LIBS?= YES
1194 .endif
1195 .if !defined(HAVE_COMPAT_IA32_KERN)
1196 HAVE_COMPAT_IA32_KERN!= if ${SYSCTL} -a compat.ia32.maxvmem >/dev/null 2>&1; then echo YES; fi
1197 .endif
1198 .endif
1199
1200 .if defined(IA32_BINARY_PORT) && ${ARCH} != "i386"
1201 .if ${ARCH} == "amd64" || ${ARCH} == "ia64"
1202 .if !defined(HAVE_COMPAT_IA32_KERN)
1203 IGNORE= you need a kernel with compiled-in IA32 compatibility to use this port.
1204 .elif !defined(HAVE_COMPAT_IA32_LIBS)
1205 IGNORE= you need the 32-bit libraries installed under /usr/lib32 to use this port.
1206 .endif
1207 .else
1208 IGNORE= you have to use i386 (or compatible) platform to use this port.
1209 .endif
1210 .endif
1211
1212 # If they exist, include Makefile.inc, then architecture/operating
1213 # system specific Makefiles, then local Makefile.local.
1214
1215 .if ${MASTERDIR} != ${.CURDIR} && exists(${.CURDIR}/../Makefile.inc)
1216 .include "${.CURDIR}/../Makefile.inc"
1217 USE_SUBMAKE= yes
1218 .endif
1219
1220 .if exists(${MASTERDIR}/../Makefile.inc)
1221 .include "${MASTERDIR}/../Makefile.inc"
1222 USE_SUBMAKE= yes
1223 .endif
1224
1225 .if exists(${MASTERDIR}/Makefile.${ARCH}-${OPSYS})
1226 .include "${MASTERDIR}/Makefile.${ARCH}-${OPSYS}"
1227 USE_SUBMAKE= yes
1228 .elif exists(${MASTERDIR}/Makefile.${OPSYS})
1229 .include "${MASTERDIR}/Makefile.${OPSYS}"
1230 USE_SUBMAKE= yes
1231 .elif exists(${MASTERDIR}/Makefile.${ARCH})
1232 .include "${MASTERDIR}/Makefile.${ARCH}"
1233 USE_SUBMAKE= yes
1234 .endif
1235
1236 .if exists(${MASTERDIR}/Makefile.local)
1237 .include "${MASTERDIR}/Makefile.local"
1238 USE_SUBMAKE= yes
1239 .endif
1240
1241 # where 'make config' records user configuration options
1242 PORT_DBDIR?= ${DESTDIR}/var/db/ports
1243
1244 LDCONFIG_DIR= libdata/ldconfig
1245 LDCONFIG32_DIR= libdata/ldconfig32
1246
1247 .if defined(LATEST_LINK)
1248 UNIQUENAME?= ${LATEST_LINK}
1249 .else
1250 UNIQUENAME?= ${PKGNAMEPREFIX}${PORTNAME}
1251 .endif
1252 OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options
1253 _OPTIONSFILE!= ${ECHO_CMD} "${OPTIONSFILE}"
1254 .if defined(OPTIONS)
1255 . if defined(PACKAGE_BUILDING) || (defined(BATCH) && !exists(${_OPTIONSFILE}))
1256 WITHOUT:=
1257 WITH:=
1258 . if defined(OPTIONS)
1259 REALOPTIONS=${OPTIONS:C/".*"//g}
1260 . for O in ${REALOPTIONS}
1261 RO:=${O}
1262 . if ${RO:L} == off
1263 WITHOUT:= ${WITHOUT} ${OPT}
1264 . endif
1265 . if ${RO:L} == on
1266 WITH:= ${WITH} ${OPT}
1267 . endif
1268 OPT:=${RO}
1269 . endfor
1270 . endif
1271 . for W in ${WITH}
1272 WITH_${W}:= true
1273 . endfor
1274 . for W in ${WITHOUT}
1275 WITHOUT_${W}:= true
1276 . endfor
1277 . undef WITH
1278 . undef WITHOUT
1279 . undef RO
1280 . undef REALOPTIONS
1281 . endif
1282 . if exists(${_OPTIONSFILE}) && !make(rmconfig)
1283 . include "${_OPTIONSFILE}"
1284 . endif
1285 . if exists(${_OPTIONSFILE}.local)
1286 . include "${_OPTIONSFILE}.local"
1287 . endif
1288 .endif
1289
1290 # check for old, crufty, makefile types, part 1:
1291 .if !defined(PORTNAME) || !( defined(PORTVERSION) || defined (DISTVERSION) ) || defined(PKGNAME)
1292 check-makefile::
1293 @${ECHO_MSG} "Makefile error: you need to define PORTNAME and PORTVERSION instead of PKGNAME."
1294 @${ECHO_MSG} "(This port is too old for your bsd.port.mk, please update it to match"
1295 @${ECHO_MSG} " your bsd.port.mk.)"
1296 @${FALSE}
1297 .endif
1298
1299 .if defined(PORTVERSION)
1300 .if ${PORTVERSION:M*[-_,]*}x != x
1301 IGNORE= PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','
1302 .endif
1303 DISTVERSION?= ${PORTVERSION:S/:/::/g}
1304 .elif defined(DISTVERSION)
1305 PORTVERSION= ${DISTVERSION:L:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
1306 .endif
1307
1308 PORTREVISION?= 0
1309 .if ${PORTREVISION} != 0
1310 _SUF1= _${PORTREVISION}
1311 .endif
1312
1313 PORTEPOCH?= 0
1314 .if ${PORTEPOCH} != 0
1315 _SUF2= ,${PORTEPOCH}
1316 .endif
1317
1318 # check for old, crufty, makefile types, part 2. The "else" case
1319 # should have been handled in part 1, above.
1320 .if !defined(PKGVERSION)
1321 PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
1322 .endif
1323 .if !defined(PKGNAME)
1324 PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
1325 .endif
1326 DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
1327
1328 # These need to be absolute since we don't know how deep in the ports
1329 # tree we are and thus can't go relative. They can, of course, be overridden
1330 # by individual Makefiles or local system make configuration.
1331 PORTSDIR?= /usr/mports
1332 LOCALBASE?= /usr/local
1333 X11BASE?= /usr/X11R6
1334 LINUXBASE?= /compat/linux
1335 LOCALBASE_REL:= ${LOCALBASE}
1336 X11BASE_REL:= ${X11BASE}
1337 LINUXBASE_REL:= ${LINUXBASE}
1338 LOCALBASE:= ${DESTDIR}${LOCALBASE_REL}
1339 X11BASE:= ${DESTDIR}${X11BASE_REL}
1340 LINUXBASE:= ${DESTDIR}${LINUXBASE_REL}
1341 DISTDIR?= ${PORTSDIR}/distfiles
1342 _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1343 INDEXDIR?= ${PORTSDIR}
1344 .if ${OSVERSION} >= 500036
1345 INDEXFILE?= INDEX-${OSVERSION:C/([0-9]).*/\1/}
1346 .else
1347 INDEXFILE?= INDEX
1348 .endif
1349
1350 TARGETDIR:= ${DESTDIR}${PREFIX}
1351
1352 .if defined(USE_LINUX_RPM)
1353 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1354 .endif
1355
1356 .if defined(USE_BZIP2)
1357 EXTRACT_SUFX?= .tar.bz2
1358 .elif defined(USE_ZIP)
1359 EXTRACT_SUFX?= .zip
1360 .else
1361 EXTRACT_SUFX?= .tar.gz
1362 .endif
1363 PACKAGES?= ${PORTSDIR}/Packages
1364 TEMPLATES?= ${PORTSDIR}/Templates
1365
1366 .if (!defined(PKGDIR) && exists(${MASTERDIR}/pkg/DESCR)) || \
1367 (!defined(MD5_FILE) && exists(${MASTERDIR}/files/md5))
1368 check-makefile::
1369 @${ECHO_MSG} "Makefile error: your port uses an old layout. Please update it to match this bsd.port.mk. If you have updated your ports collection via cvsup and are still getting this error, see Q12 and Q13 in the cvsup FAQ on http://www.polstra.com for further information."
1370 @${FALSE}
1371 .endif
1372 PATCHDIR?= ${MASTERDIR}/files
1373 FILESDIR?= ${MASTERDIR}/files
1374 SCRIPTDIR?= ${MASTERDIR}/scripts
1375 PKGDIR?= ${MASTERDIR}
1376
1377 # Set up PREFIX.
1378 .if defined(USE_X_PREFIX) && ${USE_X_PREFIX} == "no"
1379 .undef USE_X_PREFIX
1380 .endif
1381
1382 .if defined(USE_X_PREFIX)
1383 TRUE_PREFIX?= ${X11BASE_REL}
1384 .elif defined(USE_LINUX_PREFIX)
1385 TRUE_PREFIX?= ${LINUXBASE_REL}
1386 NO_MTREE= yes
1387 .else
1388 TRUE_PREFIX?= ${LOCALBASE_REL}
1389 .endif
1390
1391 PREFIX?= ${TRUE_PREFIX}
1392
1393
1394 .if defined(USE_LINUX_PREFIX)
1395 .if !defined(DESTDIR)
1396 LDCONFIG_CMD?= ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL}
1397 LDCONFIG_PLIST_EXEC_CMD?= ${LDCONFIG_CMD}
1398 LDCONFIG_PLIST_UNEXEC_CMD?= ${LDCONFIG_CMD}
1399 .else
1400 LDCONFIG_CMD?= ${CHROOT} ${DESTDIR} ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL}
1401 LDCONFIG_PLIST_EXEC_CMD?= ${LDCONFIG_CMD}
1402 LDCONFIG_PLIST_UNEXEC_CMD?= ${LINUXBASE_REL}/sbin/ldconfig -r ${LINUXBASE_REL}
1403 .endif
1404 .else
1405 .if !defined(DESTDIR)
1406 LDCONFIG_CMD?= ${LDCONFIG} -m ${LDCONFIG_RUNLIST}
1407 LDCONFIG_PLIST_EXEC_CMD?= ${LDCONFIG} -m ${LDCONFIG_PLIST}
1408 .else
1409 LDCONFIG_CMD?= ${CHROOT} ${DESTDIR} ${LDCONFIG} -m ${LDCONFIG_RUNLIST}
1410 LDCONFIG_PLIST_EXEC_CMD?= ${CHROOT} ${DESTDIR} ${LDCONFIG} -m ${LDCONFIG_PLIST}
1411 .endif
1412 LDCONFIG_PLIST_UNEXEC_CMD?= ${LDCONFIG} -R
1413 .endif
1414
1415 PKGCOMPATDIR?= ${LOCALBASE}/lib/compat/pkg
1416
1417 .if ${OSVERSION} >= 500036
1418 PERL_VERSION?= 5.8.8
1419 PERL_VER?= 5.8.8
1420 .else
1421 .if ${OSVERSION} >= 500032
1422 PERL_VERSION?= 5.6.1
1423 PERL_VER?= 5.6.1
1424 .else
1425 .if ${OSVERSION} >= 500007
1426 PERL_VERSION?= 5.6.0
1427 PERL_VER?= 5.6.0
1428 .else
1429 PERL_VERSION?= 5.00503
1430 PERL_VER?= 5.005
1431 .endif
1432 .endif
1433 .endif
1434
1435 .if !defined(PERL_LEVEL) && defined(PERL_VERSION)
1436 perl_major= ${PERL_VERSION:C|^([1-9]+).*|\1|}
1437 _perl_minor= 00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
1438 perl_minor= ${_perl_minor:C|^.*(...)|\1|}
1439 .if ${perl_minor} >= 100
1440 perl_minor= ${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|}
1441 perl_patch= ${PERL_VERSION:C|^.*(..)|\1|}
1442 .else # ${perl_minor} < 100
1443 _perl_patch= 0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|}
1444 perl_patch= ${_perl_patch:C|^.*(..)|\1|}
1445 .endif # ${perl_minor} < 100
1446 PERL_LEVEL= ${perl_major}${perl_minor}${perl_patch}
1447 .else
1448 PERL_LEVEL=0
1449 .endif # !defined(PERL_LEVEL) && defined(PERL_VERSION)
1450
1451 .if ${PERL_LEVEL} >= 500600
1452 PERL_ARCH?= mach
1453 .else
1454 PERL_ARCH?= ${ARCH}-freebsd
1455 .endif
1456
1457 .if ${PERL_LEVEL} >= 500800
1458 PERL_PORT?= perl5.8
1459 .else
1460 PERL_PORT?= perl5
1461 .endif
1462
1463 SITE_PERL_REL?= lib/perl5/site_perl/${PERL_VER}
1464 SITE_PERL?= ${LOCALBASE}/${SITE_PERL_REL}
1465
1466 .if ${PERL_LEVEL} < 500600
1467 PERL5= ${DESTDIR}/usr/bin/perl${PERL_VERSION}
1468 PERL= ${DESTDIR}/usr/bin/perl
1469 .else
1470 PERL5= ${LOCALBASE}/bin/perl${PERL_VERSION}
1471 PERL= ${LOCALBASE}/bin/perl
1472 .endif
1473
1474 .if defined(USE_LOCAL_MK)
1475 .include "${PORTSDIR}/Mk/bsd.local.mk"
1476 .endif
1477
1478 .if defined(USE_OPENSSL)
1479 .include "${PORTSDIR}/Mk/bsd.openssl.mk"
1480 .endif
1481
1482 .if defined(USE_EMACS)
1483 .include "${PORTSDIR}/Mk/bsd.emacs.mk"
1484 .endif
1485
1486 .if defined(USE_GNUSTEP)
1487 .include "${PORTSDIR}/Mk/bsd.gnustep.mk"
1488 .endif
1489
1490 .if defined(USE_PHP)
1491 .include "${PORTSDIR}/Mk/bsd.php.mk"
1492 .endif
1493
1494 .if defined(USE_PYTHON) || defined(USE_PYTHON_BUILD) || defined(USE_PYTHON_RUN)
1495 .include "${PORTSDIR}/Mk/bsd.python.mk"
1496 .endif
1497
1498 .if defined(USE_JAVA)
1499 .include "${PORTSDIR}/Mk/bsd.java.mk"
1500 .endif
1501
1502 .if defined(USE_RUBY) || defined(USE_LIBRUBY)
1503 .include "${PORTSDIR}/Mk/bsd.ruby.mk"
1504 .endif
1505
1506 .if defined(USE_TCL) || defined(USE_TCL_BUILD) || defined(USE_TK)
1507 .include "${PORTSDIR}/Mk/bsd.tcl.mk"
1508 .endif
1509
1510 .if defined(USE_APACHE) || defined(APACHE_COMPAT)
1511 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1512 .endif
1513
1514 .if defined(USE_QT_VER) || defined(USE_KDELIBS_VER) || defined(USE_KDEBASE_VER)
1515 .include "${PORTSDIR}/Mk/bsd.kde.mk"
1516 .endif
1517
1518 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(USE_GTK)
1519 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
1520 .endif
1521
1522 .if defined(WANT_WX) || defined(USE_WX) || defined(USE_WX_NOT)
1523 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1524 .endif
1525
1526 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER80)
1527 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1528 .endif
1529
1530 .if defined(USE_QMAIL) || defined(USE_QMAIL_RUN) || defined(USE_QMAIL_BUILD) || defined(WANT_QMAIL)
1531 .include "${PORTSDIR}/Mk/bsd.mail.mk"
1532 .endif
1533
1534 .if defined(USE_SDL) || defined(WANT_SDL)
1535 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1536 .endif
1537
1538 # These do some path checks if DESTDIR is set correctly.
1539 # You can force skipping these test by defining IGNORE_PATH_CHECKS
1540 .if !defined(IGNORE_PATH_CHECKS)
1541 .if (${PREFIX:C,(^.).*,\1,} != "/")
1542 .BEGIN:
1543 @${ECHO_MSG} "PREFIX must be defined as an absolute path so that when 'make'"
1544 @${ECHO_MSG} "is invoked in the work area PREFIX points to the right place."
1545 @${FALSE}
1546 .endif
1547 .if defined(DESTDIR)
1548 .if (${DESTDIR:C,(^.).*,\1,} != "/")
1549 .if ${DESTDIR} == "/"
1550 .BEGIN:
1551 @${ECHO_MSG} "You can't set DESTDIR to /. Please re-run make with"
1552 @${ECHO_MSG} "DESTDIR unset."
1553 @${FALSE}
1554 .else
1555 .BEGIN:
1556 @${ECHO_MSG} "DESTDIR must be defined as an absolute path so that when 'make'"
1557 @${ECHO_MSG} "is invoked in the work area DESTDIR points to the right place."
1558 @${FALSE}
1559 .endif
1560 .endif
1561 .if (${DESTDIR:C,^.*(/)$$,\1,} == "/")
1562 .BEGIN:
1563 @${ECHO_MSG} "DESTDIR can't have a trailing slash. Please remove the trailing"
1564 @${ECHO_MSG} "slash and re-run 'make'"
1565 @${FALSE}
1566 .endif
1567 .endif
1568 .endif
1569
1570 # We only support xorg.
1571 X_WINDOW_SYSTEM ?= xorg
1572
1573 ################
1574 #
1575 # Fake Setup
1576 #
1577 # Tmp dir used for building a package.
1578 FAKE_INSTALLDIR?= fake-inst
1579 FAKE_TARGET?= install
1580 DESTDIRNAME?= DESTDIR
1581
1582 _ABS_FAKE_INSTALLDIR= ${WRKDIR}/${FAKE_INSTALLDIR}
1583 _FAKE_SETUP= TRUE_PREFIX=${PREFIX} PREFIX=${_ABS_FAKE_INSTALLDIR}${PREFIX} LINUXBASE=${_ABS_FAKE_INSTALLDIR}${LINUXBASE}
1584 _FAKE_MAKEARGS= ${DESTDIRNAME}=${_ABS_FAKE_INSTALLDIR}
1585
1586
1587 # Location of mounted CDROM(s) to search for files
1588 CD_MOUNTPTS?= /cdrom ${CD_MOUNTPT}
1589
1590 WANT_OPENLDAP_VER?= 23
1591
1592 # Owner and group of the WWW user
1593 WWWOWN?= www
1594 WWWGRP?= www
1595
1596 .endif
1597 # End of pre-makefile section.
1598
1599 # Start of post-makefile section.
1600 .if !defined(BEFOREPORTMK)
1601
1602 .if defined(_POSTMKINCLUDED)
1603 check-makefile::
1604 @${ECHO_MSG} "${PKGNAME}: Makefile error: you cannot include bsd.port[.post].mk twice"
1605 @${FALSE}
1606 .endif
1607
1608 _POSTMKINCLUDED= yes
1609
1610 WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
1611 .if defined(NO_WRKSUBDIR)
1612 WRKSRC?= ${WRKDIR}
1613 .else
1614 WRKSRC?= ${WRKDIR}/${DISTNAME}
1615 .endif
1616
1617 PATCH_WRKSRC?= ${WRKSRC}
1618 CONFIGURE_WRKSRC?= ${WRKSRC}
1619 BUILD_WRKSRC?= ${WRKSRC}
1620 INSTALL_WRKSRC?=${WRKSRC}
1621
1622 PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE_REL} X11BASE=${X11BASE_REL} \
1623 DESTDIR=${DESTDIR} TARGETDIR=${TARGETDIR}
1624 SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE_REL} X11BASE=${X11BASE_REL} \
1625 DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
1626 DESTDIR=${DESTDIR} TARGETDIR=${TARGETDIR}
1627
1628 PLIST_REINPLACE+= dirrmtry
1629 PLIST_REINPLACE_DIRRMTRY=s!^@dirrmtry \(.*\)!@unexec rmdir %D/\1 2>/dev/null || true!
1630
1631 .if defined(WITHOUT_CPU_CFLAGS)
1632 .if defined(_CPUCFLAGS)
1633 .if !empty(_CPUCFLAGS)
1634 CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
1635 .endif
1636 .endif
1637 .endif
1638
1639 .if defined(NO_STACK_PROTECTOR)
1640 CFLAGS+= -fno-stack-protector
1641 .endif
1642
1643 .if defined(WITH_DEBUG) && ${WITH_DEBUG} != "no"
1644 .undef STRIP
1645 DEBUG_FLAGS?= -g
1646 CFLAGS+= ${DEBUG_FLAGS}
1647 .endif
1648 .if defined(NOPORTDOCS)
1649 PLIST_SUB+= PORTDOCS="@comment "
1650 .else
1651 PLIST_SUB+= PORTDOCS=""
1652 .endif
1653
1654 CONFIGURE_SHELL?= ${SH}
1655 MAKE_SHELL?= ${SH}
1656
1657 CONFIGURE_ENV+= SHELL=${SH} CONFIG_SHELL=${SH} PORTOBJFORMAT=${PORTOBJFORMAT}
1658 SCRIPTS_ENV+= PORTOBJFORMAT=${PORTOBJFORMAT}
1659 MAKE_ENV+= SHELL=${SH} PORTOBJFORMAT=${PORTOBJFORMAT} NO_LINT=YES
1660 PLIST_SUB+= PORTOBJFORMAT=${PORTOBJFORMAT}
1661
1662 .if defined(MANCOMPRESSED)
1663 .if ${MANCOMPRESSED} != yes && ${MANCOMPRESSED} != no && \
1664 ${MANCOMPRESSED} != maybe
1665 check-makevars::
1666 @${ECHO_MSG} "${PKGNAME}: Makefile error: value of MANCOMPRESSED (is \"${MANCOMPRESSED}\") can only be \"yes\", \"no\" or \"maybe\"".
1667 @${FALSE}
1668 .endif
1669 .endif
1670
1671 .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
1672 MANCOMPRESSED?= yes
1673 .else
1674 MANCOMPRESSED?= no
1675 .endif
1676
1677 .if defined(PATCHFILES)
1678 .if ${PATCHFILES:M*.zip}x != x
1679 PATCH_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
1680 .endif
1681 .endif
1682
1683 .if defined(USE_ZIP)
1684 EXTRACT_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
1685 .endif
1686 .if defined(USE_GMAKE)
1687 BUILD_DEPENDS+= gmake:${PORTSDIR}/devel/gmake
1688 CONFIGURE_ENV+= MAKE=${GMAKE}
1689 _MAKE_CMD= ${GMAKE}
1690 .endif
1691
1692 .if defined(USE_GCC)
1693 .include "${PORTSDIR}/Mk/bsd.gcc.mk"
1694 .endif
1695
1696 .if defined(USE_OPENLDAP_VER)
1697 USE_OPENLDAP?= yes
1698 WANT_OPENLDAP_VER= ${USE_OPENLDAP_VER}
1699 .endif
1700
1701 .if defined(USE_OPENLDAP)
1702 .if defined(WANT_OPENLDAP_SASL)
1703 _OPENLDAP_FLAVOUR= -sasl
1704 .else
1705 _OPENLDAP_FLAVOUR=
1706 .endif
1707 .if ${WANT_OPENLDAP_VER} == 22
1708 LIB_DEPENDS+= ldap-2.2.7:${PORTSDIR}/net/openldap22${_OPENLDAP_FLAVOUR}-client
1709 .elif ${WANT_OPENLDAP_VER} == 23
1710 LIB_DEPENDS+= ldap-2.3.2:${PORTSDIR}/net/openldap23${_OPENLDAP_FLAVOUR}-client
1711 .elif ${WANT_OPENLDAP_VER} == 24
1712 LIB_DEPENDS+= ldap-2.4.1:${PORTSDIR}/net/openldap24${_OPENLDAP_FLAVOUR}-client
1713 .else
1714 IGNORE= unknown OpenLDAP version: ${WANT_OPENLDAP_VER}
1715 .endif
1716 .endif
1717
1718 .if defined(USE_FAM)
1719 DEFAULT_FAM_SYSTEM= gamin
1720 # Currently supported FAM systems
1721 FAM_SYSTEM_FAM= fam.0:${PORTSDIR}/devel/fam
1722 FAM_SYSTEM_GAMIN= fam.0:${PORTSDIR}/devel/gamin
1723
1724 .if exists(${LOCALBASE}/libexec/gam_server)
1725 _HAVE_FAM_SYSTEM= gamin
1726 .elif exists(${LOCALBASE}/bin/fam)
1727 _HAVE_FAM_SYSTEM= fam
1728 .endif
1729
1730 .if defined(WANT_FAM_SYSTEM)
1731 .if defined(WITH_FAM_SYSTEM) && ${WITH_FAM_SYSTEM}!=${WANT_FAM_SYSTEM}
1732 IGNORE= The port wants to use ${WANT_FAM_SYSTEM} as its FAM system and you wish to use ${WITH_FAM_SYSTEM}
1733 .endif
1734 FAM_SYSTEM= ${WANT_FAM_SYSTEM}
1735 .elif defined(WITH_FAM_SYSTEM)
1736 FAM_SYSTEM= ${WITH_FAM_SYSTEM}
1737 .else
1738 .if defined(_HAVE_FAM_SYSTEM)
1739 FAM_SYSTEM= ${_HAVE_FAM_SYSTEM}
1740 .else
1741 FAM_SYSTEM= ${DEFAULT_FAM_SYSTEM}
1742 .endif
1743 .endif # WANT_FAM_SYSTEM
1744
1745 .if defined(_HAVE_FAM_SYSTEM)
1746 .if ${_HAVE_FAM_SYSTEM}!= ${FAM_SYSTEM}
1747 BROKEN= FAM system mismatch: ${_HAVE_FAM_SYSTEM} is installed and desired FAM system is ${FAM_SYSTEM}
1748 .endif
1749 .endif
1750
1751 .if defined(FAM_SYSTEM_${FAM_SYSTEM:U})
1752 LIB_DEPENDS+= ${FAM_SYSTEM_${FAM_SYSTEM:U}}
1753 .else
1754 IGNORE= unknown FAM system: ${FAM_SYSTEM}
1755 .endif
1756 .endif # USE_FAM
1757
1758 .if defined(USE_GETOPT_LONG)
1759 .if ${OSVERSION} < 500041
1760 LIB_DEPENDS+= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
1761 CPPFLAGS+= -I${LOCALBASE}/include
1762 LDFLAGS+= -L${LOCALBASE}/lib -lgnugetopt
1763 CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
1764 .endif
1765 .endif
1766
1767 .if defined(USE_RC_SUBR) || defined(USE_RCORDER)
1768 .if ${OSVERSION} < 500037
1769 RUN_DEPENDS+= ${LOCALBASE}/etc/rc.subr:${PORTSDIR}/sysutils/rc_subr
1770 RC_SUBR= ${LOCALBASE}/etc/rc.subr
1771 .else
1772 RC_SUBR= /etc/rc.subr
1773 .endif
1774 SUB_LIST+= RC_SUBR=${RC_SUBR}
1775 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
1776 SUB_FILES+= ${USE_RC_SUBR}
1777 .endif
1778 .if defined(USE_RCORDER)
1779 SUB_FILES+= ${USE_RCORDER}
1780 .endif
1781 .endif
1782
1783 .if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32)
1784 .if ( ${OSVERSION} < 504105 ) || \
1785 ( ${OSVERSION} >= 700000 && ${OSVERSION} < 700012 ) || \
1786 ( ${OSVERSION} >= 600000 && ${OSVERSION} < 600104 )
1787 RUN_DEPENDS+= ${LOCALBASE}/${LDCONFIG_DIR}:${PORTSDIR}/misc/ldconfig_compat
1788 NO_LDCONFIG_MTREE= yes
1789 .endif
1790 .if defined(USE_LDCONFIG) && ${USE_LDCONFIG:L} == "yes"
1791 USE_LDCONFIG= ${PREFIX}/lib
1792 .endif
1793 .if defined(USE_LDCONFIG32) && ${USE_LDCONFIG32:L} == "yes"
1794 IGNORE= has USE_LDCONFIG set to yes, which is not correct
1795 .endif
1796 .endif
1797
1798 .if defined(USE_ICONV)
1799 LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv
1800 .endif
1801
1802 .if defined(USE_GETTEXT)
1803 . if ${USE_GETTEXT:L} == "yes"
1804 LIB_DEPENDS+= intl:${PORTSDIR}/devel/gettext
1805 . else
1806 LIB_DEPENDS+= intl.${USE_GETTEXT}:${PORTSDIR}/devel/gettext
1807 . endif
1808 .endif
1809
1810 .if defined(USE_LINUX_PREFIX) && defined(INSTALLS_SHLIB)
1811 # we need ${LINUXBASE}/sbin/ldconfig
1812 USE_LINUX?= yes
1813 .endif
1814
1815 .if defined(USE_LINUX)
1816
1817 # install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
1818 STRIP=
1819 . if exists(${LINUXBASE}/usr/bin/strip)
1820 STRIP_CMD= ${LINUXBASE}/usr/bin/strip
1821 . else
1822 STRIP_CMD= ${TRUE}
1823 . endif
1824
1825 NO_FILTER_SHLIBS= yes
1826
1827 # Allow the user to specify another linux_base version.
1828 . if defined(OVERRIDE_LINUX_BASE_PORT)
1829 . if ${USE_LINUX:L} == yes
1830 USE_LINUX= ${OVERRIDE_LINUX_BASE_PORT}
1831 . endif
1832 . endif
1833
1834 # NOTE: when you update the default linux_base version (case "yes"),
1835 # don't forget to update the Handbook!
1836
1837 . if exists(${PORTSDIR}/emulators/linux_base-${USE_LINUX})
1838 LINUX_BASE_PORT= ${LINUXBASE}/bin/sh:${PORTSDIR}/emulators/linux_base-${USE_LINUX}
1839 . else
1840 . if ${USE_LINUX:L} == "yes"
1841 LINUX_BASE_PORT= ${LINUXBASE}/etc/fedora-release:${PORTSDIR}/emulators/linux_base-fc4
1842 . else
1843 IGNORE= There is no emulators/linux_base-${USE_LINUX}, perhaps wrong use of USE_LINUX or OVERRIDE_LINUX_BASE_PORT.
1844 . endif
1845 . endif
1846
1847 RUN_DEPENDS+= ${LINUX_BASE_PORT}
1848 .endif
1849
1850 .if defined(USE_MOTIF)
1851 USE_XPM= yes
1852 .if defined(WANT_LESSTIF)
1853 LIB_DEPENDS+= Xm:${PORTSDIR}/x11-toolkits/lesstif
1854 NO_OPENMOTIF= yes
1855 .endif
1856 .if !defined(NO_OPENMOTIF)
1857 LIB_DEPENDS+= Xm.3:${PORTSDIR}/x11-toolkits/open-motif
1858 .endif
1859 .endif
1860
1861 .if defined(USE_FREETYPE)
1862 LIB_DEPENDS+= ttf.4:${PORTSDIR}/print/freetype
1863 .endif
1864
1865 .if defined(X_WINDOW_SYSTEM) && ${X_WINDOW_SYSTEM:L} == xorg
1866 X_IMAKE_PORT= ${PORTSDIR}/devel/imake-6
1867 X_LIBRARIES_PORT= ${PORTSDIR}/x11/xorg-libraries
1868 X_CLIENTS_PORT= ${PORTSDIR}/x11/xorg-clients
1869 X_SERVER_PORT= ${PORTSDIR}/x11-servers/xorg-server
1870 X_FONTSERVER_PORT= ${PORTSDIR}/x11-servers/xorg-fontserver
1871 X_PRINTSERVER_PORT= ${PORTSDIR}/x11-servers/xorg-printserver
1872 X_VFBSERVER_PORT= ${PORTSDIR}/x11-servers/xorg-vfbserver
1873 X_NESTSERVER_PORT= ${PORTSDIR}/x11-servers/xorg-nestserver
1874 X_FONTS_ENCODINGS_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-encodings
1875 X_FONTS_MISC_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-miscbitmaps
1876 X_FONTS_100DPI_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-100dpi
1877 X_FONTS_75DPI_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-75dpi
1878 X_FONTS_CYRILLIC_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-cyrillic
1879 X_FONTS_TTF_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-truetype
1880 X_FONTS_TYPE1_PORT= ${PORTSDIR}/x11-fonts/xorg-fonts-type1
1881 X_MANUALS_PORT= ${PORTSDIR}/x11/xorg-manpages
1882 .else
1883 IGNORE= cannot install: bad X_WINDOW_SYSTEM setting; valid values are 'xorg'
1884 .endif
1885
1886 .if defined(USE_IMAKE)
1887 BUILD_DEPENDS+= imake:${X_IMAKE_PORT}
1888 .endif
1889
1890
1891 .if defined(USE_XPM) || defined(USE_GL)
1892 USE_XLIB= yes
1893 .endif
1894
1895 # This will always be xorg right now, but we might add xorg7 soon.
1896 .if ${X_WINDOW_SYSTEM:L} == xorg
1897 XAWVER= 8
1898 .endif
1899
1900
1901 PKG_IGNORE_DEPENDS?= 'this_port_does_not_exist'
1902
1903 PLIST_SUB+= XAWVER=${XAWVER}
1904
1905 .if defined(USE_BISON)
1906 BUILD_DEPENDS+= bison:${PORTSDIR}/devel/bison
1907 .endif
1908
1909 PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
1910 PERL_VER=${PERL_VER} \
1911 PERL_ARCH=${PERL_ARCH} \
1912 SITE_PERL=${SITE_PERL_REL}
1913
1914 .if defined(PERL_MODBUILD)
1915 PERL_CONFIGURE= yes
1916 CONFIGURE_SCRIPT?= Build.PL
1917 .if ${PORTNAME} != Module-Build
1918 BUILD_DEPENDS+= ${SITE_PERL}/Module/Build.pm:${PORTSDIR}/devel/p5-Module-Build
1919 .endif
1920 ALL_TARGET?=
1921 PL_BUILD?= Build
1922 CONFIGURE_ARGS+= \
1923 create_packlist=0 \
1924 install_path=lib="${TARGETDIR}/${SITE_PERL_REL}" \
1925 install_path=arch="${TARGETDIR}/${SITE_PERL_REL}/${PERL_ARCH}" \
1926 install_path=script="${TARGETDIR}/bin" \
1927 install_path=bin="${TARGETDIR}/bin" \
1928 install_path=libdoc="${MAN3PREFIX}/man/man3" \
1929 install_path=bindoc="${MAN1PREFIX}/man/man1"
1930 .elif defined(PERL_CONFIGURE)
1931 CONFIGURE_ARGS+= INSTALLDIRS="site"
1932 .endif
1933
1934 .if defined(PERL_CONFIGURE)
1935 USE_PERL5= yes
1936 .if (defined(BATCH) && !defined(IS_INTERACTIVE))
1937 CONFIGURE_ENV+= PERL_MM_USE_DEFAULT="YES"
1938 .endif
1939 .endif
1940
1941 .if ${PERL_LEVEL} >= 500600
1942 .if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
1943 EXTRACT_DEPENDS+=${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
1944 PATCH_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
1945 BUILD_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
1946 .endif
1947 .if defined(USE_PERL5) || defined(USE_PERL5_RUN)
1948 RUN_DEPENDS+= ${PERL5}:${PORTSDIR}/lang/${PERL_PORT}
1949 .endif
1950 .endif
1951
1952 .if defined(USE_LOCAL_MK)
1953 .include "${PORTSDIR}/Mk/bsd.local.mk"
1954 .endif
1955
1956 .if defined(USE_MYSQL) || defined(WANT_MYSQL_VER) || \
1957 defined(USE_PGSQL) || defined(WANT_PGSQL_VER) || \
1958 defined(USE_BDB) || defined(USE_SQLITE)
1959 .include "${PORTSDIR}/Mk/bsd.database.mk"
1960 .endif
1961
1962 .if defined(WANT_GSTREAMER) || defined(USE_GSTREAMER) || defined(USE_GSTREAMER80)
1963 .include "${PORTSDIR}/Mk/bsd.gstreamer.mk"
1964 .endif
1965
1966 .if defined(USE_JAVA)
1967 .include "${PORTSDIR}/Mk/bsd.java.mk"
1968 .endif
1969
1970 .if defined(USE_LINUX_RPM)
1971 .include "${PORTSDIR}/Mk/bsd.linux-rpm.mk"
1972 .endif
1973
1974 .if defined(USE_SCONS)
1975 .include "${PORTSDIR}/Mk/bsd.scons.mk"
1976 .endif
1977
1978 .if defined(USE_SDL) || defined(WANT_SDL)
1979 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
1980 .endif
1981
1982 .if defined(USE_PYTHON)
1983 .include "${PORTSDIR}/Mk/bsd.python.mk"
1984 .endif
1985
1986 .if defined(USE_TCL) || defined(USE_TCL_BUILD) || defined(USE_TK)
1987 .include "${PORTSDIR}/Mk/bsd.tcl.mk"
1988 .endif
1989
1990 .if defined(USE_WX) || defined(USE_WX_NOT)
1991 .include "${PORTSDIR}/Mk/bsd.wx.mk"
1992 .endif
1993
1994 .if defined(USE_APACHE) || defined(APACHE_COMPAT)
1995 .include "${PORTSDIR}/Mk/bsd.apache.mk"
1996 .endif
1997
1998 .if defined(USE_AUTOTOOLS)
1999 .include "${PORTSDIR}/Mk/bsd.autotools.mk"
2000 .endif
2001
2002 .if defined(WANT_GNOME) || defined(USE_GNOME) || defined(USE_GTK)
2003 .include "${PORTSDIR}/Mk/bsd.gnome.mk"
2004 .endif
2005
2006
2007 .if exists(${PORTSDIR}/../Makefile.inc)
2008 .include "${PORTSDIR}/../Makefile.inc"
2009 USE_SUBMAKE= yes
2010 .endif
2011
2012 .if defined(USE_XLIB)
2013 . if defined(USE_LINUX)
2014 RUN_DEPENDS+= ${LINUXBASE}/usr/X11R6/lib/libXrender.so.1:${PORTSDIR}/x11/linux-xorg-libs
2015 . else
2016 LIB_DEPENDS+= X11.6:${X_LIBRARIES_PORT}
2017 . endif
2018 # Add explicit X options to avoid problems with false positives in configure
2019 . if defined(GNU_CONFIGURE)
2020 CONFIGURE_ARGS+=--x-libraries=${X11BASE}/lib --x-includes=${X11BASE}/include
2021 . else
2022 CFLAGS+= -I${X11BASE}/include -L${X11BASE}/lib
2023 . endif
2024 .endif
2025
2026 # Set the default for the installation of Postscript(TM)-
2027 # compatible functionality.
2028 .if !defined(WITHOUT_X11)
2029 .if defined(WITH_GHOSTSCRIPT_AFPL)
2030 GHOSTSCRIPT_PORT?= print/ghostscript-afpl
2031 .else
2032 GHOSTSCRIPT_PORT?= print/ghostscript-gpl
2033 .endif
2034 .else
2035 .if defined(WITH_GHOSTSCRIPT_AFPL)
2036 GHOSTSCRIPT_PORT?= print/ghostscript-afpl-nox11
2037 .else
2038 GHOSTSCRIPT_PORT?= print/ghostscript-gpl-nox11
2039 .endif
2040 .endif
2041
2042 # Set up the ghostscript dependencies.
2043 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_BUILD)
2044 BUILD_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2045 .endif
2046 .if defined(USE_GHOSTSCRIPT) || defined(USE_GHOSTSCRIPT_RUN)
2047 RUN_DEPENDS+= gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
2048 .endif
2049
2050 # Macro for doing in-place file editing using regexps
2051 REINPLACE_ARGS?= -i.bak
2052 REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
2053
2054 # Names of cookies used to skip already completed stages
2055 EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g}
2056 CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done.${PORTNAME}.${PREFIX:S/\//_/g}
2057 INSTALL_COOKIE?= ${WRKDIR}/.install_done.${PORTNAME}.${PREFIX:S/\//_/g}
2058 BUILD_COOKIE?= ${WRKDIR}/.build_done.${PORTNAME}.${PREFIX:S/\//_/g}
2059 PATCH_COOKIE?= ${WRKDIR}/.patch_done.${PORTNAME}.${PREFIX:S/\//_/g}
2060 PACKAGE_COOKIE?= ${WRKDIR}/.package_done.${PORTNAME}.${PREFIX:S/\//_/g}
2061 FAKE_COOKIE?= ${WRKDIR}/.fake_done.${PORTNAME}.${PREFIX:S/\//_/g}
2062
2063 # How to do nothing. Override if you, for some strange reason, would rather
2064 # do something.
2065 DO_NADA?= ${TRUE}
2066
2067 # Use this as the first operand to always build dependency.
2068 NONEXISTENT?= /nonexistent
2069
2070 # Miscellaneous overridable commands:
2071 GMAKE?= gmake
2072 XMKMF?= xmkmf -a
2073 .if exists(/sbin/md5)
2074 MD5?= /sbin/md5
2075 .else
2076 MD5?= md5
2077 .endif
2078 .if exists(/sbin/sha256)
2079 SHA256?= /sbin/sha256
2080 .elif exists(${LOCALBASE_REL}/sbin/sha256)
2081 SHA256?= ${LOCALBASE_REL}/sbin/sha256
2082 .else
2083 SHA256?= NO
2084 .endif
2085
2086 CHECKSUM_ALGORITHMS?= md5 sha256
2087
2088 MD5_FILE?= ${MASTERDIR}/distinfo
2089
2090 MAKE_FLAGS?= -f
2091 MAKEFILE?= Makefile
2092 MAKE_ENV+= TARGETDIR=${TARGETDIR} DESTDIR=${DESTDIR} PREFIX=${PREFIX} \
2093 LOCALBASE=${LOCALBASE_REL} X11BASE=${X11BASE_REL} \
2094 MOTIFLIB="${MOTIFLIB}" LIBDIR="${LIBDIR}" CFLAGS="${CFLAGS}" \
2095 CXXFLAGS="${CXXFLAGS}" MANPREFIX="${MANPREFIX}"
2096
2097 .if ${OSVERSION} < 500016
2098 PTHREAD_CFLAGS?= -D_THREAD_SAFE
2099 PTHREAD_LIBS?= -pthread
2100 .elif ${OSVERSION} < 502102
2101 PTHREAD_CFLAGS?= -D_THREAD_SAFE
2102 PTHREAD_LIBS?= -lc_r
2103 .else
2104 PTHREAD_CFLAGS?=
2105 PTHREAD_LIBS?= -pthread
2106 .endif
2107
2108 .if exists(/usr/bin/fetch)
2109 FETCH_CMD?= /usr/bin/fetch -ApRr
2110 FETCH_REGET?= 1
2111 .if ${OSVERSION} >= 480000 && !defined(DISABLE_SIZE)
2112 # Avoid -S for 4.7 and earlier since it causes fetch errors
2113 FETCH_BEFORE_ARGS+= $${CKSIZE:+-S $$CKSIZE}
2114 .endif
2115 .else
2116 FETCH_CMD?= /usr/bin/ftp
2117 FETCH_REGET?= 0
2118 .endif
2119
2120 .if defined(RANDOMIZE_MASTER_SITES)
2121 .if exists(/usr/games/random)
2122 RANDOM_CMD?= /usr/games/random
2123 RANDOM_ARGS?= "-w -f -"
2124 .if ( ${OSVERSION} > 480000 && ${OSVERSION} < 500000 ) || ${OSVERSION} > 500100
2125 _RANDOMIZE_SITES= " |${RANDOM_CMD} ${RANDOM_ARGS}"
2126 .else
2127 _RANDOMIZE_SITES= ''
2128 .endif
2129 .endif
2130 .endif
2131
2132 TOUCH?= /usr/bin/touch
2133 TOUCH_FLAGS?= -f
2134
2135 DISTORIG?= .bak.orig
2136 PATCH?= /usr/bin/patch
2137 PATCH_STRIP?= -p0
2138 PATCH_DIST_STRIP?= -p0
2139 .if defined(PATCH_DEBUG)
2140 PATCH_DEBUG_TMP= yes
2141 PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
2142 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
2143 .else
2144 PATCH_DEBUG_TMP= no
2145 PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
2146 PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
2147 .endif
2148 .if defined(BATCH)
2149 PATCH_ARGS+= --batch
2150 PATCH_DIST_ARGS+= --batch
2151 .endif
2152
2153 # Prevent breakage with VERSION_CONTROL=numbered
2154 PATCH_ARGS+= -V simple
2155
2156 .if defined(PATCH_CHECK_ONLY)
2157 PATCH_ARGS+= -C
2158 PATCH_DIST_ARGS+= -C
2159 .endif
2160
2161 .if ${PATCH} == "/usr/bin/patch"
2162 PATCH_ARGS+= --suffix .orig
2163 PATCH_DIST_ARGS+= --suffix .orig
2164 .endif
2165
2166 TAR?= /usr/bin/tar
2167
2168 # EXTRACT_SUFX is defined in .pre.mk section
2169 .if defined(USE_ZIP)
2170 EXTRACT_CMD?= ${UNZIP_CMD}
2171 EXTRACT_BEFORE_ARGS?= -qo
2172 EXTRACT_AFTER_ARGS?= -d ${WRKDIR}
2173 .else
2174 EXTRACT_BEFORE_ARGS?= -dc
2175 .if defined(EXTRACT_PRESERVE_OWNERSHIP)
2176 EXTRACT_AFTER_ARGS?= | ${TAR} -xf - --no-same-owner
2177 .else
2178 EXTRACT_AFTER_ARGS?= | ${TAR} -xf -
2179 .endif
2180 .if defined(USE_BZIP2)
2181 EXTRACT_CMD?= ${BZIP2_CMD}
2182 .else
2183 EXTRACT_CMD?= ${GZIP_CMD}
2184 .endif
2185 .endif
2186
2187 # Figure out where the local mtree file is
2188 .if !defined(MTREE_FILE)
2189 .if ${PREFIX} == ${X11BASE_REL} || defined(USE_X_PREFIX)
2190 # User may have specified non-standard PREFIX for installing a port that
2191 # uses X
2192 MTREE_FILE= /etc/mtree/BSD.x11-4.dist
2193 .elif ${PREFIX} == /usr
2194 MTREE_FILE= /etc/mtree/BSD.usr.dist
2195 .else
2196 MTREE_FILE= /etc/mtree/BSD.local.dist
2197 .endif
2198 .endif
2199 MTREE_CMD?= /usr/sbin/mtree
2200 MTREE_LINUX_FILE?= /usr/mports/Templates/linux.fc4.mtree
2201 MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
2202 MTREE_LINUX_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_LINUX_FILE} -d -e -p
2203
2204 # Determine whether or not we can use rootly owner/group functions.
2205 .if !defined(UID)
2206 UID!= ${ID} -u
2207 .endif
2208 .if ${UID} == 0
2209 _BINOWNGRP= -o ${BINOWN} -g ${BINGRP}
2210 _SHROWNGRP= -o ${SHAREOWN} -g ${SHAREGRP}
2211 _MANOWNGRP= -o ${MANOWN} -g ${MANGRP}
2212 .else
2213 _BINOWNGRP=
2214 _SHROWNGRP=
2215 _MANOWNGRP=
2216 .endif
2217
2218 # A few aliases for *-install targets
2219 INSTALL_PROGRAM= \
2220 ${INSTALL} ${COPY} ${STRIP} ${_BINOWNGRP} -m ${BINMODE}
2221 INSTALL_SCRIPT= \
2222 ${INSTALL} ${COPY} ${_BINOWNGRP} -m ${BINMODE}
2223 INSTALL_DATA= \
2224 ${INSTALL} ${COPY} ${_SHROWNGRP} -m ${SHAREMODE}
2225 INSTALL_MAN= \
2226 ${INSTALL} ${COPY} ${_MANOWNGRP} -m ${MANMODE}
2227
2228 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
2229 BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
2230 BSD_INSTALL_DATA="${INSTALL_DATA}" \
2231 BSD_INSTALL_MAN="${INSTALL_MAN}"
2232 MAKE_ENV+= ${INSTALL_MACROS}
2233 SCRIPTS_ENV+= ${INSTALL_MACROS}
2234
2235 # The user can override the NO_PACKAGE by specifying this from
2236 # the make command line
2237 .if defined(FORCE_PACKAGE)
2238 .undef NO_PACKAGE
2239 .endif
2240
2241 COMMENTFILE?= ${PKGDIR}/pkg-comment
2242 DESCR?= ${PKGDIR}/pkg-descr
2243 PLIST?= ${PKGDIR}/pkg-plist
2244 PKGINSTALL?= ${PKGDIR}/pkg-install
2245 PKGDEINSTALL?= ${PKGDIR}/pkg-deinstall
2246 PKGREQ?= ${PKGDIR}/pkg-req
2247 PKGMESSAGE?= ${PKGDIR}/pkg-message
2248
2249 TMPPLIST?= ${WRKDIR}/.PLIST.mktmp
2250
2251 .for _CATEGORY in ${CATEGORIES}
2252 PKGCATEGORY?= ${_CATEGORY}
2253 .endfor
2254 _PORTDIRNAME= ${.CURDIR:T}
2255 PORTDIRNAME?= ${_PORTDIRNAME}
2256 PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME}
2257
2258
2259 .if !defined(DESTDIR)
2260 PKG_CMD?= /usr/sbin/pkg_create
2261 PKG_ADD?= /usr/sbin/pkg_add
2262 PKG_DELETE?= /usr/sbin/pkg_delete
2263 PKG_INFO?= /usr/sbin/pkg_info
2264 PKG_VERSION?= /usr/sbin/pkg_version
2265 .else
2266 PKG_CMD?= /usr/sbin/mport
2267 PKG_ADD?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_add
2268 PKG_DELETE?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_delete
2269 PKG_INFO?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_info
2270 PKG_VERSION?= ${CHROOT} ${DESTDIR} /usr/sbin/pkg_version
2271 .endif
2272
2273 # Does the pkg_create tool support conflict checking?
2274 # XXX Slow?
2275 .if !defined(PKGINSTALLVER)
2276 PKGINSTALLVER!= ${CHROOT} ${DESTDIR} ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //'
2277 .endif
2278 .if ${PKGINSTALLVER} < 20030417
2279 DISABLE_CONFLICTS= YES
2280 .endif
2281 .if !defined(PKG_ARGS)
2282 PKG_ARGS= -v -c -${COMMENT:Q} -S ${_ABS_FAKE_INSTALLDIR} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX}\
2283 -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" \
2284 ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
2285 .if !defined(NO_MTREE)
2286 PKG_ARGS+= -m ${MTREE_FILE}
2287 .endif
2288 .if defined(PKGORIGIN)
2289 PKG_ARGS+= -o ${PKGORIGIN}
2290 .endif
2291 .if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
2292 PKG_ARGS+= -C "${CONFLICTS}"
2293 .endif
2294 .endif
2295
2296 .if defined(PKG_NOCOMPRESS)
2297 PKG_SUFX?= .tar
2298 .else
2299 PKG_SUFX?= .tbz
2300 .endif
2301
2302 # where pkg_add records its dirty deeds.
2303 PKG_DBDIR?= ${DESTDIR}/var/db/pkg
2304
2305 MOTIFLIB?= -L${X11BASE}/lib -lXm -lXp
2306
2307 ALL_TARGET?= all
2308 INSTALL_TARGET?= install
2309
2310 # This is a mid-term solution patch while pkg-comment files are
2311 # phased out.
2312 # The final simpler patch will come afterwards
2313 .if !defined(COMMENT)
2314 check-makevars::
2315 @${ECHO_MSG} 'Makefile error: there is no COMMENT variable defined'
2316 @${ECHO_MSG} 'for this port. Please, rectify this.'
2317 @${FALSE}
2318 .else
2319 .if exists(${COMMENTFILE})
2320 check-makevars::
2321 @${ECHO_MSG} 'Makefile error: There is a COMMENTFILE in this port.'
2322 @${ECHO_MSG} 'COMMENTFILEs have been deprecated in'
2323 @${ECHO_MSG} 'favor of COMMENT variables.'
2324 @${ECHO_MSG} 'Please, rectify this.'
2325 @${FALSE}
2326 .endif
2327 .endif
2328
2329 # Popular master sites
2330 .include "bsd.sites.mk"
2331
2332 # Empty declaration to avoid "variable MASTER_SITES recursive" error
2333 MASTER_SITES?=
2334 PATCH_SITES?=
2335 _MASTER_SITES_DEFAULT?=
2336 _PATCH_SITES_DEFAULT?=
2337
2338 # Feed internal _{MASTER,PATCH}_SITES_n where n is a group designation
2339 # as per grouping rules (:something)
2340 # Organize _{MASTER,PATCH}_SITES_{DEFAULT,[^/:]+} according to grouping
2341 # rules (:something)
2342 .for _S in ${MASTER_SITES}
2343 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2344 . if !empty(_S_TEMP)
2345 . for _group in ${_S_TEMP:S/,/ /g}
2346 _G_TEMP= ${_group}
2347 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2348 check-makevars::
2349 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2350 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITES"
2351 @${FALSE}
2352 . endif
2353 _MASTER_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2354 . endfor
2355 . else
2356 _MASTER_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2357 . endif
2358 .endfor
2359 .for _S in ${PATCH_SITES}
2360 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2361 . if !empty(_S_TEMP)
2362 . for _group in ${_S_TEMP:S/,/ /g}
2363 _G_TEMP= ${_group}
2364 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2365 check-makevars::
2366 @${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
2367 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITES"
2368 @${FALSE}
2369 . endif
2370 _PATCH_SITES_${_group}+= ${_S:C@^(.*/):[^/:]+$@\1@}
2371 . endfor
2372 . else
2373 _PATCH_SITES_DEFAULT+= ${_S:C@^(.*/):[^/:]+$@\1@}
2374 . endif
2375 .endfor
2376
2377 # Feed internal _{MASTER,PATCH}_SITE_SUBDIR_n where n is a group designation
2378 # as per grouping rules (:something)
2379 # Organize _{MASTER,PATCH}_SITE_SUBDIR_{DEFAULT,[^/:]+} according to grouping
2380 # rules (:something)
2381 .for _S in ${MASTER_SITE_SUBDIR}
2382 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2383 . if !empty(_S_TEMP)
2384 . for _group in ${_S_TEMP:S/,/ /g}
2385 _G_TEMP= ${_group}
2386 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2387 check-makevars::
2388 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2389 @${ECHO_MSG} "used in group definitions. Please fix your MASTER_SITE_SUBDIR"
2390 @${FALSE}
2391 . endif
2392 . if defined(_MASTER_SITES_${_group})
2393 _MASTER_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2394 . endif
2395 . endfor
2396 . else
2397 . if defined(_MASTER_SITES_DEFAULT)
2398 _MASTER_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2399 . endif
2400 . endif
2401 .endfor
2402 .for _S in ${PATCH_SITE_SUBDIR}
2403 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2404 . if !empty(_S_TEMP)
2405 . for _group in ${_S_TEMP:S/,/ /g}
2406 _G_TEMP= ${_group}
2407 . if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
2408 check-makevars::
2409 @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
2410 @${ECHO_MSG} "used in group definitions. Please fix your PATCH_SITE_SUBDIR"
2411 @${FALSE}
2412 . endif
2413 . if defined(_PATCH_SITES_${_group})
2414 _PATCH_SITE_SUBDIR_${_group}+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2415 . endif
2416 . endfor
2417 . else
2418 . if defined(_PATCH_SITES_DEFAULT)
2419 _PATCH_SITE_SUBDIR_DEFAULT+= ${_S:C@^(.*)/:[^/:]+$@\1@}
2420 . endif
2421 . endif
2422 .endfor
2423
2424 # Substitute subdirectory names
2425 # XXX simpler/faster solution but not the best space wise, suggestions please
2426 .for _S in ${MASTER_SITES}
2427 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2428 . if !empty(_S_TEMP)
2429 . for _group in ${_S_TEMP:S/,/ /g}
2430 . if !defined(_MASTER_SITE_SUBDIR_${_group})
2431 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}:S^%SUBDIR%/^^}
2432 . else
2433 _S_TEMP_TEMP= ${_MASTER_SITES_${_group}:M*%SUBDIR%/*}
2434 . if empty(_S_TEMP_TEMP)
2435 MASTER_SITES_TMP= ${_MASTER_SITES_${_group}}
2436 . else
2437 MASTER_SITES_TMP=
2438 . for site in ${_MASTER_SITES_${_group}}
2439 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2440 . if empty(_S_TEMP_TEMP)
2441 MASTER_SITES_TMP+= ${site}
2442 . else
2443 . for dir in ${_MASTER_SITE_SUBDIR_${_group}}
2444 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2445 . endfor
2446 . endif
2447 . endfor
2448 . endif
2449 . endif
2450 _MASTER_SITES_${_group}:= ${MASTER_SITES_TMP}
2451 . endfor
2452 . endif
2453 .endfor
2454 .if defined(_MASTER_SITE_SUBDIR_DEFAULT)
2455 _S_TEMP= ${_MASTER_SITES_DEFAULT:M*%SUBDIR%/*}
2456 . if empty(_S_TEMP)
2457 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT}
2458 . else
2459 MASTER_SITES_TMP=
2460 . for site in ${_MASTER_SITES_DEFAULT}
2461 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2462 . if empty(_S_TEMP_TEMP)
2463 MASTER_SITES_TMP+= ${site}
2464 . else
2465 . for dir in ${_MASTER_SITE_SUBDIR_DEFAULT}
2466 MASTER_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2467 . endfor
2468 . endif
2469 . endfor
2470 . endif
2471 .else
2472 MASTER_SITES_TMP= ${_MASTER_SITES_DEFAULT:S^%SUBDIR%/^^}
2473 .endif
2474 _MASTER_SITES_DEFAULT:= ${MASTER_SITES_TMP}
2475 MASTER_SITES_TMP=
2476 .for _S in ${PATCH_SITES}
2477 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:S/^://}
2478 . if !empty(_S_TEMP)
2479 . for _group in ${_S_TEMP:S/,/ /g}
2480 . if !defined(_PATCH_SITE_SUBDIR_${_group})
2481 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}:S^%SUBDIR%/^^}
2482 . else
2483 _S_TEMP_TEMP= ${_PATCH_SITES_${_group}:M*%SUBDIR%/*}
2484 . if empty(_S_TEMP_TEMP)
2485 PATCH_SITES_TMP= ${_PATCH_SITES_${_group}}
2486 . else
2487 PATCH_SITES_TMP=
2488 . for site in ${_PATCH_SITES_${_group}}
2489 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2490 . if empty(_S_TEMP_TEMP)
2491 PATCH_SITES_TMP+= ${site}
2492 . else
2493 . for dir in ${_PATCH_SITE_SUBDIR_${_group}}
2494 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2495 . endfor
2496 . endif
2497 . endfor
2498 . endif
2499 . endif
2500 _PATCH_SITES_${_group}:= ${PATCH_SITES_TMP}
2501 . endfor
2502 . endif
2503 .endfor
2504 .if defined(_PATCH_SITE_SUBDIR_DEFAULT)
2505 _S_TEMP= ${_PATCH_SITES_DEFAULT:M*%SUBDIR%/*}
2506 . if empty(_S_TEMP)
2507 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT}
2508 . else
2509 PATCH_SITES_TMP=
2510 . for site in ${_PATCH_SITES_DEFAULT}
2511 _S_TEMP_TEMP= ${site:M*%SUBDIR%/*}
2512 . if empty(_S_TEMP_TEMP)
2513 PATCH_SITES_TMP+= ${site}
2514 . else
2515 . for dir in ${_PATCH_SITE_SUBDIR_DEFAULT}
2516 PATCH_SITES_TMP+= ${site:S^%SUBDIR%^\${dir}^}
2517 . endfor
2518 . endif
2519 . endfor
2520 . endif
2521 .else
2522 PATCH_SITES_TMP= ${_PATCH_SITES_DEFAULT:S^%SUBDIR%/^^}
2523 .endif
2524 _PATCH_SITES_DEFAULT:= ${PATCH_SITES_TMP}
2525 PATCH_SITES_TMP=
2526
2527 # The primary backup site.
2528 MASTER_SITE_BACKUP?= \
2529 ftp://ftp.freeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
2530 MASTER_SITE_BACKUP:= ${MASTER_SITE_BACKUP:S^\${DIST_SUBDIR}/^^}
2531
2532 # If the user has MASTER_SITE_FREEBSD set, go to the FreeBSD repository
2533 # for everything, but don't search it twice by appending it to the end.
2534 .if defined(MASTER_SITE_FREEBSD)
2535 _MASTER_SITE_OVERRIDE:= ${MASTER_SITE_BACKUP}
2536 _MASTER_SITE_BACKUP:= # empty
2537 .else
2538 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE}
2539 _MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP}
2540 .endif
2541
2542 # Search CDROM first if mounted, symlink instead of copy if
2543 # FETCH_SYMLINK_DISTFILES is set
2544 .for MOUNTPT in ${CD_MOUNTPTS}
2545 .if exists(${MOUNTPT}/mports/distfiles)
2546 _MASTER_SITE_OVERRIDE:= file:${MOUNTPT}/mports/distfiles/${DIST_SUBDIR}/ ${_MASTER_SITE_OVERRIDE}
2547 .if defined(FETCH_SYMLINK_DISTFILES)
2548 FETCH_BEFORE_ARGS+= -l
2549 .endif
2550 .endif
2551 .endfor
2552
2553 NOFETCHFILES?=
2554
2555 # Organize DISTFILES, PATCHFILES, _MASTER_SITES_ALL, _PATCH_SITES_ALL
2556 # according to grouping rules (:something)
2557 DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
2558 _MASTER_SITES_ALL= ${_MASTER_SITES_DEFAULT}
2559 _PATCH_SITES_ALL= ${_PATCH_SITES_DEFAULT}
2560 _G_TEMP= DEFAULT
2561 .for _D in ${DISTFILES}
2562 _D_TEMP= ${_D:S/^${_D:C/:[^:]+$//}//}
2563 . if !empty(_D_TEMP)
2564 . for _group in ${_D_TEMP:S/^://:S/,/ /g}
2565 . if !defined(_MASTER_SITES_${_group})
2566 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2567 . if empty(_G_TEMP_TEMP)
2568 _G_TEMP+= ${_group}
2569 _MASTER_SITES_ALL+= ${_MASTER_SITES_${_group}}
2570 . endif
2571 . endif
2572 . endfor
2573 _DISTFILES+= ${_D:C/:[^:]+$//}
2574 . else
2575 _DISTFILES+= ${_D}
2576 . endif
2577 .endfor
2578 _G_TEMP= DEFAULT
2579 .for _P in ${PATCHFILES}
2580 _P_TEMP= ${_P:S/^${_P:C/:[^:]+$//}//}
2581 . if !empty(_P_TEMP)
2582 . for _group in ${_P_TEMP:S/^://:S/,/ /g}
2583 . if !defined(_PATCH_SITES_${_group})
2584 _G_TEMP_TEMP= ${_G_TEMP:M/${_group}/}
2585 . if empty(_G_TEMP_TEMP)
2586 _G_TEMP+= ${_group}
2587 _PATCH_SITES_ALL+= ${_PATCH_SITES_${_group}}
2588 . endif
2589 . endif
2590 . endfor
2591 _PATCHFILES+= ${_P:C/:[^:]+$//}
2592 . else
2593 _PATCHFILES+= ${_P}
2594 . endif
2595 .endfor
2596 _G_TEMP=
2597 _G_TEMP_TEMP=
2598 ALLFILES?= ${_DISTFILES} ${_PATCHFILES}
2599
2600 #
2601 # Sort the master site list according to the patterns in MASTER_SORT
2602 #
2603 MASTER_SORT?=
2604 MASTER_SORT_REGEX?=
2605 MASTER_SORT_REGEX+= ${MASTER_SORT:S|.|\\.|g:S|^|://[^/]*|:S|$|/|}
2606
2607 MASTER_SORT_AWK= BEGIN { RS = " "; ORS = " "; IGNORECASE = 1 ; gl = "${MASTER_SORT_REGEX:S|\\|\\\\|g}"; }
2608 .for srt in ${MASTER_SORT_REGEX}
2609 MASTER_SORT_AWK+= /${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
2610 .endfor
2611 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
2612
2613 SORTED_MASTER_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-DEFAULT
2614 SORTED_PATCH_SITES_DEFAULT_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-DEFAULT
2615 SORTED_MASTER_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-ALL
2616 SORTED_PATCH_SITES_ALL_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-ALL
2617
2618 #
2619 # Sort the master site list according to the patterns in MASTER_SORT
2620 # according to grouping rules (:something)
2621 #
2622 # for use in the fetch targets
2623 .for _S in ${MASTER_SITES}
2624 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2625 . if !empty(_S_TEMP)
2626 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2627 . if !target(master-sites-${_group})
2628 SORTED_MASTER_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-${_group}
2629 master-sites-${_group}:
2630 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2631 . endif
2632 . endfor
2633 . endif
2634 .endfor
2635 .for _S in ${PATCH_SITES}
2636 _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//}
2637 . if !empty(_S_TEMP)
2638 . for _group in ${_S_TEMP:S/^://:S/,/ /g}
2639 . if !target(patch-sites-${_group})
2640 SORTED_PATCH_SITES_${_group}_CMD= cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-${_group}
2641 patch-sites-${_group}:
2642 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2643 . endif
2644 . endfor
2645 . endif
2646 .endfor
2647
2648 #
2649 # Hackery to enable simple fetch targets with several dynamic MASTER_SITES
2650 #
2651 _MASTER_SITES_ENV= _MASTER_SITES_DEFAULT="${_MASTER_SITES_DEFAULT}"
2652 .for _F in ${DISTFILES}
2653 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2654 . if !empty(_F_TEMP)
2655 . for _group in ${_F_TEMP:S/,/ /g}
2656 . if defined(_MASTER_SITES_${_group})
2657 _MASTER_SITES_ENV+= _MASTER_SITES_${_group}="${_MASTER_SITES_${_group}}"
2658 . endif
2659 . endfor
2660 . endif
2661 .endfor
2662 _PATCH_SITES_ENV= _PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}"
2663 .for _F in ${PATCHFILES}
2664 _F_TEMP= ${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2665 . if !empty(_F_TEMP)
2666 . for _group in ${_F_TEMP:S/,/ /g}
2667 . if defined(_PATCH_SITES_${_group})
2668 _PATCH_SITES_ENV+= _PATCH_SITES_${_group}="${_PATCH_SITES_${_group}}"
2669 . endif
2670 . endfor
2671 . endif
2672 .endfor
2673
2674 master-sites-ALL:
2675 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2676 patch-sites-ALL:
2677 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2678 # has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
2679 master-sites-DEFAULT:
2680 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2681 patch-sites-DEFAULT:
2682 @${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
2683
2684 # synonyms, mnemonics
2685 master-sites-all: master-sites-ALL
2686 patch-sites-all: patch-sites-ALL
2687 master-sites-default: master-sites-DEFAULT
2688 patch-sites-default: patch-sites-DEFAULT
2689
2690 # compatibility with old behavior
2691 master-sites: master-sites-DEFAULT
2692 patch-sites: patch-sites-DEFAULT
2693
2694 .if defined(IGNOREFILES)
2695 .if !defined(CKSUMFILES)
2696 CKSUMFILES!= \
2697 for file in ${ALLFILES}; do \
2698 ignore=0; \
2699 for tmp in ${IGNOREFILES}; do \
2700 if [ "$$file" = "$$tmp" ]; then \
2701 ignore=1; \
2702 fi; \
2703 done; \
2704 if [ "$$ignore" = 0 ]; then \
2705 ${ECHO_CMD} "$$file"; \
2706 fi; \
2707 done
2708 .endif
2709 .else
2710 CKSUMFILES= ${ALLFILES}
2711 .endif
2712
2713 # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
2714 .if defined(DIST_SUBDIR)
2715 .if defined(CKSUMFILES) && ${CKSUMFILES}!=""
2716 _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
2717 .endif
2718 .if defined(IGNOREFILES) && ${IGNOREFILES}!=""
2719 _IGNOREFILES?= ${IGNOREFILES:S/^/${DIST_SUBDIR}\//}
2720 .endif
2721 .else
2722 _CKSUMFILES?= ${CKSUMFILES}
2723 _IGNOREFILES?= ${IGNOREFILES}
2724 .endif
2725
2726 # This is what is actually going to be extracted, and is overridable
2727 # by user.
2728 EXTRACT_ONLY?= ${_DISTFILES}
2729
2730 .if !target(maintainer)
2731 maintainer:
2732 @${ECHO_CMD} "${MAINTAINER}"
2733 .endif
2734
2735 .if !target(check-makefile)
2736 check-makefile::
2737 @${DO_NADA}
2738 .endif
2739
2740 .if !defined(CATEGORIES)
2741 check-categories:
2742 @${ECHO_MSG} "${PKGNAME}: Makefile error: CATEGORIES is mandatory."
2743 @${FALSE}
2744 .else
2745
2746 VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
2747 benchmarks biology cad comms converters databases \
2748 deskutils devel dns editors elisp emulators finance french ftp \
2749 games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
2750 ipv6 irc japanese java kde korean lang linux lisp \
2751 mail math mbone misc multimedia net net-im net-mgmt net-p2p news \
2752 palm parallel pear perl5 picobsd plan9 polish portuguese ports-mgmt print \
2753 python ruby rubygems russian \
2754 scheme science security shells spanish sysutils \
2755 tcl80 tcl81 tcl82 tcl83 tcl84 textproc \
2756 tk80 tk82 tk83 tk84 tkstep80 \
2757 ukrainian vietnamese windowmaker www \
2758 x11 x11-clocks x11-fm x11-fonts x11-servers x11-themes x11-toolkits \
2759 x11-wm xfce zope
2760
2761 check-categories:
2762 .for cat in ${CATEGORIES}
2763 @if ${ECHO_CMD} ${VALID_CATEGORIES} | ${GREP} -wq ${cat}; then \
2764 ${TRUE}; \
2765 else \
2766 ${ECHO_MSG} "${PKGNAME}: Makefile error: category ${cat} not in list of valid categories."; \
2767 ${FALSE}; \
2768 fi
2769 .endfor
2770 .endif
2771
2772 .if !target(check-makevars)
2773 check-makevars::
2774 @${DO_NADA}
2775 .endif
2776
2777 .if !target(check-depends)
2778 check-depends:
2779 @${DO_NADA}
2780 .endif
2781
2782 PKGREPOSITORYSUBDIR?= All
2783 PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
2784
2785 PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
2786
2787
2788 # The "latest version" link -- ${PKGNAME} minus everthing after the last '-'
2789 PKGLATESTREPOSITORY?= ${PACKAGES}/Latest
2790 PKGBASE?= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
2791 LATEST_LINK?= ${PKGBASE}
2792 PKGLATESTFILE= ${PKGLATESTREPOSITORY}/${LATEST_LINK}${PKG_SUFX}
2793
2794 .if defined(PERL_CONFIGURE)
2795 CONFIGURE_ARGS+= CC="${CC}" CCFLAGS="${CFLAGS}" PREFIX="${TARGETDIR}" \
2796 INSTALLPRIVLIB="${TARGETDIR}/lib" INSTALLARCHLIB="${TARGETDIR}/lib"
2797 CONFIGURE_SCRIPT?= Makefile.PL
2798 MAN3PREFIX?= ${TARGETDIR}/lib/perl5/${PERL_VERSION}
2799 .undef HAS_CONFIGURE
2800 .endif
2801
2802 CONFIGURE_SCRIPT?= configure
2803 CONFIGURE_TARGET?= ${ARCH}-portbld-freebsd6.0
2804 CONFIGURE_LOG?= config.log
2805
2806 # A default message to print if do-configure fails.
2807 CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer] and attach the \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\" including the output of the failure of your make command. Also, it might be a good idea to provide an overview of all packages installed on your system (e.g. an \`ls ${PKG_DBDIR}\`)."
2808
2809 .if defined(GNU_CONFIGURE)
2810 # Maximum command line length
2811 .if !defined(CONFIGURE_MAX_CMD_LEN)
2812 CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax
2813 .endif
2814 CONFIGURE_ARGS+= --prefix=${PREFIX} ${CONFIGURE_TARGET}
2815 CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
2816 HAS_CONFIGURE= yes
2817 .endif
2818
2819 # Passed to most of script invocations
2820 SCRIPTS_ENV+= CURDIR=${MASTERDIR} DISTDIR=${DISTDIR} \
2821 WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
2822 SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
2823 PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
2824 PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \
2825 DESTDIR=${DESTDIR} TARGETDIR=${DESTDIR}
2826
2827 .if defined(BATCH)
2828 SCRIPTS_ENV+= BATCH=yes
2829 .endif
2830
2831 .if ${PREFIX} == /usr
2832 MANPREFIX?= ${DESTDIR}/usr/share
2833 .else
2834 MANPREFIX?= ${TARGETDIR}
2835 .endif
2836
2837 .for sect in 1 2 3 4 5 6 7 8 9
2838 MAN${sect}PREFIX?= ${MANPREFIX}
2839 .endfor
2840 MANLPREFIX?= ${MANPREFIX}
2841 MANNPREFIX?= ${MANPREFIX}
2842
2843 MANLANG?= "" # english only by default
2844
2845 .if !defined(NOMANCOMPRESS)
2846 MANEXT= .gz
2847 .endif
2848
2849 .if (defined(MLINKS) || defined(_MLINKS_PREPEND)) && !defined(_MLINKS)
2850 __pmlinks!= ${ECHO_CMD} '${MLINKS:S/ / /}' | ${AWK} \
2851 '{ if (NF % 2 != 0) { print "broken"; exit; } \
2852 for (i=1; i<=NF; i++) { \
2853 if ($$i ~ /^-$$/ && i != 1 && i % 2 != 0) \
2854 { $$i = $$(i-2); printf " " $$i " "; } \
2855 else if ($$i ~ /^[^ ]+\.[1-9ln][^. ]*$$/ || $$i ~ /^\//) \
2856 printf " " $$i " "; \
2857 else \
2858 { print "broken"; exit; } \
2859 } \
2860 }' | ${SED} -e 's \([^/ ][^ ]*\.\(.\)[^. ]*\) $${MAN\2PREFIX}/$$$$$$$${__lang}/man\2/\1${MANEXT}g' -e 's/ //g' -e 's/MANlPREFIX/MANLPREFIX/g' -e 's/MANnPREFIX/MANNPREFIX/g'
2861 .if ${__pmlinks:Mbroken} == "broken"
2862 check-makevars::
2863 @${ECHO_MSG} "${PKGNAME}: Makefile error: unable to parse MLINKS."
2864 @${FALSE}
2865 .endif
2866 _MLINKS= ${_MLINKS_PREPEND}
2867 # XXX 20040119 This next line should read:
2868 # .for lang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
2869 # but there is currently a bug in make(1) that prevents the double-quote
2870 # substitution from working correctly. Once that problem is addressed,
2871 # and has had a enough time to mature, this hack should be removed.
2872 .for lang in ${MANLANG:S%^%man/%:S%^man/""$%man%:S%^man/"$%man%}
2873 .for ___pmlinks in ${__pmlinks}
2874 .for __lang in ${lang}
2875 _MLINKS+= ${___pmlinks:S// /g}
2876 .endfor
2877 .endfor
2878 .endfor
2879 .endif
2880 _COUNT=0
2881 .for ___tpmlinks in ${_MLINKS}
2882 .if ${_COUNT} == "1"
2883 _TMLINKS+= ${___tpmlinks}
2884 _COUNT=0
2885 .else
2886 _COUNT=1
2887 .endif
2888 .endfor
2889
2890 # XXX 20040119 This next line should read:
2891 # .for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%}
2892 # but there is currently a bug in make(1) that prevents the double-quote
2893 # substitution from working correctly. Once that problem is addressed,
2894 # and has had a enough time to mature, this hack should be removed.
2895 .for manlang in ${MANLANG:S%^%man/%:S%^man/""$%man%:S%^man/"$%man%}
2896
2897 .for sect in 1 2 3 4 5 6 7 8 9 L N
2898 .if defined(MAN${sect})
2899 _MANPAGES+= ${MAN${sect}:S%^%${MAN${sect}PREFIX}/${manlang}/man${sect:L}/%}
2900 .endif
2901 .endfor
2902
2903 .endfor
2904
2905 .if !defined(_TMLINKS)
2906 _TMLINKS=
2907 .endif
2908
2909 .if defined(_MANPAGES)
2910
2911 .for m in ${_MANPAGES}
2912 _FAKEMAN += ${_ABS_FAKE_INSTALLDIR}${m}
2913 .endfor
2914
2915 .if defined(NOMANCOMPRESS)
2916 __MANPAGES:= ${_MANPAGES:S%^${TARGETDIR}/%%}
2917 .else
2918 __MANPAGES:= ${_MANPAGES:S%^${TARGETDIR}/%%:S%$%.gz%}
2919 .endif
2920
2921 .if ${MANCOMPRESSED} == "yes"
2922 _MANPAGES:= ${_MANPAGES:S%$%.gz%}
2923 .endif
2924
2925 .endif
2926
2927 .if ${PREFIX} == /usr
2928 INFO_PATH?= share/info
2929 .else
2930 INFO_PATH?= info
2931 .endif
2932
2933 DOCSDIR?= ${TARGETDIR}/share/doc/${PORTNAME}
2934 EXAMPLESDIR?= ${TARGETDIR}/share/examples/${PORTNAME}
2935 DATADIR?= ${TARGETDIR}/share/${PORTNAME}
2936
2937 PLIST_SUB+= DOCSDIR="${DOCSDIR:S,^${TARGETDIR}/,,}" \
2938 EXAMPLESDIR="${EXAMPLESDIR:S,^${TARGETDIR}/,,}" \
2939 DATADIR="${DATADIR:S,^${TARGETDIR}/,,}"
2940
2941 DESKTOPDIR?= ${TARGETDIR}/share/applications
2942 _DESKTOPDIR_REL= ${DESKTOPDIR:S,^${TARGETDIR}/,,}/
2943
2944 .if ${_DESKTOPDIR_REL} == ${DESKTOPDIR}/
2945 # DESKTOPDIR is not beneath PREFIX
2946 _DESKTOPDIR_REL=
2947 .endif
2948
2949 # Put this as far down as possible so it will catch all PLIST_SUB definitions.
2950
2951 .if defined(INSTALLS_SHLIB)
2952 LDCONFIG_DIRS?= %%PREFIX%%/lib
2953 LDCONFIG_PLIST!= ${ECHO_CMD} ${LDCONFIG_DIRS} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
2954 LDCONFIG_RUNLIST!= ${ECHO_CMD} ${LDCONFIG_PLIST} | ${SED} -e "s!%D!${PREFIX}!g"
2955 .endif
2956
2957 .MAIN: all
2958
2959 ################################################################
2960 # Many ways to disable a port.
2961 #
2962 # If we're in BATCH mode and the port is interactive, or we're
2963 # in interactive mode and the port is non-interactive, skip all
2964 # the important targets. The reason we have two modes is that
2965 # one might want to leave a build in BATCH mode running
2966 # overnight, then come back in the morning and do _only_ the
2967 # interactive ones that required your intervention.
2968 #
2969 # Ignore ports that can't be resold if building for a CDROM.
2970 #
2971 # Don't build a port if it's restricted and we don't want to get
2972 # into that.
2973 #
2974 # Don't build a port if it's broken, unless we're running a parallel
2975 # build (in case it's fixed).
2976 #
2977 # Don't build a port if it's forbidden for whatever reason.
2978 #
2979 # Don't build a port if the system is too old.
2980 ################################################################
2981
2982 # Check the machine architectures
2983 .if defined(ONLY_FOR_ARCHS)
2984 .for __ARCH in ${ONLY_FOR_ARCHS}
2985 .if ${ARCH:M${__ARCH}} != ""
2986 __ARCH_OK?= 1
2987 .endif
2988 .endfor
2989 .else
2990 __ARCH_OK?= 1
2991 .endif
2992
2993 .if defined(NOT_FOR_ARCHS)
2994 .for __NARCH in ${NOT_FOR_ARCHS}
2995 .if ${ARCH:M${__NARCH}} != ""
2996 .undef __ARCH_OK
2997 .endif
2998 .endfor
2999 .endif
3000
3001 .if !defined(__ARCH_OK)
3002 .if defined(ONLY_FOR_ARCHS)
3003 IGNORE= is only for ${ONLY_FOR_ARCHS},
3004 .else # defined(NOT_FOR_ARCHS)
3005 IGNORE= does not run on ${NOT_FOR_ARCHS}.
3006 .endif
3007 IGNORE+= and you are running ${ARCH}.
3008
3009 .if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
3010 IGNORE+= Reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}}
3011 .elif defined(ONLY_FOR_ARCHS_REASON)
3012 IGNORE+= Reason: ${ONLY_FOR_ARCHS_REASON}
3013 .endif
3014
3015 .if defined(NOT_FOR_ARCHS_REASON_${ARCH})
3016 IGNORE+= Reason: ${NOT_FOR_ARCHS_REASON_${ARCH}}
3017 .elif defined(NOT_FOR_ARCHS_REASON)
3018 IGNORE+= Reason: ${NOT_FOR_ARCHS_REASON}
3019 .endif
3020
3021 .endif
3022
3023 # Check the user interaction and legal issues
3024 .if !defined(NO_IGNORE)
3025 .if (defined(IS_INTERACTIVE) && defined(BATCH))
3026 IGNORE= is an interactive port
3027 .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
3028 IGNORE= is not an interactive port
3029 .elif (defined(NO_CDROM) && defined(FOR_CDROM))
3030 IGNORE= may not be placed on a CDROM: ${NO_CDROM}
3031 .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
3032 IGNORE= is restricted: ${RESTRICTED}
3033 .elif defined(BROKEN)
3034 .if !defined(TRYBROKEN)
3035 IGNORE= is marked as broken: ${BROKEN}
3036 .endif
3037 .elif defined(FORBIDDEN)
3038 IGNORE= is forbidden: ${FORBIDDEN}
3039 .endif
3040
3041 .if (defined(MANUAL_PACKAGE_BUILD) && defined(PACKAGE_BUILDING))
3042 IGNORE= has to be built manually: ${MANUAL_PACKAGE_BUILD}
3043 clean:
3044 @${IGNORECMD}
3045 .endif
3046
3047 .if defined(IGNORE)
3048 .if defined(IGNORE_SILENT)
3049 IGNORECMD= ${DO_NADA}
3050 .else
3051 IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} "${IGNORE:Q}.;exit 1
3052 .endif
3053
3054 .for target in check-sanity fetch checksum extract patch configure all build install reinstall package
3055 .if !target(${target})
3056 ${target}:
3057 @${IGNORECMD}
3058 .if defined(INSTALLS_DEPENDS)
3059 @${FALSE}
3060 .endif
3061 .endif
3062 .endfor
3063
3064 .endif
3065
3066 .endif
3067
3068 .if defined(IGNORE) || defined(NO_PACKAGE)
3069 ignorelist: package-name
3070 .else
3071 ignorelist:
3072 @${DO_NADA}
3073 .endif
3074
3075 ################################################################
3076 # Clean directories for ftp or CDROM.
3077 ################################################################
3078
3079 .if defined(RESTRICTED)
3080 clean-restricted: delete-distfiles delete-package
3081 clean-restricted-list: delete-distfiles-list delete-package-list
3082 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
3083 .else
3084 clean-restricted:
3085 clean-restricted-list:
3086 .endif
3087
3088 .if defined(NO_CDROM)
3089 clean-for-cdrom: delete-distfiles delete-package
3090 clean-for-cdrom-list: delete-distfiles-list delete-package-list
3091 RESTRICTED_FILES?= ${_DISTFILES} ${_PATCHFILES}
3092 .else
3093 clean-for-cdrom:
3094 clean-for-cdrom-list:
3095 .endif
3096
3097 .if defined(ALL_HOOK)
3098 all:
3099 @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
3100 DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} \
3101 PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
3102 FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} DESTDIR=${DESTDIR} PREFIX=${PREFIX} \
3103 DEPENDS="${DEPENDS}" BUILD_DEPENDS="${BUILD_DEPENDS}" \
3104 RUN_DEPENDS="${RUN_DEPENDS}" X11BASE=${X11BASE} \
3105 CONFLICTS="${CONFLICTS}" \
3106 ${ALL_HOOK}
3107 .endif
3108
3109 .if !target(all)
3110 all: build
3111 .endif
3112
3113 .if !defined(DEPENDS_TARGET)
3114 .if make(reinstall)
3115 DEPENDS_TARGET= reinstall
3116 .else
3117 DEPENDS_TARGET= install
3118 .endif
3119 .if defined(DEPENDS_CLEAN)
3120 DEPENDS_TARGET+= clean
3121 DEPENDS_ARGS+= NOCLEANDEPENDS=yes
3122 .endif
3123 .else
3124 DEPENDS_ARGS+= FORCE_PKG_REGISTER=yes
3125 .endif
3126 .if defined(DEPENDS)
3127 # pretty much guarantees overwrite of existing installation
3128 .MAKEFLAGS: FORCE_PKG_REGISTER=yes
3129 .endif
3130
3131 ################################################################
3132 #
3133 # Do preliminary work to detect if we need to run the config
3134 # target or not.
3135 #
3136 ################################################################
3137 .if (!defined(OPTIONS) || defined(CONFIG_DONE) || \
3138 defined(PACKAGE_BUILDING) || defined(BATCH) || \
3139 exists(${_OPTIONSFILE}) || exists(${_OPTIONSFILE}.local))
3140 _OPTIONS_OK=yes
3141 .endif
3142
3143 ################################################################
3144 # The following are used to create easy dummy targets for
3145 # disabling some bit of default target behavior you don't want.
3146 # They still check to see if the target exists, and if so don't
3147 # do anything, since you might want to set this globally for a
3148 # group of ports in a Makefile.inc, but still be able to
3149 # override from an individual Makefile.
3150 ################################################################
3151
3152 # Disable checksum
3153 .if defined(NO_CHECKSUM) && !target(checksum)
3154 checksum: fetch
3155 @${DO_NADA}
3156 .endif
3157
3158 # Disable build
3159 .if defined(NO_BUILD) && !target(build)
3160 build: configure
3161 @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
3162 .endif
3163
3164 # Disable install
3165 .if defined(NO_INSTALL) && !target(install)
3166 install: build
3167 @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
3168 .endif
3169
3170 # Disable package
3171 .if defined(NO_PACKAGE) && !target(package)
3172 package:
3173 .if defined(IGNORE_SILENT)
3174 @${DO_NADA}
3175 .else
3176 @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: "${NO_PACKAGE:Q}.
3177 .endif
3178 .endif
3179
3180 # Disable describe
3181 .if defined(NO_DESCRIBE) && !target(describe)
3182 describe:
3183 @${DO_NADA}
3184 .endif
3185
3186 ################################################################
3187 # More standard targets start here.
3188 #
3189 # These are the body of the build/install framework. If you are
3190 # not happy with the default actions, and you can't solve it by
3191 # adding pre-* or post-* targets/scripts, override these.
3192 ################################################################
3193
3194 # Pre-everything
3195
3196 # XXX MCL suggests deprecating this in favor of something
3197 # less likely to be abused by overloading
3198 pre-everything::
3199 @${DO_NADA}
3200
3201 buildanyway-message:
3202 .if defined(TRYBROKEN) && defined(BROKEN)
3203 @${ECHO_MSG} "Trying build of ${PKGNAME} even though it is marked BROKEN."
3204 .else
3205 @${DO_NADA}
3206 .endif
3207
3208 options-message:
3209 .if defined(GNOME_OPTION_MSG) && (!defined(PACKAGE_BUILDING) || !defined(BATCH))
3210 @for m in ${GNOME_OPTION_MSG}; do \
3211 ${ECHO_MSG} $$m; \
3212 done
3213 .else
3214 @${DO_NADA}
3215 .endif
3216 .if defined(_OPTIONS_READ)
3217 @${ECHO_MSG} "===> Found saved configuration for ${_OPTIONS_READ}"
3218 .if ${OPTIONSFILE} != ${_OPTIONSFILE}
3219 @${ECHO_MSG} "===> *** CAUTION *** Using wrong configuration file ${_OPTIONSFILE}"
3220 .endif
3221 .endif
3222
3223
3224 # Warn user about deprecated packages. Advisory only.
3225
3226 .if !target(check-deprecated)
3227 check-deprecated:
3228 .if defined(DEPRECATED)
3229 @${ECHO_MSG} "===> NOTICE:"
3230 @${ECHO_MSG}
3231 @${ECHO_MSG} "This port is deprecated; you may wish to reconsider installing it:"
3232 @${ECHO_MSG}
3233 @${ECHO_MSG} ${DEPRECATED:Q}.
3234 @${ECHO_MSG}
3235 .if defined(EXPIRATION_DATE)
3236 @${ECHO_MSG} "It is scheduled to be removed on or after ${EXPIRATION_DATE}."
3237 @${ECHO_MSG}
3238 .endif
3239 .endif
3240 .endif
3241
3242 # Check if the port is listed in the vulnerability database
3243
3244 AUDITFILE?= /var/db/portaudit/auditfile.tbz
3245 _EXTRACT_AUDITFILE= ${TAR} -jxOf "${AUDITFILE}" auditfile
3246
3247 check-vulnerable:
3248 .if !defined(DISABLE_VULNERABILITIES) && !defined(PACKAGE_BUILDING)
3249 @if [ -f "${AUDITFILE}" ]; then \
3250 audit_created=`${_EXTRACT_AUDITFILE} | \
3251 ${SED} -nEe "1s/^#CREATED: *([0-9]{4})-?([0-9]{2})-?([0-9]{2}).*$$/\1\2\3/p"`; \
3252 audit_expiry=`/bin/date -u -v-14d "+%Y%m%d"`; \
3253 if [ "$$audit_created" -lt "$$audit_expiry" ]; then \
3254 ${ECHO_MSG} "===> WARNING: Vulnerability database out of date, checking anyway"; \
3255 fi; \
3256 vlist=`${_EXTRACT_AUDITFILE} | ${GREP} "${PORTNAME}" | \
3257 ${AWK} -F\| ' /^[^#]/ { \
3258 if (!system("${PKG_VERSION} -T \"${PKGNAME}\" \"" $$1 "\"")) \
3259 print "=> " $$3 ".\n Reference: <" $$2 ">" \
3260 } \
3261 '`; \
3262 if [ -n "$$vlist" ]; then \
3263 ${ECHO_MSG} "===> ${PKGNAME} has known vulnerabilities:"; \
3264 ${ECHO_MSG} "$$vlist"; \
3265 ${ECHO_MSG} "=> Please update your ports tree and try again."; \
3266 exit 1; \
3267 fi; \
3268 else \
3269 ${ECHO_MSG} "===> Vulnerability check disabled, database not found"; \
3270 fi
3271 .endif
3272
3273 # Fetch
3274
3275 .if !target(do-fetch)
3276 do-fetch:
3277 @${MKDIR} ${_DISTDIR}
3278 @(cd ${_DISTDIR}; \
3279 ${_MASTER_SITES_ENV} ; \
3280 for _file in ${DISTFILES}; do \
3281 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
3282 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3283 force_fetch=false; \
3284 filebasename=`${BASENAME} $$file`; \
3285 for afile in ${FORCE_FETCH}; do \
3286 afile=`${BASENAME} $$afile`; \
3287 if [ "x$$afile" = "x$$filebasename" ]; then \
3288 force_fetch=true; \
3289 fi; \
3290 done; \
3291 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3292 DIR=${DIST_SUBDIR}; \
3293 pattern="$${DIR:+$$DIR/}`${ECHO_CMD} $$file | ${SED} -e 's/\./\\\\./g'`"; \
3294 if [ -L $$file -o -L $$filebasename ]; then \
3295 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3296 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3297 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3298 exit 1; \
3299 fi ; \
3300 if [ -f ${MD5_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then \
3301 if ! ${GREP} -q "^MD5 ($$pattern)" ${MD5_FILE}; then \
3302 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is not in ${MD5_FILE}."; \
3303 ${ECHO_MSG} "=> Either ${MD5_FILE} is out of date, or"; \
3304 ${ECHO_MSG} "=> $${DIR:+$$DIR/}$$file is spelled incorrectly."; \
3305 exit 1; \
3306 fi; \
3307 fi; \
3308 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3309 if [ ! -w ${DISTDIR} ]; then \
3310 ${ECHO_MSG} "=> ${DISTDIR} is not writable by you; cannot fetch."; \
3311 exit 1; \
3312 fi; \
3313 if [ ! -z "$$select" ] ; then \
3314 __MASTER_SITES_TMP= ; \
3315 for group in $$select; do \
3316 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
3317 eval ___MASTER_SITES_TMP="\$${_MASTER_SITES_$${group}}" ; \
3318 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
3319 fi \
3320 done; \
3321 ___MASTER_SITES_TMP= ; \
3322 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3323 else \
3324 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
3325 fi ; \
3326 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
3327 ${ECHO_MSG} "=> Attempting to fetch from $${site}."; \
3328 DIR=${DIST_SUBDIR}; \
3329 CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
3330 case $${file} in \
3331 */*) ${MKDIR} $${file%/*}; \
3332 args="-o $${file} $${site}$${file}";; \
3333 *) args=$${site}$${file};; \
3334 esac; \
3335 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3336 continue 2; \
3337 fi \
3338 done; \
3339 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3340 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3341 exit 1; \
3342 fi \
3343 done)
3344 .if defined(PATCHFILES)
3345 @(cd ${_DISTDIR}; \
3346 ${_PATCH_SITES_ENV} ; \
3347 for _file in ${PATCHFILES}; do \
3348 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
3349 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3350 force_fetch=false; \
3351 filebasename=`${BASENAME} $$file`; \
3352 for afile in ${FORCE_FETCH}; do \
3353 afile=`${BASENAME} $$afile`; \
3354 if [ "x$$afile" = "x$$filebasename" ]; then \
3355 force_fetch=true; \
3356 fi; \
3357 done; \
3358 if [ ! -f $$file -a ! -f $$filebasename -o "$$force_fetch" = "true" ]; then \
3359 if [ -L $$file -o -L `${BASENAME} $$file` ]; then \
3360 ${ECHO_MSG} "=> ${_DISTDIR}/$$file is a broken symlink."; \
3361 ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
3362 ${ECHO_MSG} "=> Please correct this problem and try again."; \
3363 exit 1; \
3364 fi ; \
3365 ${ECHO_MSG} "=> $$file doesn't seem to exist in ${_DISTDIR}."; \
3366 if [ ! -z "$$select" ] ; then \
3367 __PATCH_SITES_TMP= ; \
3368 for group in $$select; do \
3369 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
3370 eval ___PATCH_SITES_TMP="\$${_PATCH_SITES_$${group}}" ; \
3371 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
3372 fi \
3373 done; \
3374 ___PATCH_SITES_TMP= ; \
3375 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
3376 else \
3377 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
3378 fi ; \
3379 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP`; do \
3380 ${ECHO_MSG} "=> Attempting to fetch from $${site}."; \
3381 DIR=${DIST_SUBDIR}; \
3382 pattern="$${DIR:+$$DIR/}`${ECHO_CMD} $$file | ${SED} -e 's/\./\\\\./g'`"; \
3383 CKSIZE=`${GREP} "^SIZE ($$pattern)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
3384 case $${file} in \
3385 */*) ${MKDIR} $${file%/*}; \
3386 args="-o $${file} $${site}$${file}";; \
3387 *) args=$${site}$${file};; \
3388 esac; \
3389 if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \
3390 continue 2; \
3391 fi \
3392 done; \
3393 ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
3394 ${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
3395 exit 1; \
3396 fi \
3397 done)
3398 .endif
3399 .endif
3400
3401 # Extract
3402
3403 .if !target(do-extract)
3404 do-extract:
3405 @${RM} -rf ${WRKDIR}
3406 @${MKDIR} ${WRKDIR}
3407 @for file in ${EXTRACT_ONLY}; do \
3408 if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
3409 then \
3410 exit 1; \
3411 fi \
3412 done
3413 .if !defined(EXTRACT_PRESERVE_OWNERSHIP)
3414 @if [ `${ID} -u` = 0 ]; then \
3415 ${CHMOD} -R ug-s ${WRKDIR}; \
3416 ${CHOWN} -R 0:0 ${WRKDIR}; \
3417 fi
3418 .endif
3419 .endif
3420
3421 # Patch
3422
3423 .if !target(patch-dos2unix)
3424 patch-dos2unix:
3425 .if defined(USE_DOS2UNIX)
3426 .if ${USE_DOS2UNIX:U}=="YES"
3427 @${ECHO_MSG} "===> Converting DOS text files to UNIX text files"
3428 @${FIND} ${WRKSRC} -type f -print0 | \
3429 ${XARGS} -0 ${REINPLACE_CMD} -i '' -e 's/
3430 $$//'
3431 .else
3432 .for f in ${USE_DOS2UNIX}
3433 @${ECHO_MSG} "===> Converting DOS text file to UNIX text file: ${f}"
3434 @${REINPLACE_CMD} -i '' -e 's/
3435 $$//' ${WRKSRC}/${f}
3436 .endfor
3437 .endif
3438 .else
3439 @${DO_NADA}
3440 .endif
3441 .endif
3442
3443 .if !target(do-patch)
3444 do-patch:
3445 .if defined(PATCHFILES)
3446 @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
3447 @(cd ${_DISTDIR}; \
3448 for i in ${_PATCHFILES}; do \
3449 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3450 ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
3451 fi; \
3452 case $$i in \
3453 *.Z|*.gz) \
3454 ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
3455 ;; \
3456 *.bz2) \
3457 ${BZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
3458 ;; \
3459 *) \
3460 ${PATCH} ${PATCH_DIST_ARGS} < $$i; \
3461 ;; \
3462 esac; \
3463 done)
3464 .endif
3465 .if defined(EXTRA_PATCHES)
3466 @for i in ${EXTRA_PATCHES}; do \
3467 ${ECHO_MSG} "===> Applying extra patch $$i"; \
3468 ${PATCH} ${PATCH_ARGS} < $$i; \
3469 done
3470 .endif
3471 @if [ -d ${PATCHDIR} ]; then \
3472 if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
3473 ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \
3474 PATCHES_APPLIED="" ; \
3475 for i in ${PATCHDIR}/patch-*; do \
3476 case $$i in \
3477 *.orig|*.rej|*~|*,v) \
3478 ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
3479 ;; \
3480 *) \
3481 if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3482 ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
3483 fi; \
3484 if ${PATCH} ${PATCH_ARGS} < $$i ; then \
3485 PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
3486 else \
3487 ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
3488 if [ x"$$PATCHES_APPLIED" != x"" ]; then \
3489 ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
3490 fi; \
3491 ${FALSE} ; \
3492 fi; \
3493 ;; \
3494 esac; \
3495 done; \
3496 fi; \
3497 fi
3498 .endif
3499
3500 .if !target(run-autotools)
3501 run-autotools:
3502 @${DO_NADA}
3503 .endif
3504
3505 # Configure
3506
3507 .if !target(do-configure)
3508 do-configure:
3509 @if [ -f ${SCRIPTDIR}/configure ]; then \
3510 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
3511 ${SCRIPTDIR}/configure; \
3512 fi
3513 .if defined(GNU_CONFIGURE)
3514 @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess -o -name config.sub \
3515 | ${XARGS} -n 1 ${DIRNAME}); \
3516 for _D in $${CONFIG_GUESS_DIRS}; do \
3517 ${CP} -f ${TEMPLATES}/config.guess $${_D}/config.guess; \
3518 ${CHMOD} a+rx $${_D}/config.guess; \
3519 ${CP} -f ${TEMPLATES}/config.sub $${_D}/config.sub; \
3520 ${CHMOD} a+rx $${_D}/config.sub; \
3521 done
3522 .endif
3523 .if defined(HAS_CONFIGURE)
3524 @(cd ${CONFIGURE_WRKSRC} && \
3525 if ! ${SETENV} CC="${CC}" CXX="${CXX}" \
3526 CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
3527 INSTALL="/usr/bin/install -c ${_BINOWNGRP}" \
3528 INSTALL_DATA="${INSTALL_DATA}" \
3529 INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
3530 INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
3531 ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}; then \
3532 ${ECHO_MSG} "===> Script \"${CONFIGURE_SCRIPT}\" failed unexpectedly."; \
3533 (${ECHO_MSG} ${CONFIGURE_FAIL_MESSAGE}) | ${FMT} 75 79 ; \
3534 ${FALSE}; \
3535 fi)
3536 .endif
3537 .if defined(PERL_CONFIGURE)
3538 @cd ${CONFIGURE_WRKSRC} && \
3539 ${SETENV} ${CONFIGURE_ENV} \
3540 ${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
3541 .if !defined(PERL_MODBUILD)
3542 @cd ${CONFIGURE_WRKSRC} && \
3543 ${PERL5} -pi -e 's/ doc_(perl|site|\$$\(INSTALLDIRS\))_install$$//' Makefile
3544 .if ${PERL_LEVEL} <= 500503
3545 @cd ${CONFIGURE_WRKSRC} && \
3546 ${PERL5} -pi -e 's/^(INSTALLSITELIB|INSTALLSITEARCH|SITELIBEXP|SITEARCHEXP|INSTALLMAN1DIR|INSTALLMAN3DIR) = \/usr\/local/$$1 = \$$(PREFIX)/' Makefile
3547 .endif
3548 .endif
3549 .endif
3550 .if defined(USE_IMAKE)
3551 @(cd ${CONFIGURE_WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF})
3552 .endif
3553 .endif
3554
3555 # Build
3556
3557 .if !target(do-build)
3558 do-build:
3559 .if defined(USE_GMAKE)
3560 @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
3561 .else
3562 .if defined(PERL_MODBUILD)
3563 @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PERL5} ${PL_BUILD} ${MAKE_ARGS} ${ALL_TARGET})
3564 .else
3565 @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
3566 .endif
3567 .endif
3568 .endif
3569
3570 # Check conflicts
3571
3572 .if !target(check-conflicts)
3573 check-conflicts:
3574 .if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
3575 @found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \
3576 conflicts_with=; \
3577 for entry in $${found}; do \
3578 if ${PKG_INFO} -e $${entry} ; then \
3579 prfx=`${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \
3580 orgn=`${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \
3581 if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \
3582 conflicts_with="$${conflicts_with} $${entry}"; \
3583 fi; \
3584 fi; \
3585 done; \
3586 if [ -n "$${conflicts_with}" ]; then \
3587 ${ECHO_MSG}; \
3588 if [ -z "${DESTDIR}" ] ; then \
3589 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \
3590 else \
3591 ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s) in ${DESTDIR}: "; \
3592 fi; \
3593 for entry in $${conflicts_with}; do \
3594 ${ECHO_MSG} " $${entry}"; \
3595 done; \
3596 ${ECHO_MSG}; \
3597 ${ECHO_MSG} " They install files into the same place."; \
3598 ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \
3599 exit 1; \
3600 fi
3601 .endif # CONFLICTS
3602 .endif
3603
3604 #
3605 # Fake
3606 #
3607
3608 .if !target(fake-dir)
3609 fake-dir:
3610 @${INSTALL} -d -m 755 -o root -g wheel ${_ABS_FAKE_INSTALLDIR}${PREFIX}
3611 @${MTREE_CMD} ${MTREE_ARGS} ${_ABS_FAKE_INSTALLDIR}${PREFIX} >/dev/null
3612 . if defined(USE_LINUX)
3613 @${MTREE_CMD} ${MTREE_LINUX_ARGS} ${_ABS_FAKE_INSTALLDIR}
3614 . endif
3615 .endif
3616
3617
3618 .if !target(fake-install)
3619 fake-install:
3620 . if target(pre-install)
3621 @cd ${.CURDIR} && exec ${MAKE} pre-install ${_FAKE_SETUP}
3622 . endif
3623 . if target(do-install)
3624 @cd ${.CURDIR} && exec ${MAKE} do-install ${_FAKE_SETUP}
3625 . else
3626 # Handle Module::Build
3627 . if defined(PERL_MODBUILD)
3628 @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PERL5}\
3629 ${PL_BUILD} ${MAKE_ARGS} --destdir ${_ABS_FAKE_INSTALLDIR} ${FAKE_TARGET}
3630 . else
3631 # Normal builds.
3632 cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${_FAKE_SETUP}\
3633 ${_MAKE_CMD} ${FAKE_FLAGS} -f ${MAKEFILE} ${_FAKE_MAKEARGS} ${FAKE_TARGET};
3634 . if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
3635 @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${_FAKE_SETUP}\
3636 ${_MAKE_CMD} ${FAKE_FLAGS} -f ${MAKEFILE} ${_FAKE_MAKEARGS} install.man
3637 . endif
3638 . endif
3639 . endif
3640 . if target(post-install)
3641 @cd ${.CURDIR} && exec ${MAKE} post-install ${_FAKE_SETUP}
3642 . endif
3643 .endif
3644
3645
3646 #
3647 # Package
3648 #
3649
3650 .if !target(do-package)
3651 do-package: ${TMPPLIST}
3652 @if ! ${MKDIR} -p ${PKGREPOSITORY}; then \
3653 ${ECHO_MSG} "=> Can't create directory ${PKGREPOSITORY}."; \
3654 exit 1; \
3655 fi;
3656 @__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \
3657 _LATE_PKG_ARGS=""; \
3658 if [ -f ${PKGINSTALL} ]; then \
3659 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -i ${PKGINSTALL}"; \
3660 fi; \
3661 if [ -f ${PKGDEINSTALL} ]; then \
3662 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -k ${PKGDEINSTALL}"; \
3663 fi; \
3664 if [ -f ${PKGREQ} ]; then \
3665 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -r ${PKGREQ}"; \
3666 fi; \
3667 if [ -f ${PKGMESSAGE} ]; then \
3668 _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -D ${PKGMESSAGE}"; \
3669 fi; \
3670 if ${PKG_CMD} -v ${PKG_ARGS} ${PKGFILE} >/dev/null; then \
3671 cd ${.CURDIR} && eval ${MAKE} $${__softMAKEFLAGS} package-links; \
3672 else \
3673 cd ${.CURDIR} && eval ${MAKE} $${__softMAKEFLAGS} delete-package; \
3674 exit 1; \
3675 fi
3676 .endif
3677
3678 # Some support rules for do-package
3679
3680 .if !target(package-links)
3681 package-links: delete-package-links
3682 @for cat in ${CATEGORIES}; do \
3683 if [ ! -d ${PACKAGES}/$$cat ]; then \
3684 if ! ${MKDIR} ${PACKAGES}/$$cat; then \
3685 ${ECHO_MSG} "=> Can't create directory ${PACKAGES}/$$cat."; \
3686 exit 1; \
3687 fi; \
3688 fi; \
3689 ${ECHO_MSG} "Link to ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}"; \
3690 ${LN} -sf ${PKGFILE} ${PACKAGES}/$$cat; \
3691 done
3692 .if !defined(NO_LATEST_LINK)
3693 @if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
3694 if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \
3695 ${ECHO_MSG} "=> Can't create directory ${PKGLATESTREPOSITORY}."; \
3696 exit 1; \
3697 fi; \
3698 fi
3699 @${ECHO_MSG} "Link to ${PKGLATESTREPOSITORY}/${PKGNAME}${PKG_SUFX}"
3700 @${LN} -s ${PKGFILE} ${PKGLATESTFILE}
3701 .endif
3702 .endif
3703
3704 .if !target(delete-package-links)
3705 delete-package-links:
3706 @for cat in ${CATEGORIES}; do \
3707 ${RM} -f ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
3708 done
3709 .if !defined(NO_LATEST_LINK)
3710 @${RM} -f ${PKGLATESTFILE}
3711 .endif
3712 .endif
3713
3714 .if !target(delete-package)
3715 delete-package: delete-package-links
3716 @${RM} -f ${PKGFILE}
3717 .endif
3718
3719 .if !target(delete-package-links-list)
3720 delete-package-links-list:
3721 @for cat in ${CATEGORIES}; do \
3722 ${ECHO_CMD} ${RM} -f ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
3723 done
3724 .if !defined(NO_LATEST_LINK)
3725 @${ECHO_CMD} ${RM} -f ${PKGLATESTFILE}
3726 .endif
3727 .endif
3728
3729 .if !target(delete-package-list)
3730 delete-package-list: delete-package-links-list
3731 @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})"
3732 .endif
3733
3734
3735 #
3736 # This is the "real" install. Really. Not kidding.
3737 #
3738
3739 .if !target(install-package)
3740 install-package:
3741 . if defined(DESTDIR)
3742 @${CP} ${PKGFILE} ${DISTDIR}${PKGFILE}
3743 . endif
3744 # $PKG_ADD calls chroot if DESTDIR is set.
3745 @${SETENV} PKG_PATH=${PKGREPOSITORY} ${PKG_ADD} ${PKGNAME}
3746 .endif
3747
3748
3749 # Utility targets follow
3750
3751 .if !target(check-already-installed)
3752 check-already-installed:
3753 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
3754 .if !defined(DESTDIR)
3755 @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed"
3756 .else
3757 @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed in ${DESTDIR}"
3758 .endif
3759 @${MKDIR} ${PKG_DBDIR}; \
3760 already_installed=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
3761 if [ -n "$${already_installed}" ]; then \
3762 for p in $${already_installed}; do \
3763 prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \
3764 if [ "x${PREFIX}" = "x$${prfx}" ]; then \
3765 df=`${PKG_INFO} -q -f $${p} 2> /dev/null | ${GREP} -v "^@" | ${COMM} -12 - ${TMPPLIST}`; \
3766 if [ -n "$${df}" ]; then \
3767 found_package=$${p}; \
3768 break; \
3769 fi; \
3770 fi; \
3771 done; \
3772 fi
3773 @if [ -d ${PKG_DBDIR}/${PKGNAME} -o -n "$${found_package}" ]; then \
3774 if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \
3775 if [ -z "${DESTDIR}" ] ; then \
3776 ${ECHO_CMD} "===> ${PKGNAME} is already installed"; \
3777 else \
3778 ${ECHO_MSG} "===> ${PKGNAME} is already installed in ${DESTDIR}"; \
3779 fi; \
3780 else \
3781 if [ -z "${DESTDIR}" ] ; then \
3782 ${ECHO_CMD} "===> An older version of ${PKGORIGIN} is already installed ($${found_package})"; \
3783 else \
3784 ${ECHO_MSG} "===> An older version of ${PKGORIGIN} is already installed in ${DESTDIR} ($${found_package})"; \
3785 fi; \
3786 fi; \
3787 ${ECHO_MSG} " You may wish to \`\`make deinstall'' and install this port again"; \
3788 ${ECHO_MSG} " by \`\`make reinstall'' to upgrade it properly."; \
3789 ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGORIGIN}"; \
3790 ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3791 ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
3792 exit 1; \
3793 fi
3794 .else
3795 @${DO_NADA}
3796 .endif
3797 .endif
3798
3799 .if !target(check-umask)
3800 check-umask:
3801 @if [ `${SH} -c umask` != 0022 ]; then \
3802 ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
3803 ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
3804 ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
3805 fi
3806 .endif
3807
3808 .if !target(install-mtree)
3809 install-mtree:
3810 @${MKDIR} ${TARGETDIR}
3811 @if [ `${ID} -u` != 0 ]; then \
3812 if [ -w ${TARGETDIR}/ ]; then \
3813 ${ECHO_MSG} "Warning: not superuser, you may get some errors during installation."; \
3814 else \
3815 ${ECHO_MSG} "Error: ${TARGETDIR}/ not writable."; \
3816 ${FALSE}; \
3817 fi; \
3818 fi
3819 .if !defined(NO_MTREE)
3820 @if [ `${ID} -u` = 0 ]; then \
3821 if [ ! -f ${MTREE_FILE} ]; then \
3822 ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
3823 ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
3824 exit 1; \
3825 else \
3826 ${MTREE_CMD} ${MTREE_ARGS} ${TARGETDIR}/ >/dev/null; \
3827 if [ ${MTREE_FILE} = "/etc/mtree/BSD.local.dist" ]; then \
3828 cd ${TARGETDIR}/share/nls; \
3829 ${LN} -shf C POSIX; \
3830 ${LN} -shf C en_US.US-ASCII; \
3831 fi; \
3832 fi; \
3833 else \
3834 ${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
3835 ${ECHO_MSG} "You may want to become root and try again to ensure correct permissions."; \
3836 fi
3837 .endif
3838 .endif
3839
3840 .if !target(install-ldconfig-file)
3841 install-ldconfig-file:
3842 .if defined(USE_LDCONFIG) || defined(USE_LDCONFIG32) || defined(INSTALLS_SHLIB)
3843 .if defined(USE_LDCONFIG)
3844 .if !defined(INSTALL_AS_USER)
3845 .if !defined(DESTDIR)
3846 @${ECHO_MSG} "===> Running ldconfig"
3847 ${LDCONFIG} -m ${USE_LDCONFIG}
3848 .else
3849 @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR}"
3850 ${CHROOT} ${DESTDIR} ${LDCONFIG} -m ${USE_LDCONFIG}
3851 .endif
3852 .else
3853 .if !defined(DESTDIR)
3854 @${ECHO_MSG} "===> Running ldconfig (errors are ignored)"
3855 -${LDCONFIG} -m ${USE_LDCONFIG}
3856 .else
3857 @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR} (errors are ignored)"
3858 ${CHROOT} ${DESTDIR} -${LDCONFIG} -m ${USE_LDCONFIG}
3859 .endif
3860 .endif
3861 .if ${USE_LDCONFIG} != "${PREFIX}/lib"
3862 @${ECHO_MSG} "===> Installing ldconfig configuration file"
3863 .if defined(NO_LDCONFIG_MTREE)
3864 @${MKDIR} ${PREFIX}/${LDCONFIG_DIR}
3865 .endif
3866 @${ECHO_CMD} ${USE_LDCONFIG} | ${TR} ' ' '\n' \
3867 > ${PREFIX}/${LDCONFIG_DIR}/${UNIQUENAME}
3868 @${ECHO_CMD} ${LDCONFIG_DIR}/${UNIQUENAME} >> ${TMPPLIST}
3869 .if defined(NO_LDCONFIG_MTREE)
3870 @${ECHO_CMD} "@unexec rmdir ${LDCONFIG_DIR} >/dev/null 2>&1 || true" >> ${TMPPLIST}
3871 .endif
3872 .endif
3873 .endif
3874 .if defined(USE_LDCONFIG32)
3875 .if !defined(INSTALL_AS_USER)
3876 .if !defined(DESTDIR)
3877 @${ECHO_MSG} "===> Running ldconfig"
3878 ${LDCONFIG} -32 -m ${USE_LDCONFIG32}
3879 .else
3880 @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR}"
3881 ${CHROOT} ${DESTDIR} ${LDCONFIG} -32 -m ${USE_LDCONFIG32}
3882 .endif
3883 .else
3884 .if !defined(DESTDIR)
3885 @${ECHO_MSG} "===> Running ldconfig (errors are ignored)"
3886 -${LDCONFIG} -32 -m ${USE_LDCONFIG32}
3887 .else
3888 @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR} (errors are ignored)"
3889 ${CHROOT} ${DESTDIR} -${LDCONFIG} -32 -m ${USE_LDCONFIG32}
3890 .endif
3891 .endif
3892 @${ECHO_MSG} "===> Installing 32-bit ldconfig configuration file"
3893 .if defined(NO_LDCONFIG_MTREE)
3894 @${MKDIR} ${PREFIX}/${LDCONFIG_32DIR}
3895 .endif
3896 @${ECHO_CMD} ${USE_LDCONFIG32} | ${TR} ' ' '\n' \
3897 > ${PREFIX}/${LDCONFIG32_DIR}/${UNIQUENAME}
3898 @${ECHO_CMD} ${LDCONFIG32_DIR}/${UNIQUENAME} >> ${TMPPLIST}
3899 .if defined(NO_LDCONFIG_MTREE)
3900 @${ECHO_CMD} "@unexec rmdir ${LDCONFIG32_DIR} >/dev/null 2>&1" >> ${TMPPLIST}
3901 .endif
3902 .endif
3903 # This can be removed once all ports have been converted to USE_LDCONFIG.
3904 .if defined(INSTALLS_SHLIB)
3905 .if !defined(INSTALL_AS_USER)
3906 .if !defined(DESTDIR)
3907 @${ECHO_MSG} "===> Running ldconfig"
3908 .else
3909 @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR}"
3910 .endif
3911 ${LDCONFIG_CMD}
3912 .else
3913 .if !defined(DESTDIR)
3914 @${ECHO_MSG} "===> Running ldconfig (errors are ignored)"
3915 .else
3916 @${ECHO_MSG} "===> Running ldconfig in ${DESTDIR} (errors are ignored)"
3917 .endif
3918 -${LDCONFIG_CMD}
3919 .endif
3920 .endif
3921 .else
3922 @${DO_NADA}
3923 .endif
3924 .endif
3925
3926 .if !target(security-check)
3927 .if !defined(OLD_SECURITY_CHECK)
3928
3929 security-check:
3930 # Scan PLIST for:
3931 # 1. setugid files
3932 # 2. accept()/recvfrom() which indicates network listening capability
3933 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
3934 # 4. startup scripts, in conjunction with 2.
3935 # 5. world-writable files/dirs
3936 #
3937 -@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable ${WRKDIR}/.PLIST.objdump; \
3938 ${AWK} -v prefix='${PREFIX}' ' \
3939 match($$0, /^@cwd /) { prefix = substr($$0, RSTART + RLENGTH); if (prefix == "/") prefix=""; next; } \
3940 /^@/ { next; } \
3941 /^\// { print; next; } \
3942 { print prefix "/" $$0; } \
3943 ' ${TMPPLIST} > ${WRKDIR}/.PLIST.flattened; \
3944 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3945 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) 2> /dev/null > ${WRKDIR}/.PLIST.setuid; \
3946 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3947 | ${XARGS} -0 -J % ${FIND} % -prune -perm -0002 \! -type l 2> /dev/null > ${WRKDIR}/.PLIST.writable; \
3948 ${TR} '\n' '\0' < ${WRKDIR}/.PLIST.flattened \
3949 | ${XARGS} -0 -J % ${FIND} % -prune ! -type l -type f -print0 2> /dev/null \
3950 | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \
3951 if \
3952 ! ${AWK} -v audit="$${PORTS_AUDIT}" -v destdir="${DESTDIR}" -f ${PORTSDIR}/Tools/scripts/security-check.awk \
3953 ${WRKDIR}/.PLIST.flattened ${WRKDIR}/.PLIST.objdump ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.writable; \
3954 then \
3955 www_site=$$(cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} www-site); \
3956 if [ ! -z "$${www_site}" ]; then \
3957 ${ECHO_MSG}; \
3958 ${ECHO_MSG} " For more information, and contact details about the security"; \
3959 ${ECHO_MSG} " status of this software, see the following webpage: "; \
3960 ${ECHO_MSG} "$${www_site}"; \
3961 fi; \
3962 fi
3963
3964
3965 .else # i.e. defined(OLD_SECURITY_CHECK)
3966
3967 security-check:
3968 # Scan PLIST for:
3969 # 1. setugid files
3970 # 2. accept()/recvfrom() which indicates network listening capability
3971 # 3. insecure functions (gets/mktemp/tempnam/[XXX])
3972 # 4. startup scripts, in conjunction with 2.
3973 # 5. world-writable files/dirs
3974 #
3975 -@${RM} -f ${WRKDIR}/.PLIST.setuid ${WRKDIR}/.PLIST.stupid \
3976 ${WRKDIR}/.PLIST.network ${WRKDIR}/.PLIST.writable; \
3977 if [ -n "$$PORTS_AUDIT" ]; then \
3978 stupid_functions_regexp=' (gets|mktemp|tempnam|tmpnam|strcpy|strcat|sprintf)$$'; \
3979 else \
3980 stupid_functions_regexp=' (gets|mktemp|tempnam|tmpnam)$$'; \
3981 fi; \
3982 for i in `${GREP} -v '^@' ${TMPPLIST}`; do \
3983 if [ ! -L "${PREFIX}/$$i" -a -f "${PREFIX}/$$i" ]; then \
3984 ${OBJDUMP} -R ${PREFIX}/$$i > \
3985 ${WRKDIR}/.PLIST.objdump 2> /dev/null; \
3986 if [ -s ${WRKDIR}/.PLIST.objdump ] ; then \
3987 ${EGREP} " $$stupid_functions_regexp" \
3988 ${WRKDIR}/.PLIST.objdump | ${AWK} '{print " " $$3}' | ${TR} -d '\n' \
3989 > ${WRKDIR}/.PLIST.stupid; \
3990 if [ -n "`${EGREP} ' (accept|recvfrom)$$' ${WRKDIR}/.PLIST.objdump`" ] ; then \
3991 if [ -s ${WRKDIR}/.PLIST.stupid ]; then \
3992 ${ECHO_MSG} -n "${PREFIX}/$$i (USES POSSIBLY INSECURE FUNCTIONS:" >> ${WRKDIR}/.PLIST.network; \
3993 ${CAT} ${WRKDIR}/.PLIST.stupid >> ${WRKDIR}/.PLIST.network; \
3994 ${ECHO_CMD} ")" >> ${WRKDIR}/.PLIST.network; \
3995 else \
3996 ${ECHO_CMD} ${PREFIX}/$$i >> ${WRKDIR}/.PLIST.network; \
3997 fi; \
3998 fi; \
3999 fi; \
4000 if [ -n "`${FIND} ${PREFIX}/$$i -prune \( -perm -4000 -o -perm -2000 \) \( -perm -0010 -o -perm -0001 \) 2>/dev/null`" ]; then \
4001 if [ -s ${WRKDIR}/.PLIST.stupid ]; then \
4002 ${ECHO_MSG} -n "${PREFIX}/$$i (USES POSSIBLY INSECURE FUNCTIONS:" >> ${WRKDIR}/.PLIST.setuid; \
4003 ${CAT} ${WRKDIR}/.PLIST.stupid >> ${WRKDIR}/.PLIST.setuid; \
4004 ${ECHO_CMD} ")" >> ${WRKDIR}/.PLIST.setuid; \
4005 else \
4006 ${ECHO_CMD} ${PREFIX}/$$i >> ${WRKDIR}/.PLIST.setuid; \
4007 fi; \
4008 fi; \
4009 fi; \
4010 if [ ! -L "${PREFIX}/$$i" ]; then \
4011 if [ -n "`${FIND} ${PREFIX}/$$i -prune -perm -0002 \! -type l 2>/dev/null`" ]; then \
4012 ${ECHO_CMD} ${PREFIX}/$$i >> ${WRKDIR}/.PLIST.writable; \
4013 fi; \
4014 fi; \
4015 done; \
4016 ${GREP} '^etc/rc.d/' ${TMPPLIST} > ${WRKDIR}/.PLIST.startup; \
4017 if [ -s ${WRKDIR}/.PLIST.setuid -o -s ${WRKDIR}/.PLIST.network -o -s ${WRKDIR}/.PLIST.writable ]; then \
4018 if [ -n "$$PORTS_AUDIT" ]; then \
4019 if [ -z "${DESTDIR}" ] ; then \
4020 ${ECHO_MSG} "===> SECURITY REPORT (PARANOID MODE): "; \
4021 else \
4022 ${ECHO_MSG} "===> SECURITY REPORT FOR ${DESTDIR} (PARANOID MODE): "; \
4023 fi; \
4024 else \
4025 if [ -z "${DESTDIR}" ] ; then \
4026 ${ECHO_MSG} "===> SECURITY REPORT: "; \
4027 else \
4028 ${ECHO_MSG} "===> SECURITY REPORT FOR ${DESTDIR}: "; \
4029 fi; \
4030 fi; \
4031 if [ -s ${WRKDIR}/.PLIST.setuid ] ; then \
4032 if [ -z "${DESTDIR}" ] ; then \
4033 ${ECHO_MSG} " This port has installed the following binaries,"; \
4034 else \
4035 ${ECHO_MSG} " This port has installed the following binaries into ${DESTDIR},"; \
4036 fi; \
4037 ${ECHO_MSG} " which execute with increased privileges."; \
4038 ${CAT} ${WRKDIR}/.PLIST.setuid; \
4039 ${ECHO_MSG}; \
4040 fi; \
4041 if [ -s ${WRKDIR}/.PLIST.network ] ; then \
4042 if [ -z "${DESTDIR}" ] ; then \
4043 ${ECHO_MSG} " This port has installed the following files, which may act as network"; \
4044 ${ECHO_MSG} " servers and may therefore pose a remote security risk to the system."; \
4045 else \
4046 ${ECHO_MSG} " This port has installed the following files into ${DESTDIR}, which may"; \
4047 ${ECHO_MSG} " act as network servers and may therefore pose a remote security risk to"; \
4048 ${ECHO_MSG} " the system."; \
4049 fi; \
4050 ${CAT} ${WRKDIR}/.PLIST.network; \
4051 ${ECHO_MSG}; \
4052 if [ -s ${WRKDIR}/.PLIST.startup ] ; then \
4053 if [ -z "${DESTDIR}" ] ; then \
4054 ${ECHO_MSG} " This port has installed the following startup scripts,"; \
4055 else \
4056 ${ECHO_MSG} " This port has installed the following startup scripts into ${DESTDIR},"; \
4057 fi; \
4058 ${ECHO_MSG} " which may cause these network services to be started at boot time."; \
4059 ${SED} s,^,${PREFIX}/, < ${WRKDIR}/.PLIST.startup; \
4060 ${ECHO_MSG}; \
4061 fi; \
4062 fi; \
4063 if [ -s ${WRKDIR}/.PLIST.writable ] ; then \
4064 if [ -z "${DESTDIR}" ] ; then \
4065 ${ECHO_MSG} " This port has installed the following world-writable files/directories."; \
4066 else \
4067 ${ECHO_MSG} " This port has installed the following world-writable files/directories"; \
4068 ${ECHO_MSG} " into ${DESTDIR}."; \
4069 fi; \
4070 ${CAT} ${WRKDIR}/.PLIST.writable; \
4071 ${ECHO_MSG}; \
4072 fi; \
4073 ${ECHO_MSG} " If there are vulnerabilities in these programs there may be a security"; \
4074 ${ECHO_MSG} " risk to the system. The FreeBSD Project makes no guarantee about the"; \
4075 ${ECHO_MSG} " security of ports included in the Ports Collection."; \
4076 ${ECHO_MSG} " Please type 'make deinstall' to deinstall the port if this is a concern."; \
4077 www_site=$$(cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} www-site); \
4078 if [ ! -z "$${www_site}" ]; then \
4079 ${ECHO_MSG}; \
4080 ${ECHO_MSG} " For more information, and contact details about the security"; \
4081 ${ECHO_MSG} " status of this software, see the following webpage: "; \
4082 ${ECHO_MSG} "$${www_site}"; \
4083 fi; \
4084 fi
4085 .endif # !defined(OLD_SECURITY_CHECK)
4086 .endif
4087
4088 ################################################################
4089 # Skeleton targets start here
4090 #
4091 # You shouldn't have to change these. Either add the pre-* or
4092 # post-* targets/scripts or redefine the do-* targets. These
4093 # targets don't do anything other than checking for cookies and
4094 # call the necessary targets/scripts.
4095 ################################################################
4096
4097 # Please note that the order of the following targets is important, and
4098 # should not be modified.
4099
4100 _SANITY_SEQ= pre-everything check-makefile check-categories \
4101 check-makevars check-desktop-entries check-depends \
4102 check-deprecated check-vulnerable buildanyway-message \
4103 options-message
4104 _FETCH_DEP= check-sanity
4105 _FETCH_SEQ= fetch-depends pre-fetch pre-fetch-script \
4106 do-fetch post-fetch post-fetch-script
4107 _EXTRACT_DEP= fetch
4108 _EXTRACT_SEQ= extract-message checksum extract-depends pre-extract \
4109 pre-extract-script do-extract \
4110 post-extract post-extract-script
4111 _PATCH_DEP= extract
4112 _PATCH_SEQ= patch-message patch-depends patch-dos2unix pre-patch \
4113 pre-patch-script do-patch post-patch post-patch-script
4114 _CONFIGURE_DEP= patch
4115 _CONFIGURE_SEQ= build-depends lib-depends misc-depends configure-message \
4116 pre-configure pre-configure-script \
4117 run-autotools do-configure post-configure post-configure-script
4118 _BUILD_DEP= configure
4119 _BUILD_SEQ= build-message pre-build pre-build-script do-build \
4120 post-build post-build-script
4121
4122 _FAKE_DEP= build
4123 _FAKE_SEQ= fake-message fake-dir pre-fake fake-install post-fake compress-man
4124
4125 _PACKAGE_DEP= fake
4126 _PACKAGE_SEQ= package-message pre-package pre-package-script generate-plist add-plist-info\
4127 add-plist-docs add-plist-post do-package post-package-script
4128
4129 _INSTALL_DEP= package
4130 # Not sure how we want to handle sudo/su. Will figure out later - triv.
4131 _INSTALL_SEQ= install-message check-conflicts run-depends lib-depends\
4132 check-already-installed install-package done-message
4133
4134
4135 .if !target(check-sanity)
4136 check-sanity: ${_SANITY_SEQ}
4137 .endif
4138
4139 # XXX MCL might need to move in loop below?
4140 .if !target(fetch)
4141 fetch: ${_FETCH_DEP} ${_FETCH_SEQ}
4142 .endif
4143
4144 # Main logic. The loop generates 6 main targets and using cookies
4145 # ensures that those already completed are skipped.
4146
4147 .for target in extract patch configure build fake package install
4148
4149 .if !target(${target}) && defined(_OPTIONS_OK)
4150 ${target}: ${${target:U}_COOKIE}
4151 .elif !target(${target})
4152 ${target}: config
4153 @cd ${.CURDIR} && ${MAKE} CONFIG_DONE=1 ${__softMAKEFLAGS} ${${target:U}_COOKIE}
4154 .elif target(${target}) && defined(IGNORE)
4155 .endif
4156
4157 .if !exists(${${target:U}_COOKIE})
4158
4159 .if ${UID} != 0 && defined(_${target:U}_SUSEQ) && !defined(INSTALL_AS_USER)
4160 .if defined(USE_SUBMAKE)
4161 ${${target:U}_COOKIE}: ${_${target:U}_DEP}
4162 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${_${target:U}_SEQ}
4163 .else
4164 ${${target:U}_COOKIE}: ${_${target:U}_DEP} ${_${target:U}_SEQ}
4165 .endif
4166 @${ECHO_MSG} "===> Switching to root credentials for '${target}' target"
4167 @cd ${.CURDIR} && \
4168 ${SU_CMD} "${MAKE} ${__softMAKEFLAGS} ${_${target:U}_SUSEQ}"
4169 @${ECHO_MSG} "===> Returning to user credentials"
4170 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
4171 .elif defined(USE_SUBMAKE)
4172 ${${target:U}_COOKIE}: ${_${target:U}_DEP}
4173 @cd ${.CURDIR} && \
4174 ${MAKE} ${__softMAKEFLAGS} ${_${target:U}_SEQ} ${_${target:U}_SUSEQ}
4175 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
4176 .else
4177 ${${target:U}_COOKIE}: ${_${target:U}_DEP} ${_${target:U}_SEQ} ${_${target:U}_SUSEQ}
4178 @${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
4179 .endif
4180
4181 .else
4182 ${${target:U}_COOKIE}::
4183 @if [ -e ${.TARGET} ]; then \
4184 ${DO_NADA}; \
4185 else \
4186 cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.TARGET}; \
4187 fi
4188 .endif
4189
4190 .endfor
4191
4192 # Enforce order for -jN builds
4193
4194 .ORDER: ${_SANITY_SEQ}
4195 .ORDER: ${_FETCH_DEP} ${_FETCH_SEQ}
4196 .ORDER: ${_EXTRACT_DEP} ${_EXTRACT_SEQ}
4197 .ORDER: ${_PATCH_DEP} ${_PATCH_SEQ}
4198 .ORDER: ${_CONFIGURE_DEP} ${_CONFIGURE_SEQ}
4199 .ORDER: ${_BUILD_DEP} ${_BUILD_SEQ}
4200 .ORDER: ${_FAKE_DEP} ${_FAKE_SEQ}
4201 .ORDER: ${_INSTALL_DEP} ${_INSTALL_SEQ}
4202 .ORDER: ${_PACKAGE_DEP} ${_PACKAGE_SEQ}
4203
4204 extract-message:
4205 @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
4206 patch-message:
4207 @${ECHO_MSG} "===> Patching for ${PKGNAME}"
4208 configure-message:
4209 @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
4210 build-message:
4211 @${ECHO_MSG} "===> Building for ${PKGNAME}"
4212 fake-message:
4213 @${ECHO_MSG} "===> Faking install for ${PKGNAME}"
4214 install-message:
4215 .if !defined(DESTDIR)
4216 @${ECHO_MSG} "===> Installing ${PKGFILE}"
4217 .else
4218 @${ECHO_MSG} "===> Installing ${PKGFILE} into ${DESTDIR}"
4219 .endif
4220 package-message:
4221 @${ECHO_MSG} "===> Building package for ${PKGNAME}"
4222 done-message:
4223 @${ECHO_MSG} "===> Done."
4224
4225
4226 # Empty pre-* and post-* targets
4227
4228 .for stage in pre post
4229 .for name in check-sanity fetch extract patch configure build fake package install
4230
4231 .if !target(${stage}-${name})
4232 ${stage}-${name}:
4233 @${DO_NADA}
4234 .endif
4235
4236 .if !target(${stage}-${name}-script)
4237 ${stage}-${name}-script:
4238 @if [ -f ${SCRIPTDIR}/${.TARGET:S/-script$//} ]; then \
4239 cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
4240 ${SCRIPTDIR}/${.TARGET:S/-script$//}; \
4241 fi
4242 .endif
4243
4244 .endfor
4245 .endfor
4246
4247 # Special cases for su
4248 .if !target(pre-su-install)
4249 pre-su-install:
4250 @${DO_NADA}
4251 .endif
4252
4253 .if !target(pre-su-install-script)
4254 pre-su-install-script:
4255 @${DO_NADA}
4256 .endif
4257
4258
4259 .if !target(pretty-print-www-site)
4260 pretty-print-www-site:
4261 @www_site=$$(cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} www-site); \
4262 if [ -n "$${www_site}" ]; then \
4263 ${ECHO_MSG} -n " and/or visit the "; \
4264 ${ECHO_MSG} -n "<a href=\"$${www_site}\">web site</a>"; \
4265 ${ECHO_MSG} " for futher informations"; \
4266 fi
4267 .endif
4268
4269 ################################################################
4270 # Some more targets supplied for users' convenience
4271 ################################################################
4272
4273 # Checkpatch
4274 #
4275 # Special target to verify patches
4276
4277 .if !target(checkpatch)
4278 checkpatch:
4279 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} PATCH_CHECK_ONLY=yes ${_PATCH_DEP} ${_PATCH_SEQ}
4280 .endif
4281
4282 # Reinstall
4283 #
4284 # Special target to re-run install
4285
4286 .if !target(reinstall)
4287 reinstall:
4288 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4289 @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} install
4290 .endif
4291
4292 # Deinstall
4293 #
4294 # Special target to remove installation
4295
4296 .if !target(deinstall)
4297 deinstall:
4298 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
4299 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4300 @cd ${.CURDIR} && \
4301 ${SU_CMD} "${MAKE} ${__softMAKEFLAGS} ${.TARGET}"
4302 @${ECHO_MSG} "===> Returning to user credentials"
4303 .else
4304 .if !defined(DESTDIR)
4305 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
4306 .else
4307 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN} from ${DESTDIR}"
4308 .endif
4309 @found_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
4310 for p in $${found_names}; do \
4311 check_name=`${ECHO_CMD} $${p} | ${SED} -e 's/-[^-]*$$//'`; \
4312 if [ "$${check_name}" = "${PKGBASE}" ]; then \
4313 prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \
4314 if [ "x${PREFIX}" = "x$${prfx}" ]; then \
4315 if [ -z "${DESTDIR}" ] ; then \
4316 ${ECHO_MSG} "===> Deinstalling $${p}"; \
4317 else \
4318 ${ECHO_MSG} "===> Deinstalling $${p} from ${DESTDIR}"; \
4319 fi; \
4320 ${PKG_DELETE} -f $${p}; \
4321 else \
4322 ${ECHO_MSG} "===> $${p} has a different PREFIX: $${prfx}, skipping"; \
4323 fi; \
4324 fi; \
4325 done; \
4326 if [ -z "$${found_names}" ]; then \
4327 if [ -z "${DESTDIR}" ] ; then \
4328 ${ECHO_MSG} "===> ${PKGBASE} not installed, skipping"; \
4329 else \
4330 ${ECHO_MSG} "===> ${PKGBASE} not installed in ${DESTDIR}, skipping"; \
4331 fi; \
4332 fi
4333 @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4334 .endif
4335 .endif
4336
4337 # Deinstall-all
4338 #
4339 # Special target to remove installation of all ports of the same origin
4340
4341 .if !target(deinstall-all)
4342 deinstall-all:
4343 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
4344 @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target"
4345 @cd ${.CURDIR} && \
4346 ${SU_CMD} "${MAKE} ${__softMAKEFLAGS} ${.TARGET}"
4347 @${ECHO_MSG} "===> Returning to user credentials"
4348 .else
4349 .if !defined(DESTDIR)
4350 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}"
4351 .else
4352 @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN} from ${DESTDIR}"
4353 .endif
4354 @deinstall_names=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
4355 if [ -n "$${deinstall_names}" ]; then \
4356 for d in $${deinstall_names}; do \
4357 if [ -z "${DESTDIR}" ] ; then \
4358 ${ECHO_MSG} "===> Deinstalling $${d}"; \
4359 else \
4360 ${ECHO_MSG} "===> Deinstalling $${d} from ${DESTDIR}"; \
4361 fi; \
4362 ${PKG_DELETE} -f $${d}; \
4363 done; \
4364 else \
4365 if [ -z "${DESTDIR}" ] ; then \
4366 ${ECHO_MSG} "===> ${PKGORIGIN} not installed, skipping"; \
4367 else \
4368 ${ECHO_MSG} "===> ${PKGORIGIN} not installed in ${DESTDIR}, skipping"; \
4369 fi; \
4370 fi; \
4371 ${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
4372 .endif
4373 .endif
4374
4375 # Cleaning up
4376
4377 .if !target(do-clean)
4378 do-clean:
4379 @if [ -d ${WRKDIR}/${FAKE_INSTALLDIR} ]; then \
4380 if [ -w ${WRKDIR}/${FALE_INSTALLDIR} ]; then \
4381 ${RM} -rf ${WRKDIR}/${FAKE_INSTALLDIR}; \
4382 else \
4383 ${ECHO_MSG} "===> ${WRKDIR}/${FAKE_INSTALLDIR} not writable, skipping"; \
4384 fi; \
4385 fi
4386 @if [ -d ${WRKDIR} ]; then \
4387 if [ -w ${WRKDIR} ]; then \
4388 ${RM} -rf ${WRKDIR}; \
4389 else \
4390 ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
4391 fi; \
4392 fi
4393 .endif
4394
4395 .if !target(clean)
4396 clean:
4397 .if !defined(NOCLEANDEPENDS)
4398 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} clean-depends
4399 .endif
4400 @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
4401 .if target(pre-clean)
4402 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pre-clean
4403 .endif
4404 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} do-clean
4405 .if target(post-clean)
4406 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} post-clean
4407 .endif
4408 .endif
4409
4410 .if !target(pre-distclean)
4411 pre-distclean:
4412 @${DO_NADA}
4413 .endif
4414
4415 .if !target(distclean)
4416 distclean: pre-distclean clean
4417 @cd ${.CURDIR} && ${MAKE} delete-distfiles RESTRICTED_FILES="${_DISTFILES} ${_PATCHFILES}"
4418 .endif
4419
4420 .if !target(delete-distfiles)
4421 delete-distfiles:
4422 @${ECHO_MSG} "===> Deleting distfiles for ${PKGNAME}"
4423 @(if [ "X${RESTRICTED_FILES}" != "X" -a -d ${_DISTDIR} ]; then \
4424 cd ${_DISTDIR}; \
4425 for file in ${RESTRICTED_FILES}; do \
4426 ${RM} -f $${file}; \
4427 dir=$${file%/*}; \
4428 if [ "$${dir}" != "$${file}" ]; then \
4429 ${RMDIR} -p $${dir} >/dev/null 2>&1 || :; \
4430 fi; \
4431 done; \
4432 fi)
4433 .if defined(DIST_SUBDIR)
4434 -@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
4435 .endif
4436 .endif
4437
4438 .if !target(delete-distfiles-list)
4439 delete-distfiles-list:
4440 @${ECHO_CMD} "# ${PKGNAME}"
4441 @if [ "X${RESTRICTED_FILES}" != "X" ]; then \
4442 for file in ${RESTRICTED_FILES}; do \
4443 ${ECHO_CMD} "[ -f ${_DISTDIR}/$$file ] && (${ECHO_CMD} deleting ${_DISTDIR}/$$file; ${RM} -f ${_DISTDIR}/$$file)"; \
4444 dir=$${file%/*}; \
4445 if [ "$${dir}" != "$${file}" ]; then \
4446 ${ECHO_CMD} "(cd ${_DISTDIR} && ${RMDIR} -p $${dir} 2>/dev/null)"; \
4447 fi; \
4448 done; \
4449 fi
4450 .if defined(DIST_SUBDIR)
4451 @${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
4452 .endif
4453 .endif
4454
4455 # Prints out a list of files to fetch (useful to do a batch fetch)
4456
4457 .if !target(fetch-list)
4458 fetch-list:
4459 @${MKDIR} ${_DISTDIR}
4460 @(cd ${_DISTDIR}; \
4461 ${_MASTER_SITES_ENV} ; \
4462 for _file in ${DISTFILES}; do \
4463 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4464 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4465 if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
4466 if [ ! -z "$$select" ] ; then \
4467 __MASTER_SITES_TMP= ; \
4468 for group in $$select; do \
4469 if [ ! -z \$${_MASTER_SITES_$${group}} ] ; then \
4470 eval ___MASTER_SITES_TMP=\$${_MASTER_SITES_$${group}} ; \
4471 __MASTER_SITES_TMP="$${__MASTER_SITES_TMP} $${___MASTER_SITES_TMP}" ; \
4472 fi \
4473 done; \
4474 ___MASTER_SITES_TMP= ; \
4475 SORTED_MASTER_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4476 else \
4477 SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
4478 fi ; \
4479 for site in `eval $$SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4480 if [ ! -z "`${ECHO_CMD} ${NOFETCHFILES} | ${GREP} -w $${file}`" ]; then \
4481 if [ -z "`${ECHO_CMD} ${MASTER_SITE_OVERRIDE} | ${GREP} -w $${site}`" ]; then \
4482 continue; \
4483 fi; \
4484 fi; \
4485 DIR=${DIST_SUBDIR}; \
4486 CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
4487 case $${file} in \
4488 */*) args="-o $${file} $${site}$${file}";; \
4489 *) args=$${site}$${file};; \
4490 esac; \
4491 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4492 done; \
4493 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4494 fi \
4495 done)
4496 .if defined(PATCHFILES)
4497 @(cd ${_DISTDIR}; \
4498 ${_PATCH_SITES_ENV} ; \
4499 for _file in ${PATCHFILES}; do \
4500 file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4501 select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4502 if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
4503 if [ ! -z "$$select" ] ; then \
4504 __PATCH_SITES_TMP= ; \
4505 for group in $$select; do \
4506 if [ ! -z \$${_PATCH_SITES_$${group}} ] ; then \
4507 eval ___PATCH_SITES_TMP=\$${_PATCH_SITES_$${group}} ; \
4508 __PATCH_SITES_TMP="$${__PATCH_SITES_TMP} $${___PATCH_SITES_TMP}" ; \
4509 fi \
4510 done; \
4511 ___PATCH_SITES_TMP= ; \
4512 SORTED_PATCH_SITES_CMD_TMP="${ECHO_CMD} ${_MASTER_SITE_OVERRIDE} `${ECHO_CMD} $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
4513 else \
4514 SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
4515 fi ; \
4516 for site in `eval $$SORTED_PATCH_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do \
4517 DIR=${DIST_SUBDIR}; \
4518 CKSIZE=`${GREP} "^SIZE ($${DIR:+$$DIR/}$$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
4519 case $${file} in \
4520 */*) args="-o $${file} $${site}$${file}";; \
4521 *) args=$${site}$${file};; \
4522 esac; \
4523 ${ECHO_CMD} -n ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} "${FETCH_AFTER_ARGS}" '|| ' ; \
4524 done; \
4525 ${ECHO_CMD} "${ECHO_CMD} $${file} not fetched" ; \
4526 fi \
4527 done)
4528 .endif
4529 .endif
4530
4531 # Generates patches.
4532
4533 update-patches:
4534 @toedit=`PATCH_WRKSRC=${PATCH_WRKSRC} \
4535 PATCHDIR=${PATCHDIR} \
4536 PATCH_LIST=${PATCHDIR}/patch-* \
4537 DIFF_ARGS=${DIFF_ARGS} \
4538 DISTORIG=${DISTORIG} \
4539 ${SH} ${PORTSDIR}/Tools/scripts/update-patches`; \
4540 case $$toedit in "");; \
4541 *) ${ECHO_CMD} -n 'edit patches: '; read i; \
4542 cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
4543
4544 # Checksumming utilities
4545
4546 check-checksum-algorithms:
4547 @ \
4548 ${checksum_init} \
4549 \
4550 for alg in ${CHECKSUM_ALGORITHMS:U}; do \
4551 eval alg_executable=\$$$$alg; \
4552 if [ -z "$$alg_executable" ]; then \
4553 ${ECHO_CMD} "Checksum algorithm $$alg: Couldn't find the executable."; \
4554 ${ECHO_CMD} "Set $$alg=/path/to/$$alg in /etc/make.conf and try again."; \
4555 exit 1; \
4556 fi; \
4557 done; \
4558
4559 checksum_init=\
4560 SHA256=${SHA256}; \
4561 MD5=${MD5};
4562
4563 .if !target(makesum)
4564 makesum: check-checksum-algorithms
4565 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} fetch NO_CHECKSUM=yes \
4566 DISABLE_SIZE=yes
4567 @if [ -f ${MD5_FILE} ]; then ${CAT} /dev/null > ${MD5_FILE}; fi
4568 @( \
4569 cd ${DISTDIR}; \
4570 \
4571 ${checksum_init} \
4572 \
4573 for file in ${_CKSUMFILES}; do \
4574 for alg in ${CHECKSUM_ALGORITHMS:U}; do \
4575 eval alg_executable=\$$$$alg; \
4576 \
4577 if [ $$alg_executable != "NO" ]; then \
4578 $$alg_executable $$file >> ${MD5_FILE}; \
4579 fi; \
4580 done; \
4581 if [ -z "${NO_SIZE}" ]; then \
4582 ${ECHO_CMD} "SIZE ($$file) = "`${LS} -ALln $$file | ${AWK} '{print $$5}'` >> ${MD5_FILE}; \
4583 fi; \
4584 done \
4585 )
4586 @for file in ${_IGNOREFILES}; do \
4587 for alg in ${CHECKSUM_ALGORITHMS:U}; do \
4588 ${ECHO_CMD} "$$alg ($$file) = IGNORE" >> ${MD5_FILE}; \
4589 done; \
4590 done
4591 .endif
4592
4593 .if !target(checksum)
4594 checksum: fetch check-checksum-algorithms
4595 @ \
4596 \
4597 ${checksum_init} \
4598 \
4599 if [ -f ${MD5_FILE} ]; then \
4600 ( cd ${DISTDIR}; OK=""; \
4601 for file in ${_CKSUMFILES}; do \
4602 pattern="`${ECHO_CMD} $$file | ${SED} -e 's/\./\\\\./g'`"; \
4603 \
4604 ignored="true"; \
4605 for alg in ${CHECKSUM_ALGORITHMS:U}; do \
4606 ignore="false"; \
4607 eval alg_executable=\$$$$alg; \
4608 \
4609 if [ $$alg_executable != "NO" ]; then \
4610 MKSUM=`$$alg_executable < $$file`; \
4611 CKSUM=`${GREP} "^$$alg ($$pattern)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
4612 else \
4613 ignore="true"; \
4614 fi; \
4615 \
4616 if [ $$ignore = "false" -a -z "$$CKSUM" ]; then \
4617 ${ECHO_MSG} "=> No $$alg checksum recorded for $$file."; \
4618 ignore="true"; \
4619 fi; \
4620 \
4621 if [ "$$CKSUM" = "IGNORE" ]; then \
4622 ${ECHO_MSG} "=> $$alg Checksum for $$file is set to IGNORE in distinfo file even though"; \
4623 ${ECHO_MSG} " the file is not in the "'$$'"{IGNOREFILES} list."; \
4624 ignore="true"; \
4625 OK=${FALSE}; \
4626 fi; \
4627 \
4628 if [ $$ignore = "false" ]; then \
4629 match="false"; \
4630 for chksum in $$CKSUM; do \
4631 if [ "$$chksum" = "$$MKSUM" ]; then \
4632 match="true"; \
4633 break; \
4634 fi; \
4635 done; \
4636 if [ $$match = "true" ]; then \
4637 ${ECHO_MSG} "=> $$alg Checksum OK for $$file."; \
4638 ignored="false"; \
4639 else \
4640 ${ECHO_MSG} "=> $$alg Checksum mismatch for $$file."; \
4641 refetchlist="$$refetchlist$$file "; \
4642 OK="$${OK:-retry}"; \
4643 ignored="false"; \
4644 fi; \
4645 fi; \
4646 done; \
4647 \
4648 if [ $$ignored = "true" ]; then \
4649 ${ECHO_MSG} "=> No suitable checksum found for $$file."; \
4650 OK="${FALSE}"; \
4651 fi; \
4652 \
4653 done; \
4654 \
4655 for file in ${_IGNOREFILES}; do \
4656 pattern="`${ECHO_CMD} $$file | ${SED} -e 's/\./\\\\./g'`"; \
4657 \
4658 ignored="true"; \
4659 alreadymatched="false"; \
4660 for alg in ${CHECKSUM_ALGORITHMS:U}; do \
4661 ignore="false"; \
4662 eval alg_executable=\$$$$alg; \
4663 \
4664 if [ $$alg_executable != "NO" ]; then \
4665 CKSUM=`${GREP} "^$$alg ($$pattern)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
4666 else \
4667 ignore="true"; \
4668 fi; \
4669 \
4670 if [ $$ignore = "false" ]; then \
4671 if [ -z "$$CKSUM" ]; then \
4672 ${ECHO_MSG} "=> No $$alg checksum for $$file recorded (expected IGNORE)"; \
4673 OK="$$alreadymatched"; \
4674 elif [ $$CKSUM != "IGNORE" ]; then \
4675 ${ECHO_MSG} "=> $$alg Checksum for $$file is not set to IGNORE in distinfo file even though"; \
4676 ${ECHO_MSG} " the file is in the "'$$'"{IGNOREFILES} list."; \
4677 OK="false"; \
4678 else \
4679 ignored="false"; \
4680 alreadymatched="true"; \
4681 fi; \
4682 fi; \
4683 done; \
4684 \
4685 if ( [ $$ignored = "true" ]) ; then \
4686 ${ECHO_MSG} "=> No suitable checksum found for $$file."; \
4687 OK="false"; \
4688 fi; \
4689 \
4690 done; \
4691 \
4692 if [ "$${OK:=true}" = "retry" ] && [ ${FETCH_REGET} -gt 0 ]; then \
4693 ${ECHO_MSG} "===> Refetch for ${FETCH_REGET} more times files: $$refetchlist"; \
4694 if ( cd ${.CURDIR} && \
4695 ${MAKE} ${.MAKEFLAGS} FORCE_FETCH="$$refetchlist" FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" fetch); then \
4696 if ( cd ${.CURDIR} && \
4697 ${MAKE} ${.MAKEFLAGS} FETCH_REGET="`${EXPR} ${FETCH_REGET} - 1`" checksum ); then \
4698 OK="true"; \
4699 fi; \
4700 fi; \
4701 fi ; \
4702 \
4703 if [ "$$OK" != "true" -a ${FETCH_REGET} -eq 0 ]; then \
4704 ${ECHO_MSG} "===> Giving up on fetching files: $$refetchlist"; \
4705 ${ECHO_MSG} "Make sure the Makefile and distinfo file (${MD5_FILE})"; \
4706 ${ECHO_MSG} "are up to date. If you are absolutely sure you want to override this"; \
4707 ${ECHO_MSG} "check, type \"make NO_CHECKSUM=yes [other args]\"."; \
4708 exit 1; \
4709 fi; \
4710 if [ "$$OK" != "true" ]; then \
4711 exit 1; \
4712 fi \
4713 ); \
4714 elif [ -n "${_CKSUMFILES:M*}" ]; then \
4715 ${ECHO_MSG} "=> No checksum file (${MD5_FILE})."; \
4716 fi
4717 .endif
4718
4719 ################################################################
4720 # The special package-building targets
4721 # You probably won't need to touch these
4722 ################################################################
4723
4724 # Nobody should want to override this unless PKGNAME is simply bogus.
4725
4726 .if !target(package-name)
4727 package-name:
4728 @${ECHO_CMD} ${PKGNAME}
4729 .endif
4730
4731 # Build a package but don't check the package cookie
4732
4733 .if !target(repackage)
4734 repackage: pre-repackage package
4735
4736 pre-repackage:
4737 @${RM} -f ${PACKAGE_COOKIE}
4738 .endif
4739
4740 # Build a package but don't check the cookie for installation, also don't
4741 # install package cookie
4742
4743 .if !target(package-noinstall)
4744 package-noinstall:
4745 @${MKDIR} ${WRKDIR}
4746 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pre-package \
4747 pre-package-script do-package post-package-script
4748 @${RM} -f ${TMPPLIST}
4749 -@${RMDIR} ${WRKDIR}
4750 .endif
4751
4752 ################################################################
4753 # Dependency checking
4754 ################################################################
4755
4756 .if !target(depends)
4757 depends: extract-depends patch-depends lib-depends misc-depends fetch-depends build-depends run-depends
4758
4759 .if defined(ALWAYS_BUILD_DEPENDS)
4760 _DEPEND_ALWAYS= 1
4761 .else
4762 _DEPEND_ALWAYS= 0
4763 .endif
4764
4765 _INSTALL_DEPENDS= \
4766 if [ X${USE_PACKAGE_DEPENDS} != "X" ]; then \
4767 subpkgfile=`(cd $$dir; ${MAKE} $$depends_args -V PKGFILE)`; \
4768 if [ -r "$${subpkgfile}" -a "$$target" = "${DEPENDS_TARGET}" ]; then \
4769 if [ -z "${DESTDIR}" ] ; then \
4770 ${ECHO_MSG} "===> Installing existing package $${subpkgfile}"; \
4771 ${PKG_ADD} $${subpkgfile}; \
4772 else \
4773 ${ECHO_MSG} "===> Installing existing package $${subpkgfile} into ${DESTDIR}"; \
4774 ${PKG_ADD} -C ${DESTDIR} $${subpkgfile}; \
4775 fi; \
4776 else \
4777 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4778 fi; \
4779 else \
4780 (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \
4781 fi; \
4782 if [ -z "${DESTDIR}" ] ; then \
4783 ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \
4784 else \
4785 ${ECHO_MSG} "===> Returning to build of ${PKGNAME} for ${DESTDIR}"; \
4786 fi;
4787
4788 .for deptype in EXTRACT PATCH FETCH BUILD RUN
4789 ${deptype:L}-depends:
4790 .if defined(${deptype}_DEPENDS)
4791 .if !defined(NO_DEPENDS)
4792 @for i in `${ECHO_CMD} "${${deptype}_DEPENDS}"`; do \
4793 prog=`${ECHO_CMD} $$i | ${SED} -e 's/:.*//'`; \
4794 dir=`${ECHO_CMD} $$i | ${SED} -e 's/[^:]*://'`; \
4795 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
4796 target=`${ECHO_CMD} $$dir | ${SED} -e 's/.*://'`; \
4797 dir=`${ECHO_CMD} $$dir | ${SED} -e 's/:.*//'`; \
4798 else \
4799 target="${DEPENDS_TARGET}"; \
4800 depends_args="${DEPENDS_ARGS}"; \
4801 fi; \
4802 if ${EXPR} "$$prog" : \\/ >/dev/null; then \
4803 if [ -e "$$prog" ]; then \
4804 if [ "$$prog" = "${NONEXISTENT}" ]; then \
4805 ${ECHO_MSG} "Error: ${NONEXISTENT} exists. Please remove it, and restart the build."; \
4806 ${FALSE}; \
4807 else \
4808 if [ -z "${DESTDIR}" ] ; then \
4809 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \
4810 else \
4811 ${ECHO_MSG} "===> ${PKGNAME} depends on file in ${DESTDIR}: $$prog - found"; \
4812 fi; \
4813 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4814 ${ECHO_MSG} " (but building it anyway)"; \
4815 notfound=1; \
4816 else \
4817 notfound=0; \
4818 fi; \
4819 fi; \
4820 else \
4821 if [ -z "${DESTDIR}" ] ; then \
4822 ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \
4823 else \
4824 ${ECHO_MSG} "===> ${PKGNAME} depends on file in ${DESTDIR}: $$prog - not found"; \
4825 fi; \
4826 notfound=1; \
4827 fi; \
4828 else \
4829 case $${prog} in \
4830 *\>*|*\<*|*=*) pkg=yes;; \
4831 *) pkg="";; \
4832 esac; \
4833 if [ "$$pkg" != "" ]; then \
4834 if ${PKG_INFO} "$$prog" > /dev/null 2>&1 ; then \
4835 if [ -z "${DESTDIR}" ] ; then \
4836 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - found"; \
4837 else \
4838 ${ECHO_MSG} "===> ${PKGNAME} depends on package in ${DESTDIR}: $$prog - found"; \
4839 fi; \
4840 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4841 ${ECHO_MSG} " (but building it anyway)"; \
4842 notfound=1; \
4843 else \
4844 notfound=0; \
4845 fi; \
4846 else \
4847 if [ -z "${DESTDIR}" ] ; then \
4848 ${ECHO_MSG} "===> ${PKGNAME} depends on package: $$prog - not found"; \
4849 else \
4850 ${ECHO_MSG} "===> ${PKGNAME} depends on package in ${DESTDIR}: $$prog - not found"; \
4851 fi; \
4852 notfound=1; \
4853 fi; \
4854 if [ $$notfound != 0 ]; then \
4855 inverse_dep=`${ECHO_CMD} $$prog | ${SED} \
4856 -e 's/<=/=gt=/; s/</=ge=/; s/>=/=lt=/; s/>/=le=/' \
4857 -e 's/=gt=/>/; s/=ge=/>=/; s/=lt=/</; s/=le=/<=/'`; \
4858 pkg_info=`${PKG_INFO} -E "$$inverse_dep" || ${TRUE}`; \
4859 if [ "$$pkg_info" != "" ]; then \
4860 ${ECHO_MSG} "===> Found $$pkg_info, but you need to upgrade to $$prog."; \
4861 exit 1; \
4862 fi; \
4863 fi; \
4864 elif ${WHICH} "$$prog" > /dev/null 2>&1 ; then \
4865 if [ -z "${PREFIX}" ] ; then \
4866 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \
4867 else \
4868 ${ECHO_MSG} "===> ${PKGNAME} depends on executable in ${DESTDIR}: $$prog - found"; \
4869 fi; \
4870 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4871 ${ECHO_MSG} " (but building it anyway)"; \
4872 notfound=1; \
4873 else \
4874 notfound=0; \
4875 fi; \
4876 else \
4877 if [ -z "${DESTDIR}" ] ; then \
4878 ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \
4879 else \
4880 ${ECHO_MSG} "===> ${PKGNAME} depends on executable in ${DESTDIR}: $$prog - not found"; \
4881 fi; \
4882 notfound=1; \
4883 fi; \
4884 fi; \
4885 if [ $$notfound != 0 ]; then \
4886 ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \
4887 if [ ! -d "$$dir" ]; then \
4888 ${ECHO_MSG} " => No directory for $$prog. Skipping.."; \
4889 else \
4890 ${_INSTALL_DEPENDS} \
4891 fi; \
4892 fi; \
4893 done
4894 .endif
4895 .else
4896 @${DO_NADA}
4897 .endif
4898 .endfor
4899
4900 lib-depends:
4901 .if defined(LIB_DEPENDS) && !defined(NO_DEPENDS)
4902 @for i in ${LIB_DEPENDS}; do \
4903 lib=$${i%%:*}; \
4904 case $$lib in \
4905 *.*.*) pattern="`${ECHO_CMD} $$lib | ${SED} -e 's/\./\\\\./g'`" ;;\
4906 *.*) pattern="$${lib%%.*}\.$${lib#*.}" ;;\
4907 *) pattern="$$lib" ;;\
4908 esac; \
4909 dir=$${i#*:}; \
4910 target=$${i##*:}; \
4911 if ${TEST} $$dir = $$target; then \
4912 target="${DEPENDS_TARGET}"; \
4913 depends_args="${DEPENDS_ARGS}"; \
4914 else \
4915 dir=$${dir%%:*}; \
4916 fi; \
4917 if [ -z "${DESTDIR}" ] ; then \
4918 ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib"; \
4919 if ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
4920 ${ECHO_MSG} " - found"; \
4921 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4922 ${ECHO_MSG} " (but building it anyway)"; \
4923 notfound=1; \
4924 else \
4925 notfound=0; \
4926 fi; \
4927 else \
4928 ${ECHO_MSG} " - not found"; \
4929 notfound=1; \
4930 fi; \
4931 else \
4932 ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library in ${DESTDIR}: $$lib"; \
4933 if ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
4934 ${ECHO_MSG} " - found"; \
4935 if [ ${_DEPEND_ALWAYS} = 1 ]; then \
4936 ${ECHO_MSG} " (but building it anyway)"; \
4937 notfound=1; \
4938 else \
4939 notfound=0; \
4940 fi; \
4941 else \
4942 ${ECHO_MSG} " - not found"; \
4943 notfound=1; \
4944 fi; \
4945 fi; \
4946 if [ $$notfound != 0 ]; then \
4947 ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \
4948 if [ ! -d "$$dir" ]; then \
4949 ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \
4950 else \
4951 ${_INSTALL_DEPENDS} \
4952 if ! ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \
4953 ${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \
4954 ${FALSE}; \
4955 fi; \
4956 fi; \
4957 fi; \
4958 done
4959 .endif
4960
4961 misc-depends:
4962 .if defined(DEPENDS)
4963 .if !defined(NO_DEPENDS)
4964 @for dir in ${DEPENDS}; do \
4965 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
4966 target=`${ECHO_CMD} $$dir | ${SED} -e 's/.*://'`; \
4967 dir=`${ECHO_CMD} $$dir | ${SED} -e 's/:.*//'`; \
4968 else \
4969 target="${DEPENDS_TARGET}"; \
4970 depends_args="${DEPENDS_ARGS}"; \
4971 fi; \
4972 ${ECHO_MSG} "===> ${PKGNAME} depends on: $$dir"; \
4973 ${ECHO_MSG} "===> Verifying $$target for $$dir"; \
4974 if [ ! -d $$dir ]; then \
4975 ${ECHO_MSG} " => No directory for $$dir. Skipping.."; \
4976 else \
4977 (cd $$dir; ${MAKE} $$target $$depends_args) ; \
4978 fi \
4979 done
4980 @if [ -z "${DESTDIR}" ] ; then \
4981 ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \
4982 else \
4983 ${ECHO_MSG} "===> Returning to build of ${PKGNAME} for ${DESTDIR}"; \
4984 fi
4985 .endif
4986 .else
4987 @${DO_NADA}
4988 .endif
4989
4990 .endif
4991
4992 # Dependency lists: both build and runtime, recursive. Print out directory names.
4993
4994 _UNIFIED_DEPENDS=${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}
4995 _DEPEND_DIRS= ${_UNIFIED_DEPENDS:C,^[^:]*:([^:]*).*$,\1,} ${DEPENDS:C,:.*,,}
4996
4997 all-depends-list:
4998 @${ALL-DEPENDS-LIST}
4999
5000 ALL-DEPENDS-LIST= \
5001 L="${_DEPEND_DIRS}"; \
5002 checked=""; \
5003 while [ -n "$$L" ]; do \
5004 l=""; \
5005 for d in $$L; do \
5006 case $$checked in \
5007 $$d\ *|*\ $$d\ *|*\ $$d) \
5008 continue;; \
5009 esac; \
5010 checked="$$checked $$d"; \
5011 if [ ! -d $$d ]; then \
5012 ${ECHO_MSG} "${PKGNAME}: \"$$d\" non-existent -- dependency list incomplete" >&2; \
5013 continue; \
5014 fi; \
5015 ${ECHO_CMD} $$d; \
5016 if ! children=$$(cd $$d && ${MAKE} -V _DEPEND_DIRS); then\
5017 ${ECHO_MSG} "${PKGNAME}: \"$$d\" erroneous -- dependency list incomplete" >&2; \
5018 continue; \
5019 fi; \
5020 for child in $$children; do \
5021 case "$$checked $$l" in \
5022 $$child\ *|*\ $$child\ *|*\ $$child) \
5023 continue;; \
5024 esac; \
5025 l="$$l $$child"; \
5026 done; \
5027 done; \
5028 L=$$l; \
5029 done
5030
5031 .if !target(clean-depends)
5032 clean-depends:
5033 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5034 (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \
5035 done
5036 .endif
5037
5038 .if !target(deinstall-depends)
5039 deinstall-depends:
5040 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5041 (cd $$dir; ${MAKE} deinstall); \
5042 done
5043 .endif
5044
5045 .if !target(fetch-recursive)
5046 fetch-recursive:
5047 @${ECHO_MSG} "===> Fetching all distfiles for ${PKGNAME} and dependencies"
5048 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5049 (cd $$dir; ${MAKE} fetch); \
5050 done
5051 .endif
5052
5053 .if !target(fetch-recursive-list)
5054 fetch-recursive-list:
5055 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5056 (cd $$dir; ${MAKE} fetch-list); \
5057 done
5058 .endif
5059
5060 .if !target(fetch-required)
5061 fetch-required: fetch
5062 @${ECHO_MSG} "===> Fetching all required distfiles for ${PKGNAME} and dependencies"
5063 .for deptype in EXTRACT PATCH FETCH BUILD RUN
5064 .if defined(${deptype}_DEPENDS)
5065 .if !defined(NO_DEPENDS)
5066 @for i in ${${deptype}_DEPENDS}; do \
5067 prog=`${ECHO_CMD} $$i | ${CUT} -f 1 -d ':'`; \
5068 dir=`${ECHO_CMD} $$i | ${CUT} -f 2-999 -d ':'`; \
5069 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
5070 dir=`${ECHO_CMD} $$dir | ${CUT} -f 1 -d ':'`; \
5071 if ${EXPR} "$$prog" : \\/ >/dev/null; then \
5072 if [ ! -e "$$prog" ]; then \
5073 (cd $$dir; ${MAKE} fetch); \
5074 fi; \
5075 fi; \
5076 else \
5077 (cd $$dir; \
5078 tmp=`${MAKE} -V PKGNAME`; \
5079 if [ ! -d ${PKG_DBDIR}/$${tmp} ]; then \
5080 ${MAKE} fetch; \
5081 fi ); \
5082 fi; \
5083 done
5084 .endif
5085 .endif
5086 .endfor
5087 .endif
5088
5089 .if !target(fetch-required-list)
5090 fetch-required-list: fetch-list
5091 .for deptype in EXTRACT PATCH FETCH BUILD RUN
5092 .if defined(${deptype}_DEPENDS)
5093 .if !defined(NO_DEPENDS)
5094 @for i in ${${deptype}_DEPENDS}; do \
5095 prog=`${ECHO_CMD} $$i | ${CUT} -f 1 -d ':'`; \
5096 dir=`${ECHO_CMD} $$i | ${CUT} -f 2-999 -d ':'`; \
5097 if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
5098 dir=`${ECHO_CMD} $$dir | ${CUT} -f 1 -d ':'`; \
5099 if ${EXPR} "$$prog" : \\/ >/dev/null; then \
5100 if [ ! -e "$$prog" ]; then \
5101 (cd $$dir; ${MAKE} fetch-list); \
5102 fi; \
5103 fi; \
5104 else \
5105 (cd $$dir; \
5106 tmp=`${MAKE} -V PKGNAME`; \
5107 if [ ! -d ${PKG_DBDIR}/$${tmp} ]; then \
5108 ${MAKE} fetch-list; \
5109 fi ); \
5110 fi; \
5111 done
5112 .endif
5113 .endif
5114 .endfor
5115 .endif
5116
5117 .if !target(checksum-recursive)
5118 checksum-recursive:
5119 @${ECHO_MSG} "===> Fetching and checking checksums for ${PKGNAME} and dependencies"
5120 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5121 (cd $$dir; ${MAKE} checksum); \
5122 done
5123 .endif
5124
5125 # Dependency lists: build and runtime. Print out directory names.
5126
5127 build-depends-list:
5128 .if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
5129 @${BUILD-DEPENDS-LIST}
5130 .endif
5131
5132 BUILD-DEPENDS-LIST= \
5133 for dir in $$(${ECHO_CMD} "${EXTRACT_DEPENDS} ${PATCH_DEPENDS} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | ${SORT} -u); do \
5134 if [ -d $$dir ]; then \
5135 ${ECHO_CMD} $$dir; \
5136 else \
5137 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
5138 fi; \
5139 done | ${SORT} -u
5140
5141 run-depends-list:
5142 .if defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
5143 @${RUN-DEPENDS-LIST}
5144 .endif
5145
5146 RUN-DEPENDS-LIST= \
5147 for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':' | ${SORT} -u) $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':' | ${SORT} -u); do \
5148 if [ -d $$dir ]; then \
5149 ${ECHO_CMD} $$dir; \
5150 else \
5151 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
5152 fi; \
5153 done | ${SORT} -u
5154
5155 # Package (recursive runtime) dependency list. Print out both directory names
5156 # and package names.
5157
5158 package-depends-list:
5159 .if defined(CHILD_DEPENDS) || defined(LIB_DEPENDS) || defined(RUN_DEPENDS) || defined(DEPENDS)
5160 @${PACKAGE-DEPENDS-LIST}
5161 .endif
5162
5163 PACKAGE-DEPENDS-LIST?= \
5164 if [ "${CHILD_DEPENDS}" ]; then \
5165 installed=$$(${PKG_INFO} -qO ${PKGORIGIN} 2>/dev/null || \
5166 ${TRUE}); \
5167 if [ "$$installed" ]; then \
5168 break; \
5169 fi; \
5170 if [ -z "$$installed" ]; then \
5171 installed="${PKGNAME}"; \
5172 fi; \
5173 for pkgname in $$installed; do \
5174 ${ECHO_CMD} "$$pkgname ${.CURDIR} ${PKGORIGIN}"; \
5175 done; \
5176 fi; \
5177 checked="${PARENT_CHECKED}"; \
5178 for dir in $$(${ECHO_CMD} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${SED} -e 'y/ /\n/' | ${CUT} -f 2 -d ':') $$(${ECHO_CMD} ${DEPENDS} | ${SED} -e 'y/ /\n/' | ${CUT} -f 1 -d ':'); do \
5179 dir=$$(${REALPATH} $$dir); \
5180 if [ -d $$dir ]; then \
5181 if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \
5182 childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes PARENT_CHECKED="$$checked" package-depends-list); \
5183 set -- $$childout; \
5184 childdir=""; \
5185 while [ $$\# != 0 ]; do \
5186 childdir="$$childdir $$2"; \
5187 ${ECHO_CMD} "$$1 $$2 $$3"; \
5188 shift 3; \
5189 done; \
5190 checked="$$dir $$childdir $$checked"; \
5191 fi; \
5192 else \
5193 ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \
5194 fi; \
5195 done
5196
5197 # Print out package names.
5198
5199 package-depends:
5200 @${PACKAGE-DEPENDS-LIST} | ${AWK} '{print $$1":"$$3}'
5201
5202 # Build packages for port and dependencies
5203
5204 package-recursive: package
5205 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5206 (cd $$dir; ${MAKE} package-noinstall); \
5207 done
5208
5209 # Show missing dependiencies
5210 missing:
5211 @for dir in $$(${ALL-DEPENDS-LIST}); do \
5212 THISORIGIN=$$(${ECHO_CMD} $$dir | ${SED} 's,${PORTSDIR}/,,'); \
5213 installed=$$(${PKG_INFO} -qO $${THISORIGIN}); \
5214 if [ -z "$$installed" ]; then \
5215 ${ECHO_CMD} $$THISORIGIN; \
5216 fi \
5217 done
5218
5219 ################################################################
5220 # Everything after here are internal targets and really
5221 # shouldn't be touched by anybody but the release engineers.
5222 ################################################################
5223
5224 # This target generates an index entry suitable for aggregation into
5225 # a large index. Format is:
5226 #
5227 # distribution-name|port-path|installation-prefix|comment| \
5228 # description-file|maintainer|categories|extract-depends| \
5229 # patch-depends|fetch-depends|build-depends|run-depends|www site
5230 #
5231 # If this ever changes, portmgr should contact the portsnap maintainer
5232 # first to avoid gratuitous breakage.
5233
5234 .if !target(describe)
5235 describe:
5236 @${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"
5237 .if defined(COMMENT)
5238 @${ECHO_CMD} -n ${COMMENT:Q}
5239 .else
5240 @${ECHO_CMD} -n '** No Description'
5241 .endif
5242 @perl -e ' \
5243 if ( -f q{${DESCR}} ) { \
5244 print q{|${DESCR}}; \
5245 } else { \
5246 print q{|/dev/null}; \
5247 } \
5248 print q{|${MAINTAINER}|${CATEGORIES}|}; \
5249 @edirs = map((split /:/)[1], split(q{ }, q{${EXTRACT_DEPENDS}})); \
5250 @pdirs = map((split /:/)[1], split(q{ }, q{${PATCH_DEPENDS}})); \
5251 @fdirs = map((split /:/)[1], split(q{ }, q{${FETCH_DEPENDS}})); \
5252 @bdirs = map((split /:/)[1], split(q{ }, q{${BUILD_DEPENDS}})); \
5253 @rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \
5254 @ddirs = map((split /:/)[0], split(q{ }, q{${DEPENDS}})); \
5255 @ldirs = map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})); \
5256 for my $$i (\@edirs, \@pdirs, \@fdirs, \@bdirs, \@rdirs, \@ddirs, \@ldirs) { \
5257 my @dirs = @$$i; \
5258 @$$i = (); \
5259 for (@dirs) { \
5260 if (-d $$_) { \
5261 push @$$i, $$_; \
5262 } else { \
5263 print STDERR qq{${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete\n}; \
5264 exit(1); \
5265 } \
5266 } \
5267 } \
5268 for (@edirs, @ddirs) { \
5269 $$xe{$$_} = 1; \
5270 } \
5271 print join(q{ }, sort keys %xe), q{|}; \
5272 for (@pdirs, @ddirs) { \
5273 $$xp{$$_} = 1; \
5274 } \
5275 print join(q{ }, sort keys %xp), q{|}; \
5276 for (@fdirs, @ddirs) { \
5277 $$xf{$$_} = 1; \
5278 } \
5279 print join(q{ }, sort keys %xf), q{|}; \
5280 for (@bdirs, @ddirs, @ldirs) { \
5281 $$xb{$$_} = 1; \
5282 } \
5283 print join(q{ }, sort keys %xb), q{|}; \
5284 for (@rdirs, @ddirs, @ldirs) { \
5285 $$xr{$$_} = 1; \
5286 } \
5287 print join(q{ }, sort keys %xr), q{|}; \
5288 if (open(DESCR, q{${DESCR}})) { \
5289 while (<DESCR>) { \
5290 if (/^WWW:\s+(\S+)/) { \
5291 print $$1; \
5292 last; \
5293 } \
5294 } \
5295 } \
5296 print qq{\n};'
5297 .endif
5298
5299 www-site:
5300 .if exists(${DESCR})
5301 @${AWK} '$$1 ~ /^WWW:/ {print $$2}' ${DESCR} | ${HEAD} -1
5302 .else
5303 @${ECHO_CMD}
5304 .endif
5305
5306 .if !target(readmes)
5307 readmes: readme
5308 .endif
5309
5310 .if !target(readme)
5311 readme:
5312 @${RM} -f ${.CURDIR}/README.html
5313 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.CURDIR}/README.html
5314 .endif
5315
5316 ${.CURDIR}/README.html:
5317 @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
5318 @__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \
5319 ${SED} -e 's|%%PORT%%|'$$(${ECHO_CMD} ${.CURDIR} | \
5320 ${SED} -e 's|.*/\([^/]*/[^/]*\)$$|\1|')'|g' \
5321 -e 's|%%PKG%%|${PKGNAME}|g' \
5322 -e 's|%%COMMENT%%|'"$$(${ECHO_CMD} ${COMMENT:Q})"'|' \
5323 -e '/%%COMMENT%%/d' \
5324 -e 's|%%DESCR%%|'"$$(${ECHO_CMD} ${DESCR} | \
5325 ${SED} -e 's|${.CURDIR}/||')"'|' \
5326 -e 's|%%EMAIL%%|'"$$(${ECHO_CMD} "${MAINTAINER}" | \
5327 ${SED} -e 's/([^)]*)//;s/.*<//;s/>.*//')"'|g' \
5328 -e 's|%%MAINTAINER%%|${MAINTAINER}|g' \
5329 -e 's|%%WEBSITE%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
5330 $${__softMAKEFLAGS} pretty-print-www-site)"'|' \
5331 -e 's|%%BUILD_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
5332 $${__softMAKEFLAGS} pretty-print-build-depends-list)"'|' \
5333 -e 's|%%RUN_DEPENDS%%|'"$$(cd ${.CURDIR} && eval ${MAKE} \
5334 $${__softMAKEFLAGS} pretty-print-run-depends-list)"'|' \
5335 -e 's|%%TOP%%|'"$$(${ECHO_CMD} ${CATEGORIES} | \
5336 ${SED} -e 's| .*||' -e 's|[^/]*|..|g')"'/..|' \
5337 ${TEMPLATES}/README.port >> $@
5338
5339 # The following two targets require an up-to-date INDEX in ${PORTSDIR}
5340
5341 _PRETTY_PRINT_DEPENDS_LIST=\
5342 if [ ! -r ${INDEXDIR}/${INDEXFILE} ] ; then \
5343 ${ECHO_MSG} "${.TARGET} requires an INDEX file (${INDEXFILE}). Please run make index or make fetchindex."; \
5344 else \
5345 target=${.TARGET:C/pretty-print-(.*)-depends-list/\1/} ; \
5346 if [ "$$target" = "build" ] ; then fldnum=8 ; else fldnum=9 ; fi ; \
5347 ${ECHO_MSG} -n 'This port requires package(s) "' ; \
5348 ${ECHO_MSG} -n `${AWK} -F\| "\\$$1 ~ /^${PKGNAME}/ {print \\$$$${fldnum};}" ${INDEXDIR}/${INDEXFILE}` ; \
5349 ${ECHO_MSG} "\" to $$target."; \
5350 fi;
5351
5352
5353 .if !target(pretty-print-build-depends-list)
5354 pretty-print-build-depends-list:
5355 .if defined(EXTRACT_DEPENDS) || defined(PATCH_DEPENDS) || \
5356 defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
5357 defined(LIB_DEPENDS) || defined(DEPENDS)
5358 @${_PRETTY_PRINT_DEPENDS_LIST}
5359 .endif
5360 .endif
5361
5362 .if !target(pretty-print-run-depends-list)
5363 pretty-print-run-depends-list:
5364 .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || \
5365 defined(DEPENDS)
5366 @${_PRETTY_PRINT_DEPENDS_LIST}
5367 .endif
5368 .endif
5369
5370 _SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/}
5371 .if !target(apply-slist)
5372 apply-slist:
5373 .if defined(SUB_FILES)
5374 .for file in ${SUB_FILES}
5375 .if !exists(${FILESDIR}/${file}.in)
5376 @${ECHO_MSG} "** Missing ${FILESDIR}/${file}.in for ${PKGNAME}."; exit 1
5377 .else
5378 @${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/${file}.in > ${WRKDIR}/${file}
5379 .endif
5380 .endfor
5381 .for i in pkg-message pkg-install pkg-deinstall pkg-req
5382 .if ${SUB_FILES:M${i}*}!=""
5383 ${i:S/-//:U}= ${WRKDIR}/${SUB_FILES:M${i}*}
5384 .endif
5385 .endfor
5386 .endif
5387 .endif
5388
5389 # Generate packing list. Also tests to make sure all required package
5390 # files exist.
5391 #
5392 # TODO
5393 # I want to refactor this and add-plist-* into one target that builds the tmplist.
5394 #
5395 .if !target(generate-plist)
5396 generate-plist:
5397 @${ECHO_MSG} "===> Generating temporary packing list"
5398 @${MKDIR} `${DIRNAME} ${TMPPLIST}`
5399 @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
5400 @>${TMPPLIST}
5401 @for file in ${PLIST_FILES}; do \
5402 ${ECHO_CMD} $${file} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} >> ${TMPPLIST}; \
5403 done
5404 @for man in ${__MANPAGES}; do \
5405 ${ECHO_CMD} $${man} >> ${TMPPLIST}; \
5406 done
5407 .for _PREFIX in ${PREFIX}
5408 .if ${_TMLINKS:M${_PREFIX}*}x != x
5409 @for i in ${_TMLINKS:M${_PREFIX}*:S|^${_PREFIX}/||}; do \
5410 ${ECHO_CMD} "$$i" >> ${TMPPLIST}; \
5411 done
5412 .endif
5413 .if ${_TMLINKS:N${_PREFIX}*}x != x
5414 @${ECHO_CMD} @cwd / >> ${TMPPLIST}
5415 @for i in ${_TMLINKS:N${_PREFIX}*:S|^/||}; do \
5416 ${ECHO_CMD} "$$i" >> ${TMPPLIST}; \
5417 done
5418 @${ECHO_CMD} '@cwd ${PREFIX}' >> ${TMPPLIST}
5419 .endif
5420 @for i in $$(${ECHO_CMD} ${__MANPAGES} ${_TMLINKS:M${_PREFIX}*:S|^${_PREFIX}/||} ' ' | ${SED} -E -e 's|man([1-9ln])/([^/ ]+) |cat\1/\2 |g'); do \
5421 ${ECHO_CMD} "@unexec rm -f %D/$${i%.gz} %D/$${i%.gz}.gz" >> ${TMPPLIST}; \
5422 done
5423 .endfor
5424 @if [ -f ${PLIST} ]; then \
5425 ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
5426 fi
5427 .for reinplace in ${PLIST_REINPLACE}
5428 .if defined(PLIST_REINPLACE_${reinplace:U})
5429 @${SED} -i "" -e '${PLIST_REINPLACE_${reinplace:U}}' ${TMPPLIST}
5430 .endif
5431 .endfor
5432
5433 .for dir in ${PLIST_DIRS}
5434 @${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
5435 .endfor
5436 # To be removed once INSTALLS_SHLIB has been eradicated.
5437 .if defined(INSTALLS_SHLIB) && !defined(INSTALL_AS_USER)
5438 @${ECHO_CMD} "@exec ${LDCONFIG_PLIST_EXEC_CMD}" >> ${TMPPLIST}
5439 @${ECHO_CMD} "@unexec ${LDCONFIG_PLIST_UNEXEC_CMD}" >> ${TMPPLIST}
5440 .elif defined(INSTALLS_SHLIB)
5441 @${ECHO_CMD} "@exec ${LDCONFIG_PLIST_EXEC_CMD} || ${TRUE}" >> ${TMPPLIST}
5442 @${ECHO_CMD} "@unexec ${LDCONFIG_PLIST_UNEXEC_CMD} || ${TRUE}" >> ${TMPPLIST}
5443 .endif
5444 .if defined(USE_LDCONFIG)
5445 .if !defined(INSTALL_AS_USER)
5446 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG}" >> ${TMPPLIST}
5447 @${ECHO_CMD} "@unexec ${LDCONFIG} -R" >> ${TMPPLIST}
5448 .else
5449 @${ECHO_CMD} "@exec ${LDCONFIG} -m ${USE_LDCONFIG} || ${TRUE}" >> ${TMPPLIST}
5450 @${ECHO_CMD} "@unexec ${LDCONFIG} -R || ${TRUE}" >> ${TMPPLIST}
5451 .endif
5452 .endif
5453 .if defined(USE_LDCONFIG32)
5454 .if !defined(INSTALL_AS_USER)
5455 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32}" >> ${TMPPLIST}
5456 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R" >> ${TMPPLIST}
5457 .else
5458 @${ECHO_CMD} "@exec ${LDCONFIG} -32 -m ${USE_LDCONFIG32} || ${TRUE}" >> ${TMPPLIST}
5459 @${ECHO_CMD} "@unexec ${LDCONFIG} -32 -R || ${TRUE}" >> ${TMPPLIST}
5460 .endif
5461 .endif
5462 .if !defined(NO_FILTER_SHLIBS)
5463 .if (${PORTOBJFORMAT} == "aout")
5464 @${SED} -e 's,\(/lib.*\.so\.[0-9]*\)$$,\1.0,' ${TMPPLIST} > ${TMPPLIST}.tmp
5465 .else
5466 @${SED} -e 's,\(/lib.*\.so\.[0-9]*\)\.[0-9]*$$,\1,' ${TMPPLIST} > ${TMPPLIST}.tmp
5467 .endif
5468 @${MV} -f ${TMPPLIST}.tmp ${TMPPLIST}
5469 .endif
5470 .endif
5471
5472 ${TMPPLIST}:
5473 @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} generate-plist
5474
5475 .if !target(add-plist-docs)
5476 add-plist-docs:
5477 .if defined(PORTDOCS) && !defined(NOPORTDOCS)
5478 @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \
5479 [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \
5480 ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
5481 fi
5482 .for x in ${PORTDOCS}
5483 @if ${ECHO_CMD} "${x}"| ${AWK} '$$1 ~ /(\*|\||\[|\]|\?|\{|\}|\$$)/ { exit 1};'; then \
5484 if [ ! -e ${DOCSDIR}/${x} ]; then \
5485 ${ECHO_CMD} ${DOCSDIR}/${x} | \
5486 ${SED} -e 's,^${TARGETDIR}/,,' >> ${TMPPLIST}; \
5487 fi;fi
5488 .endfor
5489 @${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} ! -type d 2>/dev/null | \
5490 ${SED} -ne 's,^${TARGETDIR}/,,p' >> ${TMPPLIST}
5491 @${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \
5492 ${SED} -ne 's,^${TARGETDIR}/,@dirrm ,p' >> ${TMPPLIST}
5493 @${ECHO_CMD} "@dirrm ${DOCSDIR:S,^${TARGETDIR}/,,}" >> ${TMPPLIST}
5494 .else
5495 @${DO_NADA}
5496 .endif
5497 .endif
5498
5499 .if !target(add-plist-info)
5500 add-plist-info:
5501 # Process GNU INFO files at package install/deinstall time
5502 .if defined(INFO)
5503 .for i in ${INFO}
5504 install-info --quiet ${TARGETDIR}/${INFO_PATH}/$i.info ${TARGETDIR}/${INFO_PATH}/dir
5505 @${ECHO_CMD} "@unexec install-info --quiet --delete %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
5506 >> ${TMPPLIST}
5507 @${LS} ${TARGETDIR}/${INFO_PATH}/$i.info* | ${SED} -e s:${TARGETDIR}/::g >> ${TMPPLIST}
5508 @${ECHO_CMD} "@exec install-info --quiet %D/${INFO_PATH}/$i.info %D/${INFO_PATH}/dir" \
5509 >> ${TMPPLIST}
5510 @if [ "`${DIRNAME} $i`" != "." ]; then \
5511 ${ECHO_CMD} "@unexec ${RMDIR} %D/info/`${DIRNAME} $i` 2> /dev/null || true" >> ${TMPPLIST}; \
5512 fi
5513 .endfor
5514 .if (${PREFIX} != "/usr")
5515 @${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST}
5516 .if (${PREFIX} != ${LOCALBASE_REL} && ${PREFIX} != ${X11BASE_REL} && ${PREFIX} != ${LINUXBASE_REL})
5517 @${ECHO_CMD} "@unexec rmdir %D/info 2> /dev/null || true" >> ${TMPPLIST}
5518 .endif
5519 .endif
5520 .endif
5521 .endif
5522
5523 # If we're installing into a non-standard PREFIX, we need to remove that directory at
5524 # deinstall-time
5525 .if !target(add-plist-post)
5526 add-plist-post:
5527 .if (${PREFIX} != ${LOCALBASE_REL} && ${PREFIX} != ${X11BASE_REL} && ${PREFIX} != ${LINUXBASE_REL} && ${PREFIX} != "/usr")
5528 @${ECHO_CMD} "@unexec rmdir %D 2> /dev/null || true" >> ${TMPPLIST}
5529 .else
5530 @${DO_NADA}
5531 .endif
5532 .endif
5533
5534
5535 # TODO -- this does not work with fake correctly.
5536 .if !target(install-rc-script)
5537 install-rc-script:
5538 .if defined(USE_RCORDER) || defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
5539 .if defined(USE_RCORDER)
5540 @${ECHO_MSG} "===> Installing early rc.d startup script(s)"
5541 @${ECHO_CMD} "@cwd /" >> ${TMPPLIST}
5542 @for i in ${USE_RCORDER}; do \
5543 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${DESTDIR}/etc/rc.d/$${i%.sh}; \
5544 ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5545 done
5546 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
5547 .endif
5548 .if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
5549 @${ECHO_MSG} "===> Installing rc.d startup script(s)"
5550 @${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
5551 .if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101 ))
5552 @for i in ${USE_RC_SUBR}; do \
5553 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${TARGETDIR}/etc/rc.d/$${i%.sh}; \
5554 ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
5555 done
5556 .else
5557 @for i in ${USE_RC_SUBR}; do \
5558 ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${TARGETDIR}/etc/rc.d/$${i%.sh}.sh; \
5559 ${ECHO_CMD} "etc/rc.d/$${i%.sh}.sh" >> ${TMPPLIST}; \
5560 done
5561 .endif
5562 .endif
5563 .else
5564 @${DO_NADA}
5565 .endif
5566 .endif
5567
5568 # Compress (or uncompress) and symlink manpages.
5569 .if !target(compress-man)
5570 compress-man:
5571 . if defined(_FAKEMAN) || defined(_MLINKS)
5572 . if ${MANCOMPRESSED} == yes && defined(NOMANCOMPRESS)
5573 @${ECHO_MSG} "===> Uncompressing manual pages for ${PKGNAME}"
5574 @_manpages='${_FAKEMAN:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GUNZIP_CMD} $${_manpages} ) || ${TRUE}
5575 . elif ${MANCOMPRESSED} == no && !defined(NOMANCOMPRESS)
5576 @${ECHO_MSG} "===> Compressing manual pages for ${PKGNAME}"
5577 @_manpages='${_FAKEMAN:S/'/'\''/g}' && [ "$${_manpages}" != "" ] && ( eval ${GZIP_CMD} $${_manpages} ) || ${TRUE}
5578 . endif
5579 . if defined(_MLINKS)
5580 @set -- ${_MLINKS}; \
5581 while :; do \
5582 [ $$# -eq 0 ] && break || ${TRUE}; \
5583 ${RM} -f $${2%.gz}; ${RM} -f $$2.gz; \
5584 ${LN} -fs `${ECHO_CMD} $$1 $$2 | ${AWK} '{ \
5585 z=split($$1, a, /\//); x=split($$2, b, /\//); \
5586 while (a[i] == b[i]) i++; \
5587 for (q=i; q<x; q++) printf "../"; \
5588 for (; i<z; i++) printf a[i] "/"; printf a[z]; }'` $$2; \
5589 shift; shift; \
5590 done
5591 . endif
5592 . else
5593 @${DO_NADA}
5594 .endif
5595 .endif
5596
5597 # Depend is generally meaningless for arbitrary ports, but if someone wants
5598 # one they can override this. This is just to catch people who've gotten into
5599 # the habit of typing `make depend all install' as a matter of course.
5600 #
5601 .if !target(depend)
5602 depend:
5603 .endif
5604
5605 # Same goes for tags
5606 .if !target(tags)
5607 tags:
5608 .endif
5609
5610 .if !defined(NOPRECIOUSSOFTMAKEVARS)
5611 .for softvar in CKSUMFILES _MLINKS
5612 .if defined(${softvar})
5613 __softMAKEFLAGS+= '${softvar}+=${${softvar}:S/'/'\''/g}'
5614 .endif
5615 .endfor
5616 .endif
5617
5618 .if !defined(NOPRECIOUSMAKEVARS)
5619 # These won't change, so we can pass them through the environment
5620 .MAKEFLAGS: \
5621 ARCH="${ARCH:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5622 OPSYS="${OPSYS:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5623 OSREL="${OSREL:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5624 OSVERSION="${OSVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5625 PORTOBJFORMAT="${PORTOBJFORMAT:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}" \
5626 SYSTEMVERSION="${SYSTEMVERSION:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}"
5627 .endif
5628
5629 .if !target(config)
5630 config:
5631 .if !defined(OPTIONS)
5632 @${ECHO_MSG} "===> No options to configure"
5633 .else
5634 .if ${OPTIONSFILE} != ${_OPTIONSFILE}
5635 @${ECHO_MSG} "===> Using wrong configuration file ${_OPTIONSFILE}"
5636 @exit 1
5637 .endif
5638 .if ${UID} != 0 && !defined(INSTALL_AS_USER)
5639 @${ECHO_MSG} "===> Switching to root credentials to create `${DIRNAME} ${_OPTIONSFILE}`"
5640 @(${SU_CMD} "${SH} -c \"${MKDIR} `${DIRNAME} ${_OPTIONSFILE}` 2> /dev/null\"") || \
5641 (${ECHO_MSG} "===> Cannot create `${DIRNAME} ${_OPTIONSFILE}`, check permissions"; exit 1)
5642 @${ECHO_MSG} "===> Returning to user credentials"
5643 .else
5644 @(${MKDIR} `${DIRNAME} ${_OPTIONSFILE}` 2> /dev/null) || \
5645 (${ECHO_MSG} "===> Cannot create `${DIRNAME} ${_OPTIONSFILE}`, check permissions"; exit 1)
5646 .endif
5647 -@if [ -e ${_OPTIONSFILE} ]; then \
5648 . ${_OPTIONSFILE}; \
5649 fi; \
5650 set -- ${OPTIONS} XXX; \
5651 while [ $$# -gt 3 ]; do \
5652 OPTIONSLIST="$${OPTIONSLIST} $$1"; \
5653 defaultval=$$3; \
5654 withvar=WITH_$$1; \
5655 withoutvar=WITHOUT_$$1; \
5656 withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \
5657 withoutval=$$(eval ${ECHO_CMD} $$\{$${withoutvar}\}); \
5658 if [ ! -z "$${withval}" ]; then \
5659 val=on; \
5660 elif [ ! -z "$${withoutval}" ]; then \
5661 val=off; \
5662 else \
5663 val=$$3; \
5664 fi; \
5665 DEFOPTIONS="$${DEFOPTIONS} $$1 \"$$2\" $${val}"; \
5666 shift 3; \
5667 done; \
5668 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
5669 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
5670 ${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \
5671 status=$$?; \
5672 if [ $${status} -ne 0 ] ; then \
5673 ${RM} -f $${TMPOPTIONSFILE}; \
5674 ${ECHO_MSG} "===> Options unchanged"; \
5675 exit 0; \
5676 fi; \
5677 if [ ! -e ${TMPOPTIONSFILE} ]; then \
5678 ${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \
5679 exit 0; \
5680 fi; \
5681 SELOPTIONS=$$(${CAT} $${TMPOPTIONSFILE}); \
5682 ${RM} -f $${TMPOPTIONSFILE}; \
5683 TMPOPTIONSFILE=$$(mktemp -t portoptions); \
5684 trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \
5685 ${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
5686 ${ECHO_CMD} "# No user-servicable parts inside!" >> $${TMPOPTIONSFILE}; \
5687 ${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
5688 ${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
5689 for i in $${OPTIONSLIST}; do \
5690 ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; \
5691 if [ $$? -eq 0 ]; then \
5692 ${ECHO_CMD} WITH_$${i}=true >> $${TMPOPTIONSFILE}; \
5693 else \
5694 ${ECHO_CMD} WITHOUT_$${i}=true >> $${TMPOPTIONSFILE}; \
5695 fi; \
5696 done; \
5697 if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
5698 ${ECHO_MSG} "===> Switching to root credentials to write ${_OPTIONSFILE}"; \
5699 ${SU_CMD} "${CAT} $${TMPOPTIONSFILE} > ${_OPTIONSFILE}"; \
5700 ${ECHO_MSG} "===> Returning to user credentials"; \
5701 else \
5702 ${CAT} $${TMPOPTIONSFILE} > ${_OPTIONSFILE}; \
5703 fi; \
5704 ${RM} -f $${TMPOPTIONSFILE}
5705 .endif
5706 .endif
5707
5708 .if !target(config-recursive)
5709 config-recursive:
5710 @${ECHO_MSG} "===> Setting user-specified options for ${PKGNAME} and dependencies";
5711 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5712 (cd $$dir; ${MAKE} config-conditional); \
5713 done
5714 .endif
5715
5716 .if !target(config-conditional)
5717 config-conditional:
5718 .if defined(OPTIONS) && !exists(${_OPTIONSFILE})
5719 cd ${.CURDIR} && ${MAKE} config;
5720 .endif
5721 .endif
5722
5723 .if !target(showconfig)
5724 showconfig:
5725 .if defined(OPTIONS)
5726 @${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}:"
5727 -@if [ -e ${_OPTIONSFILE} ]; then \
5728 . ${_OPTIONSFILE}; \
5729 fi; \
5730 set -- ${OPTIONS} XXX; \
5731 while [ $$# -gt 3 ]; do \
5732 defaultval=$$3; \
5733 withvar=WITH_$$1; \
5734 withoutvar=WITHOUT_$$1; \
5735 withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \
5736 withoutval=$$(eval ${ECHO_CMD} $$\{$${withoutvar}\}); \
5737 if [ ! -z "$${withval}" ]; then \
5738 val=on; \
5739 elif [ ! -z "$${withoutval}" ]; then \
5740 val=off; \
5741 else \
5742 val="$$3 (default)"; \
5743 fi; \
5744 ${ECHO_MSG} " $$1=$${val} \"$$2\""; \
5745 shift 3; \
5746 done
5747 @${ECHO_MSG} "===> Use 'make config' to modify these settings"
5748 .endif
5749 .endif
5750
5751 .if !target(rmconfig)
5752 rmconfig:
5753 .if defined(OPTIONS) && exists(${_OPTIONSFILE})
5754 -@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; \
5755 if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
5756 ${ECHO_MSG} "===> Switching to root credentials to remove ${_OPTIONSFILE} and `${DIRNAME} ${_OPTIONSFILE}`"; \
5757 ${SU_CMD} "${RM} -f ${_OPTIONSFILE} ; \
5758 ${RMDIR} `${DIRNAME} ${_OPTIONSFILE}`"; \
5759 ${ECHO_MSG} "===> Returning to user credentials"; \
5760 else \
5761 ${RM} -f ${_OPTIONSFILE}; \
5762 ${RMDIR} `${DIRNAME} ${_OPTIONSFILE}`; \
5763 fi
5764 .else
5765 @${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
5766 .endif
5767 .endif
5768
5769 .if !target(rmconfig-recursive)
5770 rmconfig-recursive:
5771 @${ECHO_MSG} "===> Removing user-specified options for ${PKGNAME} and dependencies";
5772 @for dir in ${.CURDIR} $$(${ALL-DEPENDS-LIST}); do \
5773 (cd $$dir; ${MAKE} rmconfig); \
5774 done
5775 .endif
5776
5777 desktop-categories:
5778 @categories=""; \
5779 for native_category in ${CATEGORIES}; do \
5780 c=""; \
5781 case $$native_category in \
5782 accessibility) c="Accessibility Utility" ;; \
5783 archivers) c="Archiving" ;; \
5784 astro) c="Astronomy Science Education" ;; \
5785 audio) c="Audio AudioVideo" ;; \
5786 benchmarks) c="System" ;; \
5787 biology) c="Biology Science Education" ;; \
5788 cad) c="Engineering" ;; \
5789 databases) c="Database" ;; \
5790 deskutils) c="Utility" ;; \
5791 devel) c="Development" ;; \
5792 dns) c="Network" ;; \
5793 elisp) c="Development" ;; \
5794 emulators) c="Emulator" ;; \
5795 finance) c="Finance Office" ;; \
5796 ftp) c="FileTransfer Network" ;; \
5797 games) c="Game" ;; \
5798 gnome) c="GNOME GTK" ;; \
5799 graphics) c="Graphics" ;; \
5800 hamradio) c="HamRadio" ;; \
5801 haskell) c="Development" ;; \
5802 ipv6) c="Network" ;; \
5803 irc) c="IRCClient Network" ;; \
5804 java) c="Java Development" ;; \
5805 kde) c="KDE QT" ;; \
5806 lang) c="Development" ;; \
5807 lisp) c="Development" ;; \
5808 mail) c="Email Office Network" ;; \
5809 mbone) c="Network AudioVideo" ;; \
5810 multimedia) c="AudioVideo" ;; \
5811 net) c="Network" ;; \
5812 net-im) c="InstantMessaging Network" ;; \
5813 net-mgmt) c="Network" ;; \
5814 net-p2p) c="P2P Network" ;; \
5815 news) c="News" ;; \
5816 pear) c="WebDevelopment Development" ;; \
5817 perl5) c="Development" ;; \
5818 python) c="Development" ;; \
5819 ruby) c="Development" ;; \
5820 rubygems) c="Development" ;; \
5821 scheme) c="Development" ;; \
5822 science) c="Science Education" ;; \
5823 security) c="Security System" ;; \
5824 shells) c="Shell" ;; \
5825 sysutils) c="System Utility" ;; \
5826 tcl*|tk*) c="Development" ;; \
5827 www) c="Network" ;; \
5828 x11-clocks) c="Clock Utility" ;; \
5829 x11-fm) c="FileManager" ;; \
5830 xfce) c="GTK" ;; \
5831 zope) c="WebDevelopment Development" ;; \
5832 esac; \
5833 if [ -n "$$c" ]; then \
5834 categories="$$categories $$c"; \
5835 fi; \
5836 done; \
5837 if [ -n "$$categories" ]; then \
5838 for c in Application $$categories; do ${ECHO_MSG} "$$c"; done \
5839 | ${SORT} -u | ${TR} '\n' ';'; \
5840 ${ECHO_MSG}; \
5841 fi
5842
5843 VALID_DESKTOP_CATEGORIES+= Application Core Development Building Debugger IDE \
5844 GUIDesigner Profiling RevisionControl Translation Office Calendar \
5845 ContactManagement Database Dictionary Chart Email Finance FlowChart PDA \
5846 ProjectManagement Presentation Spreadsheet WordProcessor Graphics \
5847 2DGraphics VectorGraphics RasterGraphics 3DGraphics Scanning OCR \
5848 Photography Viewer Settings DesktopSettings HardwareSettings \
5849 PackageManager Network Dialup InstantMessaging IRCClient FileTransfer \
5850 HamRadio News P2P RemoteAccess Telephony WebBrowser WebDevelopment \
5851 AudioVideo Audio Midi Mixer Sequencer Tuner Video TV AudioVideoEditing \
5852 Player Recorder DiscBurning Game ActionGame AdventureGame ArcadeGame \
5853 BoardGame BlocksGame CardGame KidsGame LogicGame RolePlaying Simulation \
5854 SportsGame StrategyGame Education Art Construction Music Languages \
5855 Science Astronomy Biology Chemistry Geology Math MedicalSoftware Physics \
5856 Teaching Amusement Applet Archiving Electronics Emulator Engineering \
5857 FileManager Shell Screensaver TerminalEmulator TrayIcon System Filesystem \
5858 Monitor Security Utility Accessibility Calculator Clock TextEditor KDE \
5859 GNOME GTK Qt Motif Java ConsoleOnly AdvancedSettings
5860
5861 check-desktop-entries:
5862 .if defined(DESKTOP_ENTRIES)
5863 @set -- ${DESKTOP_ENTRIES} XXX; \
5864 if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
5865 ${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
5866 exit 1; \
5867 fi; \
5868 num=1; \
5869 while [ $$# -gt 6 ]; do \
5870 entry="#$$num"; \
5871 if [ -n "$$4" ]; then \
5872 entry="$$entry ($$4)"; \
5873 elif [ -n "$$1" ]; then \
5874 entry="$$entry ($$1)"; \
5875 fi; \
5876 if [ -z "$$1" ]; then \
5877 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
5878 exit 1; \
5879 fi; \
5880 if [ -z "$$4" ]; then \
5881 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
5882 exit 1; \
5883 fi; \
5884 if [ -n "$$5" ]; then \
5885 for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
5886 if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
5887 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: category $$c is not a valid desktop category"; \
5888 exit 1; \
5889 fi; \
5890 done; \
5891 if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
5892 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
5893 exit 1; \
5894 fi; \
5895 else \
5896 if [ -z "`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} desktop-categories`" ]; then \
5897 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
5898 exit 1; \
5899 fi; \
5900 fi; \
5901 if [ -z "$$6" ]; then \
5902 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is empty"; \
5903 exit 1; \
5904 fi; \
5905 if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ]; then \
5906 ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\" or \"false\""; \
5907 exit 1; \
5908 fi; \
5909 shift 6; \
5910 num=`${EXPR} $$num + 1`; \
5911 done
5912 .else
5913 @${DO_NADA}
5914 .endif
5915
5916 .if !target(install-desktop-entries)
5917 install-desktop-entries:
5918 .if defined(DESKTOP_ENTRIES)
5919 @(${MKDIR} "${DESKTOPDIR}" 2> /dev/null) || \
5920 (${ECHO_MSG} "===> Cannot create ${DESKTOPDIR}, check permissions"; exit 1)
5921 @set -- ${DESKTOP_ENTRIES} XXX; \
5922 if [ -z "${_DESKTOPDIR_REL}" ]; then \
5923 ${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \
5924 fi; \
5925 while [ $$# -gt 6 ]; do \
5926 filename="$$4.desktop"; \
5927 pathname="${DESKTOPDIR}/$$filename"; \
5928 categories="$$5"; \
5929 if [ -z "$$categories" ]; then \
5930 categories="`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} desktop-categories`"; \
5931 fi; \
5932 ${ECHO_CMD} "${_DESKTOPDIR_REL}$$filename" >> ${TMPPLIST}; \
5933 ${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
5934 ${ECHO_CMD} "Type=Application" >> $$pathname; \
5935 ${ECHO_CMD} "Version=0.9.4" >> $$pathname; \
5936 ${ECHO_CMD} "Encoding=UTF-8" >> $$pathname; \
5937 ${ECHO_CMD} "Name=$$1" >> $$pathname; \
5938 if [ -n "$$2" ]; then \
5939 ${ECHO_CMD} "Comment=$$2" >> $$pathname; \
5940 fi; \
5941 if [ -n "$$3" ]; then \
5942 ${ECHO_CMD} "Icon=$$3" >> $$pathname; \
5943 fi; \
5944 ${ECHO_CMD} "Exec=$$4" >> $$pathname; \
5945 ${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
5946 ${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
5947 shift 6; \
5948 done; \
5949 ${ECHO_CMD} "@unexec rmdir ${DESKTOPDIR} 2>/dev/null || true" >> ${TMPPLIST}; \
5950 if [ -z "${_DESKTOPDIR_REL}" ]; then \
5951 ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \
5952 fi
5953 .else
5954 @${DO_NADA}
5955 .endif
5956 .endif
5957
5958 .endif
5959 # End of post-makefile section.

Properties

Name Value
cvs2svn:cvs-rev 1.9