Annotation of src/share/mk/bsd.port.mk, Revision 1.85
1.9 imp 1: #-*- mode: Fundamental; tab-width: 4; -*-
2: # ex:ts=4
1.85 ! espie 3: # $OpenBSD: bsd.port.mk,v 1.84 1999/04/10 07:48:53 marc Exp $
1.1 niklas 4: #
5: # bsd.port.mk - 940820 Jordan K. Hubbard.
6: # This file is in the public domain.
7: #
1.13 imp 8: # FreeBSD Id: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp
1.44 marc 9: # $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
1.6 niklas 10: #
1.1 niklas 11: # Please view me with 4 column tabs!
12:
1.13 imp 13: # There are two different types of "maintainers" in the whole ports
14: # framework concept. Maintainers of the bsd.port*.mk files
1.32 marc 15: # are listed below in the ${OPSYS}_MAINTAINER entries (this file
1.13 imp 16: # is used by multiple *BSD flavors). You should consult them directly
17: # if you have any questions/suggestions regarding this file since only
18: # they are allowed to modify the master copies in the CVS repository!
19:
20: # For each port, the MAINTAINER variable is what you should consult for
21: # contact information on the person(s) to contact if you have questions/
22: # suggestions about that specific port. By default (if no MAINTAINER
1.58 pattonme 23: # is listed), a port is maintained by the subscribers of the ports@openbsd.org
24: # mailing list, and any correspondence should be directed there.
1.9 imp 25: #
1.30 marc 26: OpenBSD_MAINTAINER= marc@OpenBSD.ORG
1.55 espie 27:
28: # NEED_VERSION: we need at least this version of bsd.port.mk for this
29: # port to build
30:
1.85 ! espie 31: FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.84 1999/04/10 07:48:53 marc Exp $$
1.55 espie 32: .if defined(NEED_VERSION)
1.67 espie 33: _VERSION_REVISION=${FULL_REVISION:M[0-9]*.*}
1.55 espie 34:
1.67 espie 35: _VERSION=${_VERSION_REVISION:C/\..*//}
36: _REVISION=${_VERSION_REVISION:C/.*\.//}
1.55 espie 37:
1.67 espie 38: _VERSION_NEEDED=${NEED_VERSION:C/\..*//}
39: _REVISION_NEEDED=${NEED_VERSION:C/.*\.//}
1.55 espie 40:
41: .BEGIN:
1.67 espie 42: @if [ ${_VERSION_NEEDED} -gt ${_VERSION} -o \
43: ${_VERSION_NEEDED} -eq ${_VERSION} -a \
44: ${_REVISION_NEEDED} -gt ${_REVISION} ]; \
1.55 espie 45: then \
46: ${ECHO} "Need version ${NEED_VERSION} of bsd.port.mk"; \
47: ${FALSE}; \
48: fi;
49:
50: .endif
1.1 niklas 51:
52: # Supported Variables and their behaviors:
53: #
54: # Variables that typically apply to all ports:
55: #
1.44 marc 56: # ONLY_FOR_ARCHS - If a port only makes sense to certain architectures, this
1.10 niklas 57: # is a list containing the names for them. It is checked
1.44 marc 58: # against the predefined ${MACHINE_ARCH} value
1.58 pattonme 59: # ARCH - The architecture (default: "uname -m").
60: # OPSYS - The operating system (default: "uname -s").
61: # OPSYS_VER - The current version of the operating system
62: # (default: "uname -r").
63: # PORTSDIR - The root of the ports tree. Defaults: /usr/ports
64: # DISTDIR - Where to get gzip'd, tarballed copies of original sources.
1.9 imp 65: # (default: ${PORTSDIR}/distfiles).
1.1 niklas 66: # PREFIX - Where to install things in general (default: /usr/local).
67: # MASTER_SITES - Primary location(s) for distribution files if not found
1.9 imp 68: # locally.
1.44 marc 69: # MASTER_SITE_SUBDIR - Directory that "%SUBDIR%" in MASTER_SITES is
70: # replaced by.
1.1 niklas 71: # PATCH_SITES - Primary location(s) for distribution patch files
1.9 imp 72: # (see PATCHFILES below) if not found locally.
1.44 marc 73: # PATCH_SITE_SUBDIR - Directory that "%SUBDIR%" in PATCH_SITES is
74: # replaced by.
1.1 niklas 75: #
1.9 imp 76: # MASTER_SITE_BACKUP - Backup location(s) for distribution files and patch
77: # files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
78: # (default:
1.27 marc 79: # ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/
1.34 marc 80: # ftp://ftp.openbsd.org/pub/OpenBSD/licensed/${DIST_SUBDIR}/
1.9 imp 81: # ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/)
1.1 niklas 82: # MASTER_SITE_OVERRIDE - If set, override the MASTER_SITES setting with this
83: # value.
1.27 marc 84: # MASTER_SITE_OPENBSD - If set, only use ftp.openbsd.org as the
85: # MASTER_SITE_OVERRIDE.
1.1 niklas 86: # PACKAGES - A top level directory where all packages go (rather than
87: # going locally to each port). (default: ${PORTSDIR}/packages).
1.52 espie 88: # GMAKE - Set to path of GNU make if not in $PORTPATH (default: gmake).
89: # XMKMF - Set to path of `xmkmf' if not in $PORTPATH
90: # (default: xmkmf -a ).
1.1 niklas 91: # MAINTAINER - The e-mail address of the contact person for this port
1.58 pattonme 92: # Defaults: ports@OpenBSD.ORG
1.9 imp 93: # CATEGORIES - A list of descriptive categories into which this port falls.
1.14 niklas 94: # WRKOBJDIR - A top level directory where, if defined, the separate working
95: # directories will get created, and symbolically linked to from
96: # ${WRKDIR} (see below). This is useful for building ports on
97: # several architectures, then ${PORTSDIR} can be NFS-mounted
1.62 marc 98: # while ${WRKOBJDIR} is local to every arch
1.75 espie 99: # PREFERRED_CIPHERS
100: # - a list of the form cipher.sig of programs to use to check
101: # recorded checksums, in order of decreasing trust.
102: # (default to using sha1, then rmd160, then md5).
1.1 niklas 103: #
104: # Variables that typically apply to an individual port. Non-Boolean
105: # variables without defaults are *mandatory*.
106: #
107: # WRKDIR - A temporary working directory that gets *clobbered* on clean
108: # (default: ${.CURDIR}/work).
109: # WRKSRC - A subdirectory of ${WRKDIR} where the distribution actually
110: # unpacks to. (Default: ${WRKDIR}/${DISTNAME} unless
111: # NO_WRKSUBDIR is set, in which case simply ${WRKDIR}).
1.60 rohee 112: # WRKBUILD - The directory where the port is actually built, useful for
113: # ports that need a separate directory (default: ${WRKSRC}).
114: # This is intended for GNU configure.
1.71 espie 115: # SEPARATE_BUILD
116: # - define if the port can build in directory separate from
117: # WRKSRC. This redefines WRKBUILD to be arch-dependent,
118: # along with the configure, build and install cookies
1.1 niklas 119: # DISTNAME - Name of port or distribution.
120: # DISTFILES - Name(s) of archive file(s) containing distribution
121: # (default: ${DISTNAME}${EXTRACT_SUFX}).
1.85 ! espie 122: # SUPDISTFILES - Names of supplementary archive files that don't get
! 123: # used all the time (default: empty).
1.1 niklas 124: # PATCHFILES - Name(s) of additional files that contain distribution
125: # patches (default: none). make will look for them at
126: # PATCH_SITES (see above). They will automatically be
127: # uncompressed before patching if the names end with
128: # ".gz" or ".Z".
1.85 ! espie 129: # SUPPATCHFILES - Names of supplementary patch files that don't get
! 130: # used all the time (default: empty).
1.9 imp 131: # DIST_SUBDIR - Suffix to ${DISTDIR}. If set, all ${DISTFILES}
1.1 niklas 132: # and ${PATCHFILES} will be put in this subdirectory of
133: # ${DISTDIR}. Also they will be fetched in this subdirectory
134: # from FreeBSD mirror sites.
1.9 imp 135: # ALLFILES - All of ${DISTFILES} and ${PATCHFILES}.
1.58 pattonme 136: # MIRROR_DISTFILE - Whether the distfile is redistributable without restrictions.
137: # Defaults to "yes", set this to "no" if restrictions exist.
1.9 imp 138: # IGNOREFILES - If some of the ${ALLFILES} are not checksum-able, set
139: # this variable to their names.
1.1 niklas 140: # PKGNAME - Name of the package file to create if the DISTNAME
141: # isn't really relevant for the port/package
142: # (default: ${DISTNAME}).
143: # EXTRACT_ONLY - If defined, a subset of ${DISTFILES} you want to
144: # actually extract.
145: # PATCHDIR - A directory containing any additional patches you made
1.50 espie 146: # to port this software to OpenBSD (default:
1.1 niklas 147: # ${.CURDIR}/patches)
1.50 espie 148: # PATCH_LIST - list of patches to apply, can include wildcards (default:
149: # patch-*)
1.1 niklas 150: # SCRIPTDIR - A directory containing any auxiliary scripts
151: # (default: ${.CURDIR}/scripts)
152: # FILESDIR - A directory containing any miscellaneous additional files.
153: # (default: ${.CURDIR}/files)
154: # PKGDIR - A direction containing any package creation files.
155: # (default: ${.CURDIR}/pkg)
156: # PKG_DBDIR - Where package installation is recorded (default: /var/db/pkg)
157: # FORCE_PKG_REGISTER - If set, it will overwrite any existing package
158: # registration information in ${PKG_DBDIR}/${PKGNAME}.
159: # NO_MTREE - If set, will not invoke mtree from bsd.port.mk from
1.13 imp 160: # the "install" target.
161: # MTREE_FILE - The name of the mtree file (default: /etc/mtree/BSD.x11.dist
162: # if USE_IMAKE or USE_X11 is set, /etc/mtree/BSD.local.dist
163: # otherwise.)
1.26 marc 164: # COMES_WITH - The first version that a port was made part of the
165: # standard OpenBSD distribution. If the current OpenBSD
166: # version is >= this version then a notice will be
167: # displayed instead the port being generated.
1.1 niklas 168: #
1.6 niklas 169: # NO_BUILD - Use a dummy (do-nothing) build target.
170: # NO_CONFIGURE - Use a dummy (do-nothing) configure target.
1.9 imp 171: # NO_CDROM - Port may not go on CDROM. Set this string to reason.
1.6 niklas 172: # NO_DESCRIBE - Use a dummy (do-nothing) describe target.
1.1 niklas 173: # NO_EXTRACT - Use a dummy (do-nothing) extract target.
1.6 niklas 174: # NO_INSTALL - Use a dummy (do-nothing) install target.
1.1 niklas 175: # NO_PACKAGE - Use a dummy (do-nothing) package target.
1.6 niklas 176: # NO_PKG_REGISTER - Don't register a port install as a package.
1.1 niklas 177: # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}.
178: # NO_WRKDIR - There's no work directory at all; port does this someplace
179: # else.
180: # NO_DEPENDS - Don't verify build of dependencies.
1.44 marc 181: # NOCLEANDEPENDS - Don't nuke dependent dirs on make clean (Default: yes)
1.9 imp 182: # BROKEN - Port is broken. Set this string to the reason why.
1.1 niklas 183: # RESTRICTED - Port is restricted. Set this string to the reason why.
184: # USE_GMAKE - Says that the port uses gmake.
1.52 espie 185: #
186: # XXX: cygnus products do NOT use autoconf for making its main
187: # configure from configure.in
188: # USE_AUTOCONF - Says that the port uses autoconf (implies GNU_CONFIGURE).
189: # AUTOCONF_DIR - Where to apply autoconf (default: ${WRKSRC}).
1.13 imp 190: # USE_PERL5 - Says that the port uses perl5 for building and running.
1.1 niklas 191: # USE_IMAKE - Says that the port uses imake.
1.13 imp 192: # USE_X11 - Says that the port uses X11 (i.e., installs in ${X11BASE}).
1.47 espie 193: # USE_EGCC - Says that the port needs the egcs C compiler
194: # USE_EGXX - Says that the port needs the egcs C++ compiler
1.1 niklas 195: # NO_INSTALL_MANPAGES - For imake ports that don't like the install.man
196: # target.
197: # HAS_CONFIGURE - Says that the port has its own configure script.
198: # GNU_CONFIGURE - Set if you are using GNU configure (optional).
199: # CONFIGURE_SCRIPT - Name of configure script, defaults to 'configure'.
200: # CONFIGURE_ARGS - Pass these args to configure if ${HAS_CONFIGURE} is set.
1.73 marc 201: # CONFIGURE_SHARED - An argument to GNU configure that expands to
202: # --enable-shared for those architectures that support
203: # shared libraries and --disable-shared for architectures
204: # that do not support shared libraries.
1.13 imp 205: # CONFIGURE_ENV - Pass these env (shell-like) to configure if
1.1 niklas 206: # ${HAS_CONFIGURE} is set.
1.13 imp 207: # SCRIPTS_ENV - Additional environment vars passed to scripts in
208: # ${SCRIPTDIR} executed by bsd.port.mk.
209: # MAKE_ENV - Additional environment vars passed to sub-make in build
210: # stage.
1.1 niklas 211: # IS_INTERACTIVE - Set this if your port needs to interact with the user
212: # during a build. User can then decide to skip this port by
213: # setting ${BATCH}, or compiling only the interactive ports
214: # by setting ${INTERACTIVE}.
1.7 niklas 215: # FETCH_DEPENDS - A list of "path:dir" pairs of other ports this
216: # package depends in the "fetch" stage. "path" is the
217: # name of a file if it starts with a slash (/), an
218: # executable otherwise. make will test for the
219: # existence (if it is a full pathname) or search for
1.52 espie 220: # it in $PORTPATH (if it is an executable) and go
1.7 niklas 221: # into "dir" to do a "make all install" if it's not
222: # found.
223: # BUILD_DEPENDS - A list of "path:dir" pairs of other ports this
224: # package depends to build (between the "extract" and
225: # "build" stages, inclusive). The test done to
226: # determine the existence of the dependency is the
227: # same as FETCH_DEPENDS.
228: # RUN_DEPENDS - A list of "path:dir" pairs of other ports this
229: # package depends to run. The test done to determine
230: # the existence of the dependency is the same as
231: # FETCH_DEPENDS. This will be checked during the
232: # "install" stage and the name of the dependency will
233: # be put into the package as well.
1.1 niklas 234: # LIB_DEPENDS - A list of "lib:dir" pairs of other ports this package
235: # depends on. "lib" is the name of a shared library.
236: # make will use "ldconfig -r" to search for the
1.44 marc 237: # library. Note that lib can be any regular expression.
238: # In older versions of this file, you need two backslashes
239: # in front of dots (.) to supress its special meaning (e.g.,
240: # use "foo\\.2\\.:${PORTSDIR}/utils/foo" to match "libfoo.2.*").
241: # No special backslashes are needed to escape regular
242: # expression metacharacters in OpenBSD, and the old backslash
243: # escapes are recognised for backwards compatibility.
1.1 niklas 244: # DEPENDS - A list of other ports this package depends on being
245: # made first. Use this for things that don't fall into
246: # the above two categories.
247: # EXTRACT_CMD - Command for extracting archive (default: tar).
248: # EXTRACT_SUFX - Suffix for archive names (default: .tar.gz).
249: # EXTRACT_BEFORE_ARGS -
250: # Arguments to ${EXTRACT_CMD} before filename
1.13 imp 251: # (default: -xzf).
1.1 niklas 252: # EXTRACT_AFTER_ARGS -
253: # Arguments to ${EXTRACT_CMD} following filename
254: # (default: none).
255: #
1.52 espie 256: # FETCH_CMD - Full path to ftp/http fetch command if not in $PORTPATH
1.44 marc 257: # (default: /usr/bin/ftp).
1.6 niklas 258: # FETCH_BEFORE_ARGS -
259: # Arguments to ${FETCH_CMD} before filename (default: none).
260: # FETCH_AFTER_ARGS -
261: # Arguments to ${FETCH_CMD} following filename (default: none).
1.44 marc 262: # NO_IGNORE - Set this to YES (most probably in a "make fetch" in
263: # ${PORTSDIR}) if you want to fetch all distfiles,
264: # even for packages not built due to limitation by
265: # absent X or Motif or ONLY_FOR_ARCHS...
1.54 marc 266: # NO_WARNINGS - Set this to YES to disable warnings regarding variables
267: # to define to control the build. Automatically set
268: # from the "mirror-distfiles" target.
1.44 marc 269: # ALL_TARGET - The target to pass to make in the package when building.
270: # (default: "all")
271: # INSTALL_TARGET- The target to pass to make in the package when installing.
272: # (default: "install")
1.1 niklas 273: #
274: # Motif support:
275: #
1.56 form 276: # USE_MOTIF - Set this in your port if it requires Motif or Lesstif.
277: # It will be built using Lesstif port unless Motif libraries
278: # found or HAVE_MOTIF is defined. See also REQUIRES_MOTIF.
1.49 form 279: #
1.56 form 280: # REQUIRES_MOTIF- Set this in your port if it requires Motif. It will be
1.1 niklas 281: # built only if HAVE_MOTIF is set.
1.58 pattonme 282: # HAVE_MOTIF - If set, means system has Motif. Typically set in /etc/mk.conf.
1.1 niklas 283: # MOTIF_STATIC - If set, link libXm statically; otherwise, link it
1.58 pattonme 284: # dynamically. Typically set in /etc/mk.conf.
1.6 niklas 285: # MOTIFLIB - Set automatically to appropriate value depending on
286: # ${MOTIF_STATIC}. Substitute references to -lXm with
287: # patches to make your port conform to our standards.
1.13 imp 288: # MOTIF_ONLY - If set, build Motif ports only. (Not much use except for
289: # building packages.)
1.1 niklas 290: #
291: # Variables to change if you want a special behavior:
292: #
293: # ECHO_MSG - Used to print all the '===>' style prompts - override this
294: # to turn them off (default: /bin/echo).
1.13 imp 295: # DEPENDS_TARGET - The target to execute when a port is calling a
296: # dependency (default: "install").
1.6 niklas 297: # PATCH_DEBUG - If set, print out more information about the patches as
298: # it attempts to apply them.
299: #
1.9 imp 300: # Variables that serve as convenient "aliases" for your *-install targets.
301: # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
1.6 niklas 302: #
1.44 marc 303: # INSTALL_PROGRAM - A command to install binary executables.
304: # INSTALL_SCRIPT - A command to install executable scripts.
305: # INSTALL_DATA - A command to install sharable data.
306: # INSTALL_MAN - A command to install manpages (doesn't compress).
307: # INSTALL_PROGRAM_DIR - Create a directory for storing programs
308: # INSTALL_SCRIPT_DIR - Create a directory for storing scripts (alias for
309: # (INSTALL_PROGRAM_DIR)
310: # INSTALL_DATA_DIR - Create a directory for storing arbitrary data
311: # INSTALL_MAN_DIR - Create a directory for storing man pages
312: #
313: # It is assumed that the port installs manpages uncompressed. If this is
314: # not the case, set MANCOMPRESSED in the port and define MAN<sect> and
315: # CAT<sect> for the compressed pages. The pages will then be automagically
316: # uncompressed.
1.9 imp 317: #
1.44 marc 318: # MANCOMPRESSED - Indicates that the port installs manpages in a compressed
319: # form (default: port installs manpages uncompressed).
1.9 imp 320: # MAN<sect> - A list of manpages, categorized by section. For
321: # example, if your port has "man/man1/foo.1" and
322: # "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".
323: # The available sections chars are "123456789LN".
1.44 marc 324: # CAT<sect> - The same as MAN<sect>, only for formatted manpages.
325: # MANPREFIX -The directory prefix for ${MAN<sect>} (default: ${PREFIX}).
326: # CATPREFIX - The directory prefix for ${CAT<sect>} (default: ${PREFIX}).
1.9 imp 327: #
1.73 marc 328: # Other variables:
329: #
330: # NO_SHARED_LIBS - defined as "yes" for those machine architectures that do
331: # not support shared libraries. WARNING: This value is
332: # NOT defined until AFTER ".include bsd.port.mk". Thus
333: # you can NOT use something like ".if defined(NO_SHARED_LIBS)"
334: # before this file is included.
335: #
1.1 niklas 336: # Default targets and their behaviors:
337: #
338: # fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined)
339: # into ${DISTDIR} as necessary.
340: # fetch-list - Show list of files that would be retrieved by fetch
341: # extract - Unpacks ${DISTFILES} into ${WRKDIR}.
342: # patch - Apply any provided patches to the source.
343: # configure - Runs either GNU configure, one or more local configure
344: # scripts or nothing, depending on what's available.
345: # build - Actually compile the sources.
346: # install - Install the results of a build.
347: # reinstall - Install the results of a build, ignoring "already installed"
348: # flag.
1.44 marc 349: # deinstall - Remove the installation. Alias: uninstall
1.32 marc 350: # plist - create a file suitable for use as a packing list. This
351: # is for port maintainers.
1.1 niklas 352: # package - Create a package from an _installed_ port.
353: # describe - Try to generate a one-line description for each port for
354: # use in INDEX files and the like.
355: # checkpatch - Do a "patch -C" instead of a "patch". Note that it may
356: # give incorrect results if multiple patches deal with
1.52 espie 357: # the same file.
1.75 espie 358: # checksum - Use ${CHECKSUM_FILE} to ensure that your distfiles are valid.
359: # makesum - Generate ${CHECKSUM_FILE} (only do this for your own ports!).
360: # addsum - update ${CHECKSUM_FILE} in a non-destructive way
361: # (your own ports only!)
1.44 marc 362: # readme - Create a README.html file describing the category or package
363: # mirror-distfiles - Mirror the distfile(s) if they are freely redistributable
364: # Setting MIRROR_DISTFILE to "no" in the package Makefile
365: # will override the default "yes", and the distfile will
366: # not be fetched.
1.82 marc 367: # list-distfiles- list the distribution and patch files used by a port.
368: # Typical use is (from the top level of the ports tree)
369: # make ECHO_MSG=: list-distfiles | tee some-file
370: # obj - pre-build ${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR} links
1.1 niklas 371: #
372: # Default sequence for "all" is: fetch checksum extract patch configure build
373: #
374: # Please read the comments in the targets section below, you
375: # should be able to use the pre-* or post-* targets/scripts
376: # (which are available for every stage except checksum) or
377: # override the do-* targets to do pretty much anything you want.
378: #
379: # NEVER override the "regular" targets unless you want to open
380: # a major can of worms.
381:
1.44 marc 382: # Get the architecture
383: ARCH!= uname -m
384:
1.32 marc 385: # Get the operating system type and version
1.27 marc 386: OPSYS!= uname -s
1.32 marc 387: OPSYS_VER!= uname -r
1.27 marc 388:
1.1 niklas 389: .if exists(${.CURDIR}/../Makefile.inc)
390: .include "${.CURDIR}/../Makefile.inc"
391: .endif
392:
1.62 marc 393: # Define SUPPORT_SHARES for those machines that support shared libraries.
394: #
395: .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "powerpc") || \
396: (${MACHINE_ARCH} == "vax") || (${MACHINE_ARCH} == "hppa")
397: NO_SHARED_LIBS= yes
398: .endif
399:
1.44 marc 400: NOCLEANDEPENDS= yes
1.10 niklas 401: NOMANCOMPRESS?= yes
1.14 niklas 402: DEF_UMASK?= 022
1.6 niklas 403:
1.13 imp 404: .if exists(${.CURDIR}/Makefile.${ARCH}-${OPSYS})
405: .include "${.CURDIR}/Makefile.${ARCH}-${OPSYS}"
406: .elif exists(${.CURDIR}/Makefile.${OPSYS})
407: .include "${.CURDIR}/Makefile.${OPSYS}"
408: .elif exists(${.CURDIR}/Makefile.${ARCH})
409: .include "${.CURDIR}/Makefile.${ARCH}"
410: .endif
411:
1.1 niklas 412: # These need to be absolute since we don't know how deep in the ports
413: # tree we are and thus can't go relative. They can, of course, be overridden
1.9 imp 414: # by individual Makefiles or local system make configuration.
1.13 imp 415: PORTSDIR?= /usr/ports
1.44 marc 416: LOCALBASE?= ${DESTDIR}/usr/local
1.13 imp 417: X11BASE?= ${DESTDIR}/usr/X11R6
1.9 imp 418: DISTDIR?= ${PORTSDIR}/distfiles
419: _DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
1.1 niklas 420: PACKAGES?= ${PORTSDIR}/packages
421: TEMPLATES?= ${PORTSDIR}/templates
1.14 niklas 422:
1.13 imp 423: .if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
424: PATCHDIR?= ${.CURDIR}/patches.${ARCH}-${OPSYS}
425: .elif exists(${.CURDIR}/patches.${OPSYS})
426: PATCHDIR?= ${.CURDIR}/patches.${OPSYS}
427: .elif exists(${.CURDIR}/patches.${ARCH})
428: PATCHDIR?= ${.CURDIR}/patches.${ARCH}
429: .else
1.1 niklas 430: PATCHDIR?= ${.CURDIR}/patches
1.13 imp 431: .endif
432:
1.50 espie 433: PATCH_LIST?= patch-*
434:
1.13 imp 435: .if exists(${.CURDIR}/scripts.${ARCH}-${OPSYS})
436: SCRIPTDIR?= ${.CURDIR}/scripts.${ARCH}-${OPSYS}
437: .elif exists(${.CURDIR}/scripts.${OPSYS})
438: SCRIPTDIR?= ${.CURDIR}/scripts.${OPSYS}
439: .elif exists(${.CURDIR}/scripts.${ARCH})
440: SCRIPTDIR?= ${.CURDIR}/scripts.${ARCH}
441: .else
1.1 niklas 442: SCRIPTDIR?= ${.CURDIR}/scripts
1.13 imp 443: .endif
444:
445: .if exists(${.CURDIR}/files.${ARCH}-${OPSYS})
446: FILESDIR?= ${.CURDIR}/files.${ARCH}-${OPSYS}
447: .elif exists(${.CURDIR}/files.${OPSYS})
448: FILESDIR?= ${.CURDIR}/files.${OPSYS}
449: .elif exists(${.CURDIR}/files.${ARCH})
450: FILESDIR?= ${.CURDIR}/files.${ARCH}
451: .else
1.1 niklas 452: FILESDIR?= ${.CURDIR}/files
1.13 imp 453: .endif
454:
455: .if exists(${.CURDIR}/pkg.${ARCH}-${OPSYS})
456: PKGDIR?= ${.CURDIR}/pkg.${ARCH}-${OPSYS}
457: .elif exists(${.CURDIR}/pkg.${OPSYS})
458: PKGDIR?= ${.CURDIR}/pkg.${OPSYS}
459: .elif exists(${.CURDIR}/pkg.${ARCH})
460: PKGDIR?= ${.CURDIR}/pkg.${ARCH}
461: .else
1.1 niklas 462: PKGDIR?= ${.CURDIR}/pkg
1.13 imp 463: .endif
464:
1.1 niklas 465: .if defined(USE_IMAKE) || defined(USE_X11)
466: PREFIX?= ${X11BASE}
467: .else
468: PREFIX?= ${LOCALBASE}
469: .endif
1.79 espie 470:
471: # where configuration files should go
472: SYSCONFDIR?= /etc
1.1 niklas 473: # The following 4 lines should go away as soon as the ports are all updated
474: .if defined(EXEC_DEPENDS)
475: BUILD_DEPENDS+= ${EXEC_DEPENDS}
476: RUN_DEPENDS+= ${EXEC_DEPENDS}
477: .endif
478: .if defined(USE_GMAKE)
1.44 marc 479: BUILD_DEPENDS+= ${GMAKE}:${PORTSDIR}/devel/gmake
480: MAKE_PROGRAM= ${GMAKE}
481: .else
482: MAKE_PROGRAM= ${MAKE}
1.13 imp 483: .endif
1.52 espie 484: .if defined(USE_AUTOCONF)
485: GNU_CONFIGURE= yes
486: BUILD_DEPENDS+= ${AUTOCONF}:${PORTSDIR}/devel/autoconf
487: AUTOCONF_DIR?=${WRKSRC}
488: # missing ?= not an oversight
489: AUTOCONF_ENV=PATH=${PORTPATH}
490: .endif
1.47 espie 491: .if defined(USE_EGCC)
1.84 marc 492: BUILD_DEPENDS+= ${EGCC}:${PORTSDIR}/lang/egcs-stable
1.47 espie 493: CC=${EGCC}
494: .endif
495: .if defined(USE_EGXX)
1.84 marc 496: BUILD_DEPENDS+= ${EGXX}:${PORTSDIR}/lang/egcs-stable
1.47 espie 497: CXX=${EGXX}
498: .endif
1.49 form 499: .if defined(USE_MOTIF) && !defined(HAVE_MOTIF) && !defined(REQUIRES_MOTIF)
500: LIB_DEPENDS+= Xm.:${PORTSDIR}/x11/lesstif
501: .endif
1.44 marc 502:
1.1 niklas 503: .if exists(${PORTSDIR}/../Makefile.inc)
504: .include "${PORTSDIR}/../Makefile.inc"
505: .endif
506:
507: EXTRACT_COOKIE?= ${WRKDIR}/.extract_done
1.71 espie 508: PATCH_COOKIE?= ${WRKDIR}/.patch_done
509: .if defined(SEPARATE_BUILD)
510: CONFIGURE_COOKIE?= ${WRKBUILD}/.configure_done
511: INSTALL_PRE_COOKIE?=${WRKBUILD}/.install_started
512: INSTALL_COOKIE?= ${WRKBUILD}/.install_done
513: BUILD_COOKIE?= ${WRKBUILD}/.build_done
514: PACKAGE_COOKIE?= ${WRKBUILD}/.package_done
515: .else
1.1 niklas 516: CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done
1.32 marc 517: INSTALL_PRE_COOKIE?=${WRKDIR}/.install_started
1.1 niklas 518: INSTALL_COOKIE?= ${WRKDIR}/.install_done
519: BUILD_COOKIE?= ${WRKDIR}/.build_done
520: PACKAGE_COOKIE?= ${WRKDIR}/.package_done
1.71 espie 521: .endif
1.1 niklas 522:
523: # Miscellaneous overridable commands:
524: GMAKE?= gmake
1.52 espie 525: AUTOCONF?= autoconf
1.47 espie 526: EGCC?= egcc
527: EGXX?= eg++
1.1 niklas 528: XMKMF?= xmkmf -a
1.52 espie 529:
1.75 espie 530: # be paranoid about which ciphers we trust
1.13 imp 531: .if exists(/sbin/md5)
532: MD5?= /sbin/md5
1.9 imp 533: .elif exists(/bin/md5)
1.4 deraadt 534: MD5?= /bin/md5
1.13 imp 535: .elif exists(/usr/bin/md5)
536: MD5?= /usr/bin/md5
1.9 imp 537: .else
1.13 imp 538: MD5?= md5
1.9 imp 539: .endif
1.75 espie 540:
541: .if exists(/sbin/sha1)
542: SHA1?= /sbin/sha1
543: .elif exists(/bin/sha1)
544: SHA1?= /bin/sha1
545: .elif exists(/usr/bin/sha1)
546: SHA1?= /usr/bin/sha1
547: .else
548: SHA1?= sha1
549: .endif
550:
551: .if exists(/sbin/rmd160)
552: RMD160?= /sbin/rmd160
553: .elif exists(/bin/rmd160)
554: RMD160?= /bin/rmd160
555: .elif exists(/usr/bin/rmd160)
556: RMD160?= /usr/bin/rmd160
557: .else
558: RMD160?= rmd160
559: .endif
560:
561: # Compatibility game
1.1 niklas 562: MD5_FILE?= ${FILESDIR}/md5
1.75 espie 563: CHECKSUM_FILE?= ${MD5_FILE}
564:
565: # Don't touch !!! Used for generating checksums.
566: CIPHERS= ${SHA1}.SHA1 ${RMD160}.RMD160 ${MD5}.MD5
567:
568: # This is the one you can override
569: PREFERRED_CIPHERS?= ${CIPHERS}
1.1 niklas 570:
1.52 espie 571: PORTPATH?= /usr/bin:/bin:/usr/sbin:/sbin:${LOCALBASE}/bin:${X11BASE}/bin
1.77 marc 572:
573: # Add any COPTS to CFLAGS. Note: programs that use imake do not
574: # use CFLAGS! Also, many (most?) ports hard code CFLAGS, ignoring
575: # what we pass in.
576: CFLAGS+= ${COPTS}
1.52 espie 577:
1.1 niklas 578: MAKE_FLAGS?= -f
579: MAKEFILE?= Makefile
1.52 espie 580: MAKE_ENV+= PATH=${PORTPATH} PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" CFLAGS="${CFLAGS}"
1.1 niklas 581:
1.13 imp 582: .if exists(/usr/bin/fetch)
583: FETCH_CMD?= /usr/bin/fetch
584: .else
1.6 niklas 585: FETCH_CMD?= /usr/bin/ftp
1.9 imp 586: .endif
1.1 niklas 587:
1.44 marc 588: # By default, distfiles have no restrictions placed on them
589: MIRROR_DISTFILE?= yes
590:
1.1 niklas 591: TOUCH?= /usr/bin/touch
592: TOUCH_FLAGS?= -f
593:
594: PATCH?= /usr/bin/patch
595: PATCH_STRIP?= -p0
596: PATCH_DIST_STRIP?= -p0
597: .if defined(PATCH_DEBUG)
1.6 niklas 598: PATCH_DEBUG_TMP= yes
1.1 niklas 599: PATCH_ARGS?= -d ${WRKSRC} -E ${PATCH_STRIP}
600: PATCH_DIST_ARGS?= -d ${WRKSRC} -E ${PATCH_DIST_STRIP}
601: .else
1.6 niklas 602: PATCH_DEBUG_TMP= no
1.3 niklas 603: PATCH_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_STRIP}
604: PATCH_DIST_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
1.1 niklas 605: .endif
606: .if defined(BATCH)
607: PATCH_ARGS+= --batch
608: PATCH_DIST_ARGS+= --batch
609: .endif
610:
611: .if defined(PATCH_CHECK_ONLY)
612: PATCH_ARGS+= -C
613: PATCH_DIST_ARGS+= -C
614: .endif
615:
1.9 imp 616: .if exists(/bin/tar)
1.5 tholo 617: EXTRACT_CMD?= /bin/tar
1.9 imp 618: .else
619: EXTRACT_CMD?= /usr/bin/tar
620: .endif
1.1 niklas 621: # Backwards compatability.
622: .if defined(EXTRACT_ARGS)
623: EXTRACT_BEFORE_ARGS?= ${EXTRACT_ARGS}
624: .else
625: EXTRACT_BEFORE_ARGS?= -xzf
626: .endif
1.44 marc 627: EXTRACT_SUFX?= .tar.gz
1.1 niklas 628:
629: # Figure out where the local mtree file is
1.13 imp 630: .if !defined(MTREE_FILE)
631: .if defined(USE_IMAKE) || defined(USE_X11)
632: MTREE_FILE= /etc/mtree/BSD.x11.dist
633: .else
634: MTREE_FILE= /etc/mtree/BSD.local.dist
635: .endif
1.1 niklas 636: .endif
637: MTREE_CMD?= /usr/sbin/mtree
1.43 marc 638: MTREE_ARGS?= -U -f ${MTREE_FILE} -d -e -q -p
1.1 niklas 639:
1.10 niklas 640: .include <bsd.own.mk>
641: MAKE_ENV+= EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
1.44 marc 642:
643: .if !defined(NO_WRKDIR)
644: .if defined(OBJMACHINE)
645: WRKDIR?= ${.CURDIR}/work.${MACHINE_ARCH}
646: .else
647: WRKDIR?= ${.CURDIR}/work
648: .endif
649: .else
650: WRKDIR?= ${.CURDIR}
651: .endif
652: .if defined(NO_WRKSUBDIR)
653: WRKSRC?= ${WRKDIR}
654: .else
655: WRKSRC?= ${WRKDIR}/${DISTNAME}
656: .endif
657:
1.71 espie 658: .if defined(SEPARATE_BUILD)
659: WRKBUILD?= ${WRKDIR}/build-${ARCH}
660: .else
1.60 rohee 661: WRKBUILD?= ${WRKSRC}
1.71 espie 662: .endif
1.60 rohee 663:
1.44 marc 664: .if defined(WRKOBJDIR)
665: __canonical_PORTSDIR!= cd ${PORTSDIR}; pwd -P
666: __canonical_CURDIR!= cd ${.CURDIR}; pwd -P
667: PORTSUBDIR= ${__canonical_CURDIR:S,${__canonical_PORTSDIR}/,,}
1.10 niklas 668: .endif
669:
1.6 niklas 670: # A few aliases for *-install targets
671: INSTALL_PROGRAM= \
1.12 millert 672: ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
1.6 niklas 673: INSTALL_SCRIPT= \
1.12 millert 674: ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
1.6 niklas 675: INSTALL_DATA= \
1.12 millert 676: ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
1.6 niklas 677: INSTALL_MAN= \
1.12 millert 678: ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
1.44 marc 679: INSTALL_PROGRAM_DIR= \
680: ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
681: INSTALL_SCRIPT_DIR= \
682: ${INSTALL_PROGRAM_DIR}
683: INSTALL_DATA_DIR= \
684: ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${BINMODE}
685: INSTALL_MAN_DIR= \
686: ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${BINMODE}
1.6 niklas 687:
1.13 imp 688: INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
689: BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
690: BSD_INSTALL_DATA="${INSTALL_DATA}" \
1.44 marc 691: BSD_INSTALL_MAN="${INSTALL_MAN}" \
692: BSD_INSTALL_PROGRAM_DIR="${INSTALL_PROGRAM_DIR}" \
693: BSD_INSTALL_SCRIPT_DIR="${INSTALL_SCRIPT_DIR}" \
694: BSD_INSTALL_DATA_DIR="${INSTALL_DATA_DIR}" \
695: BSD_INSTALL_MAN_DIR="${INSTALL_MAN_DIR}"
1.13 imp 696: MAKE_ENV+= ${INSTALL_MACROS}
697: SCRIPTS_ENV+= ${INSTALL_MACROS}
698:
1.1 niklas 699: # The user can override the NO_PACKAGE by specifying this from
700: # the make command line
701: .if defined(FORCE_PACKAGE)
702: .undef NO_PACKAGE
703: .endif
704:
1.31 marc 705: # Support architecture dependent packing lists
706: #
1.13 imp 707: COMMENT?= ${PKGDIR}/COMMENT
708: DESCR?= ${PKGDIR}/DESCR
1.31 marc 709: .if exists(${PKGDIR}/PLIST.${ARCH})
710: PLIST?= ${PKGDIR}/PLIST.${ARCH}
1.62 marc 711: .else
712: .if defined(NO_SHARED_LIBS) && exists(${PKGDIR}/PLIST.noshared)
713: PLIST?= ${PKGDIR}/PLIST.noshared
1.31 marc 714: .else
1.13 imp 715: PLIST?= ${PKGDIR}/PLIST
1.63 marc 716: .endif
1.31 marc 717: .endif
1.13 imp 718:
1.1 niklas 719: PKG_CMD?= /usr/sbin/pkg_create
1.52 espie 720: PKG_DELETE?= /usr/sbin/pkg_delete
1.1 niklas 721: .if !defined(PKG_ARGS)
1.13 imp 722: PKG_ARGS= -v -c ${COMMENT} -d ${DESCR} -f ${PLIST} -p ${PREFIX} -P "`${MAKE} package-depends|sort -u`"
1.1 niklas 723: .if exists(${PKGDIR}/INSTALL)
724: PKG_ARGS+= -i ${PKGDIR}/INSTALL
725: .endif
726: .if exists(${PKGDIR}/DEINSTALL)
727: PKG_ARGS+= -k ${PKGDIR}/DEINSTALL
728: .endif
729: .if exists(${PKGDIR}/REQ)
730: PKG_ARGS+= -r ${PKGDIR}/REQ
731: .endif
1.9 imp 732: .if exists(${PKGDIR}/MESSAGE)
733: PKG_ARGS+= -D ${PKGDIR}/MESSAGE
734: .endif
1.13 imp 735: .if !defined(NO_MTREE)
736: PKG_ARGS+= -m ${MTREE_FILE}
1.1 niklas 737: .endif
738: .endif
739: PKG_SUFX?= .tgz
740: # where pkg_add records its dirty deeds.
741: PKG_DBDIR?= /var/db/pkg
742:
743: # shared/dynamic motif libs
1.49 form 744: .if defined(USE_MOTIF) || defined(HAVE_MOTIF)
1.1 niklas 745: .if defined(MOTIF_STATIC)
746: MOTIFLIB?= ${X11BASE}/lib/libXm.a
747: .else
748: MOTIFLIB?= -L${X11BASE}/lib -lXm
749: .endif
750: .endif
751:
1.13 imp 752: AWK?= /usr/bin/awk
753: BASENAME?= /usr/bin/basename
1.9 imp 754: CAT?= /bin/cat
1.1 niklas 755: CP?= /bin/cp
1.32 marc 756: DIRNAME?= /usr/bin/dirname
1.13 imp 757: ECHO?= /bin/echo
1.52 espie 758: EXPR?= /bin/expr
1.9 imp 759: FALSE?= /usr/bin/false
1.44 marc 760: FILE?= /usr/bin/file
1.9 imp 761: GREP?= /usr/bin/grep
1.13 imp 762: GUNZIP_CMD?= /usr/bin/gunzip -f
1.1 niklas 763: GZCAT?= /usr/bin/gzcat
1.9 imp 764: GZIP?= -9
765: GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
1.22 niklas 766: LDCONFIG?= [ ! -x /sbin/ldconfig ] || /sbin/ldconfig
1.14 niklas 767: LN?= /bin/ln
1.50 espie 768: M4?= /usr/bin/m4
1.13 imp 769: MKDIR?= /bin/mkdir -p
770: MV?= /bin/mv
1.18 niklas 771: READLINK?= /usr/bin/readlink
1.13 imp 772: RM?= /bin/rm
773: RMDIR?= /bin/rmdir
1.1 niklas 774: SED?= /usr/bin/sed
1.52 espie 775:
776: # XXX ${SETENV} is needed in front of var=value lists whenever the next
777: # command is expanded from a variable, as this could be a shell construct
1.44 marc 778: SETENV?= /usr/bin/env
1.13 imp 779: SH?= /bin/sh
780: TR?= /usr/bin/tr
1.44 marc 781: TRUE?= /usr/bin/true
1.1 niklas 782:
783: # Used to print all the '===>' style prompts - override this to turn them off.
784: ECHO_MSG?= ${ECHO}
785:
1.44 marc 786: # How to do nothing. Override if you, for some strange reason, would rather
787: # do something.
788: DO_NADA?= ${TRUE}
789:
1.1 niklas 790: ALL_TARGET?= all
791: INSTALL_TARGET?= install
792:
1.44 marc 793: .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
794: INSTALL_TARGET+= install.man
795: .endif
796:
1.9 imp 797: # Popular master sites
1.13 imp 798: MASTER_SITE_XCONTRIB+= \
799: ftp://crl.dec.com/pub/X11/contrib/%SUBDIR%/ \
1.60 rohee 800: ftp://ftp.eu.net/X11/contrib/%SUBDIR%/ \
1.44 marc 801: ftp://ftp.uni-paderborn.de/pub/X11/contrib/%SUBDIR%/ \
802: ftp://ftp.x.org/contrib/%SUBDIR%/
1.13 imp 803:
804: MASTER_SITE_GNU+= \
805: ftp://prep.ai.mit.edu/pub/gnu/%SUBDIR%/ \
806: ftp://wuarchive.wustl.edu/systems/gnu/%SUBDIR%/
807:
808: MASTER_SITE_PERL_CPAN+= \
809: ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-module/%SUBDIR%/ \
810: ftp://ftp.cdrom.com/pub/perl/CPAN/modules/by-module/%SUBDIR%/
811:
1.78 rohee 812: MASTER_SITE_TEX_CTAN+= \
813: ftp://ftp.cdrom.com/pub/tex/ctan/%SUBDIR%/ \
814: ftp://wuarchive.wustl.edu/packages/TeX/%SUBDIR%/ \
815: ftp://ftp.funet.fi/pub/TeX/CTAN/%SUBDIR%/ \
816: ftp://ftp.tex.ac.uk/public/ctan/tex-archive/%SUBDIR%/ \
817: ftp://ftp.dante.de/tex-archive/%SUBDIR%/
1.13 imp 818:
819: MASTER_SITE_SUNSITE+= \
1.70 rohee 820: ftp://metalab.unc.edu/pub/Linux/%SUBDIR%/ \
1.13 imp 821: ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/%SUBDIR%/ \
1.70 rohee 822: ftp://ftp.funet.fi/pub/mirrors/sunsite.unc.edu/pub/Linux/%SUBDIR%/ \
823: ftp://ftp.lip6.fr/pub/linux/sunsite/%SUBDIR%
1.78 rohee 824:
825: MASTER_SITE_KDE+= \
826: ftp://ftp.us.kde.org/pub/kde/%SUBDIR%/ \
827: ftp://ftp.kde.org/pub/kde/%SUBDIR%/ \
828: ftp://ftp.tuniv.szczecin.pl/pub/kde/%SUBDIR%/ \
829: ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde/%SUBDIR%/ \
830: ftp://ftp.dataplus.se/pub/linux/kde/%SUBDIR%/
831:
832: MASTER_SITE_GNOME+= \
833: ftp://ftp.jimpick.com/pub/mirrors/gnome/%SUBDIR%/ \
834: ftp://ftp.geo.net/pub/gnome/%SUBDIR%/ \
835: ftp://gnomeftp.wgn.net/pub/gnome/%SUBDIR%/ \
836: ftp://ftp.gnome.org/pub/GNOME/%SUBDIR%/
1.13 imp 837:
838: # Empty declaration to avoid "variable MASTER_SITES recursive" error
839: MASTER_SITES?=
840: PATCH_SITES?=
841:
842: # Substitute subdirectory names
1.57 espie 843: _MASTER_SITES:= ${MASTER_SITES:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
1.13 imp 844: PATCH_SITES:= ${PATCH_SITES:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
1.57 espie 845: MASTER_SITES:= ${_MASTER_SITES}
1.9 imp 846:
1.27 marc 847: # Two backup master sites, First one at ftp.openbsd.org
848: #
849: _MASTER_SITE_OPENBSD?= \
1.34 marc 850: ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/ \
851: ftp://ftp.openbsd.org/pub/OpenBSD/licensed/${DIST_SUBDIR}/
1.27 marc 852:
853: # set the backup master sites.
854: #
1.9 imp 855: MASTER_SITE_BACKUP?= \
1.58 pattonme 856: ${_MASTER_SITE_OPENBSD} \
857: ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
1.27 marc 858:
859: # If the user has this set, go to the OpenBSD repository for everything.
860: #
861: .if defined(MASTER_SITE_OPENBSD)
862: MASTER_SITE_OVERRIDE= ${_MASTER_SITE_OPENBSD}
863: .endif
1.9 imp 864:
1.13 imp 865: # Where to put distfiles that don't have any other master site
1.27 marc 866: # ;;; This is referenced in a few Makefiles -- I'd like to get rid of it
867: #
1.13 imp 868: MASTER_SITE_LOCAL?= \
1.44 marc 869: ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/ \
1.13 imp 870: ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/
871:
1.1 niklas 872: # I guess we're in the master distribution business! :) As we gain mirror
873: # sites for distfiles, add them to this list.
874: .if !defined(MASTER_SITE_OVERRIDE)
1.9 imp 875: MASTER_SITES+= ${MASTER_SITE_BACKUP}
876: PATCH_SITES+= ${MASTER_SITE_BACKUP}
1.1 niklas 877: .else
878: MASTER_SITES:= ${MASTER_SITE_OVERRIDE} ${MASTER_SITES}
879: PATCH_SITES:= ${MASTER_SITE_OVERRIDE} ${PATCH_SITES}
880: .endif
881:
1.28 marc 882: # OpenBSD code to handle ports distfiles on a CDROM. The distfiles
883: # are located in /cdrom/distfiles/${DIST_SUBDIR}/ (assuming that the
884: # CDROM is mounted on /cdrom).
885: #
886: .if exists(/cdrom/distfiles)
887: CDROM_SITE:= /cdrom/distfiles/${DIST_SUBDIR}
888: .if defined(FETCH_SYMLINK_DISTFILES)
889: CDROM_COPY:= ${LN}
890: CDROM_OPT= -s
891: .else
892: CDROM_COPY:= ${CP}
893: CDROM_OPT= -f
894: .endif
895: .endif
896:
1.1 niklas 897: # Derived names so that they're easily overridable.
898: DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
899: PKGNAME?= ${DISTNAME}
900:
1.85 ! espie 901: .if make(makesum) || make(addsum) || defined(__FETCH_ALL)
! 902: .if defined(SUPDISTFILES)
! 903: DISTFILES+=${SUPDISTFILES}
! 904: .endif
! 905: .if defined(SUPPATCHFILES)
! 906: PATCHFILES+=${SUPPATCHFILES}
! 907: .endif
! 908: .endif
1.9 imp 909: ALLFILES?= ${DISTFILES} ${PATCHFILES}
910:
911: .if defined(IGNOREFILES)
912: CKSUMFILES!= \
913: for file in ${ALLFILES}; do \
914: ignore=0; \
915: for tmp in ${IGNOREFILES}; do \
916: if [ "$$file" = "$$tmp" ]; then \
917: ignore=1; \
918: fi; \
919: done; \
920: if [ "$$ignore" = 0 ]; then \
921: echo "$$file"; \
1.44 marc 922: else \
923: echo ""; \
1.9 imp 924: fi; \
925: done
926: .else
927: CKSUMFILES= ${ALLFILES}
928: .endif
929:
930: # List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
931: .if defined(DIST_SUBDIR)
932: _CKSUMFILES?= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
933: _IGNOREFILES?= ${IGNOREFILES:S/^/${DIST_SUBDIR}\//}
934: .else
935: _CKSUMFILES?= ${CKSUMFILES}
936: _IGNOREFILES?= ${IGNOREFILES}
937: .endif
938:
1.1 niklas 939: # This is what is actually going to be extracted, and is overridable
940: # by user.
941: EXTRACT_ONLY?= ${DISTFILES}
942:
943: # Documentation
1.44 marc 944: MAINTAINER?= ports@OpenBSD.ORG
1.9 imp 945:
946: .if !defined(CATEGORIES)
947: .BEGIN:
948: @${ECHO_MSG} "CATEGORIES is mandatory."
949: @${FALSE}
950: .endif
1.1 niklas 951:
952: # Note this has to start with a capital letter (or more accurately, it
953: # shouldn't match "[a-z]*"), see the target "delete-package-links" below.
954: PKGREPOSITORYSUBDIR?= All
955: PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
956: .if exists(${PACKAGES})
957: PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
958: .else
959: PKGFILE?= ${PKGNAME}${PKG_SUFX}
960: .endif
961:
1.74 marc 962: CONFIGURE_SCRIPT?= configure
963: .if defined(SEPARATE_BUILD)
964: _CONFIGURE_SCRIPT=${WRKSRC}/${CONFIGURE_SCRIPT}
965: .else
966: _CONFIGURE_SCRIPT=./${CONFIGURE_SCRIPT}
967: .endif
968: CONFIGURE_ENV+= PATH=${PORTPATH}
1.1 niklas 969:
970: .if defined(GNU_CONFIGURE)
971: CONFIGURE_ARGS+= --prefix=${PREFIX}
1.79 espie 972: CONFIGURE_ARGS+= --sysconfdir=${SYSCONFDIR}
1.1 niklas 973: HAS_CONFIGURE= yes
1.73 marc 974: .endif
975:
976: .if defined(NO_SHARED_LIBS)
977: CONFIGURE_SHARED?= --disable-shared
978: .else
979: CONFIGURE_SHARED?= --enable-shared
1.1 niklas 980: .endif
981:
1.13 imp 982: # Passed to most of script invocations
1.44 marc 983: SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
1.52 espie 984: PATH=${PORTPATH} \
1.60 rohee 985: WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} WRKBUILD=${WRKBUILD} \
986: PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
1.13 imp 987: PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
988: PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
989:
990: .if defined(BATCH)
991: SCRIPTS_ENV+= BATCH=yes
992: .endif
993:
1.9 imp 994: MANPREFIX?= ${PREFIX}
1.44 marc 995: CATPREFIX?= ${PREFIX}
1.9 imp 996:
997: .for sect in 1 2 3 4 5 6 7 8 9
998: MAN${sect}PREFIX?= ${MANPREFIX}
1.44 marc 999: CAT${sect}PREFIX?= ${CATPREFIX}
1.9 imp 1000: .endfor
1001: MANLPREFIX?= ${MANPREFIX}
1002: MANNPREFIX?= ${MANPREFIX}
1.44 marc 1003: CATLPREFIX?= ${CATPREFIX}
1004: CATNPREFIX?= ${CATPREFIX}
1.9 imp 1005:
1006: MANLANG?= "" # english only by default
1007:
1008: .for lang in ${MANLANG}
1009:
1010: .for sect in 1 2 3 4 5 6 7 8 9
1011: .if defined(MAN${sect})
1012: _MANPAGES+= ${MAN${sect}:S%^%${MAN${sect}PREFIX}/man/${lang}/man${sect}/%}
1013: .endif
1.44 marc 1014: .if defined(CAT${sect})
1015: _CATPAGES+= ${CAT${sect}:S%^%${CAT${sect}PREFIX}/man/${lang}/cat${sect}/%}
1016: .endif
1.9 imp 1017: .endfor
1018:
1019: .if defined(MANL)
1020: _MANPAGES+= ${MANL:S%^%${MANLPREFIX}/man/${lang}/manl/%}
1021: .endif
1022:
1023: .if defined(MANN)
1024: _MANPAGES+= ${MANN:S%^%${MANNPREFIX}/man/${lang}/mann/%}
1025: .endif
1026:
1.44 marc 1027: .if defined(CATL)
1028: _CATPAGES+= ${CATL:S%^%${CATLPREFIX}/man/${lang}/catl/%}
1029: .endif
1.9 imp 1030:
1.44 marc 1031: .if defined(CATN)
1032: _CATPAGES+= ${CATN:S%^%${CATNPREFIX}/man/${lang}/catn/%}
1.9 imp 1033: .endif
1034:
1.44 marc 1035: .endfor
1036:
1.1 niklas 1037: .MAIN: all
1038:
1039: ################################################################
1040: # Many ways to disable a port.
1041: #
1042: # If we're in BATCH mode and the port is interactive, or we're
1043: # in interactive mode and the port is non-interactive, skip all
1044: # the important targets. The reason we have two modes is that
1045: # one might want to leave a build in BATCH mode running
1046: # overnight, then come back in the morning and do _only_ the
1047: # interactive ones that required your intervention.
1048: #
1049: # Don't attempt to build ports that require Motif if you don't
1050: # have Motif.
1051: #
1052: # Ignore ports that can't be resold if building for a CDROM.
1053: #
1054: # Don't build a port if it's restricted and we don't want to get
1055: # into that.
1056: #
1057: # Don't build a port if it's broken.
1.27 marc 1058: #
1059: # Don't build a port if it comes with the base system.
1.1 niklas 1060: ################################################################
1061:
1.13 imp 1062: .if !defined(NO_IGNORE)
1.9 imp 1063: .if (defined(IS_INTERACTIVE) && defined(BATCH))
1064: IGNORE= "is an interactive port"
1065: .elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
1066: IGNORE= "is not an interactive port"
1067: .elif (defined(REQUIRES_MOTIF) && !defined(HAVE_MOTIF))
1068: IGNORE= "requires Motif"
1.13 imp 1069: .elif (defined(MOTIF_ONLY) && !defined(REQUIRES_MOTIF))
1070: IGNORE= "does not require Motif"
1.9 imp 1071: .elif (defined(NO_CDROM) && defined(FOR_CDROM))
1072: IGNORE= "may not be placed on a CDROM: ${NO_CDROM}"
1073: .elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
1074: IGNORE= "is restricted: ${RESTRICTED}"
1.13 imp 1075: .elif ((defined(USE_IMAKE) || defined(USE_X11)) && !exists(${X11BASE}))
1076: IGNORE= "uses X11, but ${X11BASE} not found"
1.9 imp 1077: .elif defined(BROKEN)
1078: IGNORE= "is marked as broken: ${BROKEN}"
1.29 marc 1079: .elif defined(ONLY_FOR_ARCHS)
1080: .for __ARCH in ${ONLY_FOR_ARCHS}
1.48 form 1081: .if (${MACHINE_ARCH} == "${__ARCH}") || (${ARCH} == "${__ARCH}")
1.29 marc 1082: __ARCH_OK= 1
1083: .endif
1084: .endfor
1085: .if !defined(__ARCH_OK)
1.48 form 1086: .if ${MACHINE_ARCH} == "${ARCH}"
1.44 marc 1087: IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH}"
1.48 form 1088: .else
1089: IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH} \(${ARCH}\)"
1090: .endif
1.29 marc 1091: .endif
1.27 marc 1092: .elif defined(COMES_WITH)
1.32 marc 1093: .if ( ${OPSYS_VER} >= ${COMES_WITH} )
1.41 marc 1094: IGNORE= "-- ${PKGNAME:C/-[0-9].*//g} comes with ${OPSYS} as of release ${COMES_WITH}"
1.27 marc 1095: .endif
1.1 niklas 1096: .endif
1097:
1098: .if defined(IGNORE)
1.9 imp 1099: .if defined(IGNORE_SILENT)
1100: IGNORECMD= ${DO_NADA}
1101: .else
1102: IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} ${IGNORE}."
1103: .endif
1104: fetch:
1105: @${IGNORECMD}
1106: checksum:
1107: @${IGNORECMD}
1108: extract:
1109: @${IGNORECMD}
1110: patch:
1111: @${IGNORECMD}
1112: configure:
1113: @${IGNORECMD}
1.1 niklas 1114: all:
1.9 imp 1115: @${IGNORECMD}
1.1 niklas 1116: build:
1.9 imp 1117: @${IGNORECMD}
1.1 niklas 1118: install:
1.9 imp 1119: @${IGNORECMD}
1.44 marc 1120: uninstall deinstall:
1121: @${IGNORECMD}
1.1 niklas 1122: package:
1.9 imp 1123: @${IGNORECMD}
1.44 marc 1124: .endif # IGNORE
1125: .endif # !NO_IGNORE
1.1 niklas 1126:
1127: .if defined(ALL_HOOK)
1128: all:
1.6 niklas 1129: @cd ${.CURDIR} && ${SETENV} CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \
1.60 rohee 1130: DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} WRKBUILD=${WRKBUILD}\
1.1 niklas 1131: PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \
1132: FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \
1133: DEPENDS="${DEPENDS}" BUILD_DEPENDS="${BUILD_DEPENDS}" \
1134: RUN_DEPENDS="${RUN_DEPENDS}" X11BASE=${X11BASE} \
1135: ${ALL_HOOK}
1136: .endif
1137:
1138: .if !target(all)
1139: all: build
1140: .endif
1141:
1.13 imp 1142: .if !defined(DEPENDS_TARGET)
1143: .if make(reinstall)
1144: DEPENDS_TARGET= reinstall
1145: .else
1146: DEPENDS_TARGET= install
1.1 niklas 1147: .endif
1148: .endif
1149:
1150: ################################################################
1151: # The following are used to create easy dummy targets for
1152: # disabling some bit of default target behavior you don't want.
1153: # They still check to see if the target exists, and if so don't
1154: # do anything, since you might want to set this globally for a
1155: # group of ports in a Makefile.inc, but still be able to
1156: # override from an individual Makefile.
1157: ################################################################
1158:
1.9 imp 1159: # Disable checksum
1.76 espie 1160: .if defined(NO_CHECKSUM)
1.85 ! espie 1161: .for _TARGET in makesum addsum
1.76 espie 1162: .if !target(${_TARGET})
1.85 ! espie 1163: ${_TARGET}: fetch-all
1.9 imp 1164: @${DO_NADA}
1165: .endif
1.76 espie 1166: .endfor
1.85 ! espie 1167: .if !target(checksum)
! 1168: checksum: fetch
! 1169: @${DO_NADA}
! 1170: .endif
1.76 espie 1171: .endif
1.9 imp 1172:
1.1 niklas 1173: # Disable extract
1174: .if defined(NO_EXTRACT) && !target(extract)
1.61 espie 1175: extract:
1.1 niklas 1176: @${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE}
1.85 ! espie 1177: checksum: fetch
! 1178: @${DO_NADA}
! 1179: makesum addsum: fetch-all
1.50 espie 1180: @${DO_NADA}
1.1 niklas 1181: .endif
1182:
1.9 imp 1183: # Disable patch
1184: .if defined(NO_PATCH) && !target(patch)
1185: patch: extract
1186: @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE}
1187: .endif
1188:
1.1 niklas 1189: # Disable configure
1190: .if defined(NO_CONFIGURE) && !target(configure)
1191: configure: patch
1192: @${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE}
1193: .endif
1194:
1195: # Disable build
1196: .if defined(NO_BUILD) && !target(build)
1197: build: configure
1198: @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
1199: .endif
1200:
1.9 imp 1201: # Disable install
1202: .if defined(NO_INSTALL) && !target(install)
1203: install: build
1204: @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
1205: .endif
1206:
1.1 niklas 1207: # Disable package
1208: .if defined(NO_PACKAGE) && !target(package)
1209: package:
1.9 imp 1210: .if defined(IGNORE_SILENT)
1.1 niklas 1211: @${DO_NADA}
1.9 imp 1212: .else
1213: @${ECHO_MSG} "===> ${PKGNAME} may not be packaged: ${NO_PACKAGE}."
1.1 niklas 1214: .endif
1215: .endif
1216:
1.9 imp 1217: # Disable describe
1218: .if defined(NO_DESCRIBE) && !target(describe)
1219: describe:
1220: @${DO_NADA}
1.1 niklas 1221: .endif
1222:
1223: ################################################################
1224: # More standard targets start here.
1225: #
1226: # These are the body of the build/install framework. If you are
1227: # not happy with the default actions, and you can't solve it by
1228: # adding pre-* or post-* targets/scripts, override these.
1229: ################################################################
1230:
1231: # Fetch
1232:
1233: .if !target(do-fetch)
1234: do-fetch:
1.9 imp 1235: @${MKDIR} ${_DISTDIR}
1236: @(cd ${_DISTDIR}; \
1.1 niklas 1237: for file in ${DISTFILES}; do \
1238: if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
1239: if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
1.9 imp 1240: ${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \
1.1 niklas 1241: ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
1242: ${ECHO_MSG} ">> Please correct this problem and try again."; \
1243: exit 1; \
1.28 marc 1244: fi ; \
1245: if [ ! -z ${CDROM_COPY} ]; then \
1246: if ${CDROM_COPY} ${CDROM_OPT} ${CDROM_SITE}/$$file .; then \
1247: continue; \
1248: fi ; \
1.1 niklas 1249: fi ; \
1250: ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
1.46 form 1251: if [ ! -w ${_DISTDIR}/. ]; then \
1252: ${ECHO_MSG} ">> Can't download to ${_DISTDIR} (permission denied?)."; \
1253: exit 1; \
1254: fi; \
1.1 niklas 1255: for site in ${MASTER_SITES}; do \
1256: ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
1.6 niklas 1257: if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
1.1 niklas 1258: continue 2; \
1259: fi \
1260: done; \
1.6 niklas 1261: ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\
1.9 imp 1262: ${ECHO_MSG} ">> port manually into ${_DISTDIR} and try again."; \
1.1 niklas 1263: exit 1; \
1264: fi \
1265: done)
1266: .if defined(PATCHFILES)
1.9 imp 1267: @(cd ${_DISTDIR}; \
1.1 niklas 1268: for file in ${PATCHFILES}; do \
1269: if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
1270: if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
1.9 imp 1271: ${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \
1.1 niklas 1272: ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
1273: ${ECHO_MSG} ">> Please correct this problem and try again."; \
1274: exit 1; \
1275: fi ; \
1276: ${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
1277: for site in ${PATCH_SITES}; do \
1278: ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
1.6 niklas 1279: if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \
1.1 niklas 1280: continue 2; \
1281: fi \
1282: done; \
1.6 niklas 1283: ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\
1.9 imp 1284: ${ECHO_MSG} ">> port manually into ${_DISTDIR} and try again."; \
1.1 niklas 1285: exit 1; \
1286: fi \
1287: done)
1288: .endif
1289: .endif
1290:
1.44 marc 1291: # This is for the use of sites which store distfiles which others may
1292: # fetch - only fetch the distfile if it is allowed to be
1293: # re-distributed freely
1294: mirror-distfiles:
1295: .if (${MIRROR_DISTFILE} == "yes")
1.85 ! espie 1296: @make fetch-all __ARCH_OK=yes NO_IGNORE=yes NO_WARNINGS=yes
1.81 marc 1297: .endif
1298:
1.82 marc 1299: # list the distribution and patch files used by a port. Typical
1300: # use is make ECHO_MSG=: list-distfiles | tee some-file
1301: #
1302: list-distfiles:
1.83 marc 1303: @echo "${PKGNAME}"
1304: @for file in ${DISTFILES} ${PATCHFILES}; do \
1305: if [ "$$file" != "${EXTRACT_SUFX}" ]; then \
1306: if [ -z "${DIST_SUBDIR}" ]; then \
1307: printf "\t$$file\n"; \
1308: else \
1309: printf "\t${DIST_SUBDIR}/$$file\n"; \
1310: fi \
1311: fi \
1312: done
1313: @echo ""
1.82 marc 1314:
1.81 marc 1315: # Obj
1.82 marc 1316: #
1.81 marc 1317: .if !target(obj)
1318: obj:
1319: .if !defined(NO_WRKDIR)
1320: .if defined(WRKOBJDIR)
1321: @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
1322: @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
1323: @if [ ! -L ${WRKDIR} ] || \
1324: [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \
1325: echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \
1326: ${RM} -f ${WRKDIR}; \
1327: ${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}; \
1328: fi
1329: .else
1330: @${ECHO_MSG} ">>"
1331: @${ECHO_MSG} ">> Please set the WRKOBJDIR variable before using 'make obj'"
1332: @${ECHO_MSG} ">>"
1333: @exit 1;
1334: .endif
1335: .endif
1.44 marc 1336: .endif
1337:
1.1 niklas 1338: # Extract
1339:
1340: .if !target(do-extract)
1341: do-extract:
1.6 niklas 1342: .if !defined(NO_WRKDIR)
1.14 niklas 1343: .if defined(WRKOBJDIR)
1344: @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
1.44 marc 1345: @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
1.18 niklas 1346: @if [ ! -L ${WRKDIR} ] || \
1347: [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \
1348: echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \
1349: ${RM} -f ${WRKDIR}; \
1350: ${LN} -sf ${WRKOBJDIR}/${PORTSUBDIR} ${WRKDIR}; \
1351: fi
1.14 niklas 1352: .else
1.1 niklas 1353: @${RM} -rf ${WRKDIR}
1.9 imp 1354: @${MKDIR} ${WRKDIR}
1.6 niklas 1355: .endif
1.14 niklas 1356: .endif
1.1 niklas 1357: @for file in ${EXTRACT_ONLY}; do \
1.10 niklas 1358: if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\
1.1 niklas 1359: then \
1360: exit 1; \
1361: fi \
1362: done
1363: .endif
1364:
1365: # Patch
1366:
1367: .if !target(do-patch)
1368: do-patch:
1369: .if defined(PATCHFILES)
1370: @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}"
1.9 imp 1371: @(cd ${_DISTDIR}; \
1.1 niklas 1372: for i in ${PATCHFILES}; do \
1.6 niklas 1373: if [ ${PATCH_DEBUG_TMP} = yes ]; then \
1374: ${ECHO_MSG} "===> Applying distribution patch $$i" ; \
1375: fi; \
1.1 niklas 1376: case $$i in \
1377: *.Z|*.gz) \
1378: ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
1379: ;; \
1380: *) \
1381: ${PATCH} ${PATCH_DIST_ARGS} < $$i; \
1382: ;; \
1383: esac; \
1384: done)
1385: .endif
1386: @if [ -d ${PATCHDIR} ]; then \
1.52 espie 1387: (cd ${PATCHDIR}; \
1388: for i in ${PATCH_LIST}; do \
1.50 espie 1389: case $$i in \
1390: *.orig|*.rej|*~) \
1391: ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
1392: ;; \
1393: *) \
1394: if [ -e $$i ]; then \
1.6 niklas 1395: if [ ${PATCH_DEBUG_TMP} = yes ]; then \
1.9 imp 1396: ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \
1.6 niklas 1397: fi; \
1398: ${PATCH} ${PATCH_ARGS} < $$i; \
1.50 espie 1399: else \
1400: ${ECHO_MSG} "===> Can't find patch matching $$i"; \
1401: if [ -d ${PATCHDIR}/CVS -a "$$i" = \
1402: "${PATCHDIR}/patch-*" ]; then \
1403: ${ECHO_MSG} "===> Perhaps you forgot the -P flag to cvs co or update?"; \
1404: fi; \
1405: fi; \
1406: ;; \
1407: esac; \
1.52 espie 1408: done) \
1.1 niklas 1409: fi
1410: .endif
1411:
1412: # Configure
1413:
1414: .if !target(do-configure)
1.60 rohee 1415: do-configure: ${WRKBUILD}
1.52 espie 1416: .if defined(USE_AUTOCONF)
1417: @cd ${AUTOCONF_DIR} && ${SETENV} ${AUTOCONF_ENV} ${AUTOCONF}
1418: .endif
1.7 niklas 1419: @if [ -f ${SCRIPTDIR}/configure ]; then \
1.13 imp 1420: cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
1421: ${SCRIPTDIR}/configure; \
1.1 niklas 1422: fi
1423: .if defined(HAS_CONFIGURE)
1.60 rohee 1424: @(cd ${WRKBUILD} && CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS}" \
1.47 espie 1425: CXX="${CXX}" ac_cv_path_CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
1.59 marc 1426: INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \
1427: INSTALL_PROGRAM="${INSTALL_PROGRAM}" INSTALL_MAN="${INSTALL_MAN}" \
1428: INSTALL_SCRIPT="${INSTALL_SCRIPT}" INSTALL_DATA="${INSTALL_DATA}" \
1.74 marc 1429: ${CONFIGURE_ENV} ${_CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})
1.1 niklas 1430: .endif
1431: .if defined(USE_IMAKE)
1.44 marc 1432: @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${XMKMF})
1.1 niklas 1433: .endif
1434: .endif
1435:
1.60 rohee 1436: ${WRKBUILD}:
1437: ${MKDIR} ${WRKBUILD}
1438:
1.1 niklas 1439: # Build
1440:
1441: .if !target(do-build)
1442: do-build:
1.60 rohee 1443: @(cd ${WRKBUILD}; ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
1.1 niklas 1444: .endif
1445:
1446: # Install
1447:
1448: .if !target(do-install)
1449: do-install:
1.60 rohee 1450: @(cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
1.1 niklas 1451: .endif
1452:
1453: # Package
1454:
1455: .if !target(do-package)
1456: do-package:
1.13 imp 1457: @if [ -e ${PLIST} ]; then \
1.1 niklas 1458: ${ECHO_MSG} "===> Building package for ${PKGNAME}"; \
1459: if [ -d ${PACKAGES} ]; then \
1460: if [ ! -d ${PKGREPOSITORY} ]; then \
1.9 imp 1461: if ! ${MKDIR} ${PKGREPOSITORY}; then \
1.1 niklas 1462: ${ECHO_MSG} ">> Can't create directory ${PKGREPOSITORY}."; \
1463: exit 1; \
1464: fi; \
1465: fi; \
1466: fi; \
1467: if ${PKG_CMD} ${PKG_ARGS} ${PKGFILE}; then \
1468: if [ -d ${PACKAGES} ]; then \
1469: ${MAKE} ${.MAKEFLAGS} package-links; \
1470: fi; \
1471: else \
1472: ${MAKE} ${.MAKEFLAGS} delete-package; \
1473: exit 1; \
1474: fi; \
1475: fi
1476: .endif
1477:
1478: # Some support rules for do-package
1479:
1480: .if !target(package-links)
1481: package-links:
1482: @${MAKE} ${.MAKEFLAGS} delete-package-links
1483: @for cat in ${CATEGORIES}; do \
1484: if [ ! -d ${PACKAGES}/$$cat ]; then \
1.9 imp 1485: if ! ${MKDIR} ${PACKAGES}/$$cat; then \
1.1 niklas 1486: ${ECHO_MSG} ">> Can't create directory ${PACKAGES}/$$cat."; \
1487: exit 1; \
1488: fi; \
1489: fi; \
1490: ln -s ../${PKGREPOSITORYSUBDIR}/${PKGNAME}${PKG_SUFX} ${PACKAGES}/$$cat; \
1491: done;
1492: .endif
1493:
1494: .if !target(delete-package-links)
1495: delete-package-links:
1496: @${RM} -f ${PACKAGES}/[a-z]*/${PKGNAME}${PKG_SUFX};
1497: .endif
1498:
1499: .if !target(delete-package)
1500: delete-package:
1501: @${MAKE} ${.MAKEFLAGS} delete-package-links
1502: @${RM} -f ${PKGFILE}
1503: .endif
1504:
1505: ################################################################
1506: # This is the "generic" port target, actually a macro used from the
1507: # six main targets. See below for more.
1508: ################################################################
1509:
1510: _PORT_USE: .USE
1511: .if make(real-fetch)
1.6 niklas 1512: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fetch-depends
1.1 niklas 1513: .endif
1514: .if make(real-extract)
1.6 niklas 1515: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends lib-depends misc-depends
1.1 niklas 1516: .endif
1517: .if make(real-install)
1.13 imp 1518: .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
1.40 espie 1519: @if [ -d ${PKG_DBDIR}/${PKGNAME} -o "X$$(ls -d ${PKG_DBDIR}/${PKGNAME:C/-[0-9].*//g}-* 2> /dev/null)" != "X" ]; then \
1.13 imp 1520: ${ECHO_MSG} "===> ${PKGNAME} is already installed - perhaps an older version?"; \
1.44 marc 1521: ${ECHO_MSG} " If so, you may wish to \`\`make deinstall'' and install"; \
1.13 imp 1522: ${ECHO_MSG} " this port again by \`\`make reinstall'' to upgrade it properly."; \
1523: ${ECHO_MSG} " If you really wish to overwrite the old port of ${PKGNAME}"; \
1524: ${ECHO_MSG} " without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
1525: ${ECHO_MSG} " in your environment or the \"make install\" command line."; \
1526: exit 1; \
1527: fi
1528: .endif
1.14 niklas 1529: @if [ `${SH} -c umask` != ${DEF_UMASK} ]; then \
1.13 imp 1530: ${ECHO_MSG} "===> Warning: your umask is \"`${SH} -c umask`"\".; \
1531: ${ECHO_MSG} " If this is not desired, set it to an appropriate value"; \
1532: ${ECHO_MSG} " and install this port again by \`\`make reinstall''."; \
1533: fi
1.9 imp 1534: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends lib-depends
1.1 niklas 1535: .endif
1536: .if make(real-install)
1.56 form 1537: @touch ${INSTALL_PRE_COOKIE}
1.1 niklas 1538: .if !defined(NO_MTREE)
1539: @if [ `id -u` = 0 ]; then \
1.13 imp 1540: if [ ! -f ${MTREE_FILE} ]; then \
1541: ${ECHO_MSG} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
1542: ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
1543: exit 1; \
1544: else \
1.44 marc 1545: if [ ! -d ${PREFIX} ]; then \
1546: mkdir -p ${PREFIX}; \
1547: fi; \
1.13 imp 1548: ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
1549: fi; \
1.1 niklas 1550: else \
1551: ${ECHO_MSG} "Warning: not superuser, can't run mtree."; \
1552: ${ECHO_MSG} "Become root and try again to ensure correct permissions."; \
1553: fi
1554: .endif
1555: .endif
1.6 niklas 1556: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/pre-/}
1.1 niklas 1557: @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then \
1.13 imp 1558: cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
1559: ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/}; \
1.1 niklas 1560: fi
1.6 niklas 1561: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/do-/}
1562: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} ${.TARGET:S/^real-/post-/}
1.1 niklas 1563: @if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/post-/} ]; then \
1.13 imp 1564: cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
1565: ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
1.1 niklas 1566: fi
1.44 marc 1567: .if make(real-install) && (defined(_MANPAGES) || defined(_CATPAGES))
1.9 imp 1568: .if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
1569: @${ECHO_MSG} "===> Uncompressing manual pages for ${PKGNAME}"
1.44 marc 1570: .for manpage in ${_MANPAGES} ${_CATPAGES}
1571: @${GUNZIP_CMD} ${manpage}.gz
1.9 imp 1572: .endfor
1573: .elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)
1574: @${ECHO_MSG} "===> Compressing manual pages for ${PKGNAME}"
1.44 marc 1575: .for manpage in ${_MANPAGES} ${_CATPAGES}
1576: @if [ -L ${manpage} ]; then \
1577: set - `${FILE} ${manpage}`; \
1.52 espie 1578: shift `${EXPR} $$# - 1`; \
1.44 marc 1579: ${LN} -sf $${1}.gz ${manpage}.gz; \
1580: ${RM} ${manpage}; \
1581: else \
1582: ${GZIP_CMD} ${manpage}; \
1583: fi
1.9 imp 1584: .endfor
1585: .endif
1.65 marc 1586: .endif
1587: .if make(real-install) && exists(${PKGDIR}/MESSAGE)
1588: @${CAT} ${PKGDIR}/MESSAGE
1.9 imp 1589: .endif
1590: .if make(real-install) && !defined(NO_PKG_REGISTER)
1.6 niklas 1591: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fake-pkg
1.1 niklas 1592: .endif
1.71 espie 1593: .if make(real-extract)
1594: @${TOUCH} ${TOUCH_FLAGS} ${EXTRACT_COOKIE}
1595: .endif
1596: .if make(real-patch) && !defined(PATCH_CHECK_ONLY)
1597: @${TOUCH} ${TOUCH_FLAGS} ${PATCH_COOKIE}
1598: .endif
1599: .if make(real-configure)
1600: @${TOUCH} ${TOUCH_FLAGS} ${CONFIGURE_COOKIE}
1601: .endif
1602: .if make(real-install)
1603: @${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
1604: .endif
1605: .if make(real-build)
1606: @${TOUCH} ${TOUCH_FLAGS} ${BUILD_COOKIE}
1607: .endif
1608: .if make(real-package) && !defined(PACKAGE_NOINSTALL)
1609: @${TOUCH} ${TOUCH_FLAGS} ${PACKAGE_COOKIE}
1.1 niklas 1610: .endif
1611:
1612: ################################################################
1613: # Skeleton targets start here
1614: #
1615: # You shouldn't have to change these. Either add the pre-* or
1616: # post-* targets/scripts or redefine the do-* targets. These
1617: # targets don't do anything other than checking for cookies and
1618: # call the necessary targets/scripts.
1619: ################################################################
1620:
1621: .if !target(fetch)
1622: fetch:
1.6 niklas 1623: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-fetch
1.1 niklas 1624: .endif
1.85 ! espie 1625: .if !target(fetch-all)
! 1626: fetch-all:
! 1627: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} __FETCH_ALL=yes real-fetch
! 1628: .endif
! 1629:
1.1 niklas 1630:
1631: .if !target(extract)
1.61 espie 1632: extract: ${EXTRACT_COOKIE}
1.1 niklas 1633: .endif
1634:
1635: .if !target(patch)
1636: patch: extract ${PATCH_COOKIE}
1637: .endif
1638:
1639: .if !target(configure)
1640: configure: patch ${CONFIGURE_COOKIE}
1641: .endif
1642:
1643: .if !target(build)
1644: build: configure ${BUILD_COOKIE}
1645: .endif
1646:
1647: .if !target(install)
1648: install: build ${INSTALL_COOKIE}
1649: .endif
1650:
1651: .if !target(package)
1652: package: install ${PACKAGE_COOKIE}
1653: .endif
1654:
1.61 espie 1655: ${EXTRACT_COOKIE}:
1656: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} checksum real-extract
1.1 niklas 1657: ${PATCH_COOKIE}:
1.6 niklas 1658: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-patch
1.1 niklas 1659: ${CONFIGURE_COOKIE}:
1.6 niklas 1660: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-configure
1.1 niklas 1661: ${BUILD_COOKIE}:
1.6 niklas 1662: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-build
1.1 niklas 1663: ${INSTALL_COOKIE}:
1.6 niklas 1664: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-install
1.1 niklas 1665: ${PACKAGE_COOKIE}:
1.6 niklas 1666: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} real-package
1.1 niklas 1667:
1668: # And call the macros
1669:
1670: real-fetch: _PORT_USE
1671: real-extract: _PORT_USE
1672: @${ECHO_MSG} "===> Extracting for ${PKGNAME}"
1673: real-patch: _PORT_USE
1674: @${ECHO_MSG} "===> Patching for ${PKGNAME}"
1675: real-configure: _PORT_USE
1676: @${ECHO_MSG} "===> Configuring for ${PKGNAME}"
1677: real-build: _PORT_USE
1678: @${ECHO_MSG} "===> Building for ${PKGNAME}"
1679: real-install: _PORT_USE
1680: @${ECHO_MSG} "===> Installing for ${PKGNAME}"
1681: real-package: _PORT_USE
1682:
1683: # Empty pre-* and post-* targets, note we can't use .if !target()
1684: # in the _PORT_USE macro
1685:
1686: .for name in fetch extract patch configure build install package
1687:
1688: .if !target(pre-${name})
1689: pre-${name}:
1690: @${DO_NADA}
1691: .endif
1692:
1693: .if !target(post-${name})
1694: post-${name}:
1695: @${DO_NADA}
1696: .endif
1697:
1698: .endfor
1699:
1700: # Checkpatch
1701: #
1702: # Special target to verify patches
1.52 espie 1703:
1.1 niklas 1704: .if !target(checkpatch)
1705: checkpatch:
1.6 niklas 1706: @cd ${.CURDIR} && ${MAKE} PATCH_CHECK_ONLY=yes ${.MAKEFLAGS} patch
1.51 marc 1707: .endif
1.1 niklas 1708:
1709: # Reinstall
1710: #
1711: # Special target to re-run install
1712:
1713: .if !target(reinstall)
1.13 imp 1714: reinstall:
1.32 marc 1715: @${RM} -f ${INSTALL_PRE_COOKIE} ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
1.13 imp 1716: @DEPENDS_TARGET=${DEPENDS_TARGET} ${MAKE} install
1.1 niklas 1717: .endif
1718:
1.44 marc 1719: # Deinstall
1720: #
1721: # Special target to remove installation
1722:
1723: .if !target(deinstall)
1724: uninstall deinstall:
1725: @${ECHO_MSG} "===> Deinstalling for ${PKGNAME}"
1.52 espie 1726: @${PKG_DELETE} -f ${PKGNAME}
1.44 marc 1727: @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
1728: .endif
1729:
1730:
1.1 niklas 1731: ################################################################
1732: # Some more targets supplied for users' convenience
1733: ################################################################
1734:
1735: # Cleaning up
1736:
1737: .if !target(pre-clean)
1738: pre-clean:
1739: @${DO_NADA}
1740: .endif
1741:
1742: .if !target(clean)
1743: clean: pre-clean
1.9 imp 1744: .if !defined(NOCLEANDEPENDS)
1745: @${MAKE} clean-depends
1746: .endif
1.1 niklas 1747: @${ECHO_MSG} "===> Cleaning for ${PKGNAME}"
1.6 niklas 1748: .if !defined(NO_WRKDIR)
1.44 marc 1749: .if defined(WRKOBJDIR)
1750: @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
1751: @${RM} -f ${WRKDIR}
1752: .else
1.9 imp 1753: @if [ -d ${WRKDIR} ]; then \
1754: if [ -w ${WRKDIR} ]; then \
1755: ${RM} -rf ${WRKDIR}; \
1756: else \
1757: ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \
1758: fi; \
1759: fi
1.44 marc 1760: .endif
1.6 niklas 1761: .else
1.84 marc 1762: @${RM} -f ${WRKDIR}/.*_started ${WRKDIR}/.*_done
1.1 niklas 1763: .endif
1764: .endif
1765:
1.9 imp 1766: .if !target(pre-distclean)
1767: pre-distclean:
1768: @${DO_NADA}
1769: .endif
1770:
1771: .if !target(distclean)
1772: distclean: pre-distclean clean
1773: @${ECHO_MSG} "===> Dist cleaning for ${PKGNAME}"
1.13 imp 1774: @(if [ -d ${_DISTDIR} ]; then \
1775: cd ${_DISTDIR}; \
1776: ${RM} -f ${DISTFILES} ${PATCHFILES}; \
1777: fi)
1.9 imp 1778: .if defined(DIST_SUBDIR)
1.13 imp 1779: -@${RMDIR} ${_DISTDIR}
1.9 imp 1780: .endif
1781: .endif
1782:
1.1 niklas 1783: # Prints out a list of files to fetch (useful to do a batch fetch)
1784:
1.44 marc 1785: # are we called from bsd.port.subdir.mk (i.e. do we scan all dirs anyways)? XXX
1786: .ifdef(DIRPRFX)
1787: RECURSIVE_FETCH_LIST?= NO
1788: .else
1789: RECURSIVE_FETCH_LIST?= YES
1790: .endif
1791:
1.1 niklas 1792: .if !target(fetch-list)
1793: fetch-list:
1.44 marc 1794: @${MAKE} fetch-list-recursive RECURSIVE_FETCH_LIST=${RECURSIVE_FETCH_LIST} | sort -u
1795: .endif # !target(fetch-list)
1796:
1797: .if !target(fetch-list-recursive)
1798: fetch-list-recursive:
1799: @${MAKE} fetch-list-one-pkg
1800: .if ${RECURSIVE_FETCH_LIST} != "NO"
1801: @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
1802: (cd $$dir; ${MAKE} fetch-list-recursive; ); \
1803: done
1804: .endif # ${RECURSIVE_FETCH_LIST} != "NO"
1805: .endif # !target(fetch-list-recursive)
1806:
1807: .if !target(fetch-list-one-pkg)
1808: fetch-list-one-pkg:
1.9 imp 1809: @${MKDIR} ${_DISTDIR}
1.44 marc 1810: @[ -z "${_DISTDIR}" ] || ${ECHO} "${MKDIR} ${_DISTDIR}"
1.9 imp 1811: @(cd ${_DISTDIR}; \
1.1 niklas 1812: for file in ${DISTFILES}; do \
1813: if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
1.44 marc 1814: ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \
1815: for site in ${MASTER_SITES} ; do \
1816: ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \
1.1 niklas 1817: done; \
1818: ${ECHO} "echo $${file} not fetched" ; \
1819: fi \
1820: done)
1821: .if defined(PATCHFILES)
1.9 imp 1822: @(cd ${_DISTDIR}; \
1.1 niklas 1823: for file in ${PATCHFILES}; do \
1824: if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
1.44 marc 1825: ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \
1.1 niklas 1826: for site in ${PATCH_SITES}; do \
1.44 marc 1827: ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \
1.1 niklas 1828: done; \
1829: ${ECHO} "echo $${file} not fetched" ; \
1830: fi \
1.44 marc 1831: done)
1832: .endif # defined(PATCHFILES)
1833: .endif # !target(fetch-list-one-pkg)
1.1 niklas 1834:
1835: # Checksumming utilities
1836:
1837: .if !target(makesum)
1.85 ! espie 1838: makesum: fetch-all
1.9 imp 1839: @${MKDIR} ${FILESDIR}
1.75 espie 1840: @if [ -f ${CHECKSUM_FILE} ]; then ${RM} -f ${CHECKSUM_FILE}; fi
1.1 niklas 1841: @(cd ${DISTDIR}; \
1.9 imp 1842: for file in ${_CKSUMFILES}; do \
1.75 espie 1843: for cipher in ${CIPHERS:R}; do \
1844: $$cipher $$file >> ${CHECKSUM_FILE}; \
1845: done; \
1.1 niklas 1846: done)
1.9 imp 1847: @for file in ${_IGNOREFILES}; do \
1.75 espie 1848: ${ECHO} "MD5 ($$file) = IGNORE" >> ${CHECKSUM_FILE}; \
1.9 imp 1849: done
1.85 ! espie 1850: @sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
1.50 espie 1851: .endif
1852:
1853: .if !target(addsum)
1.85 ! espie 1854: addsum: fetch-all
1.50 espie 1855: @${MKDIR} ${FILESDIR}
1.75 espie 1856: @touch ${CHECKSUM_FILE}
1.50 espie 1857: @(cd ${DISTDIR}; \
1858: for file in ${_CKSUMFILES}; do \
1.75 espie 1859: for cipher in ${CIPHERS:R}; do \
1860: $$cipher $$file >> ${CHECKSUM_FILE}; \
1861: done; \
1.50 espie 1862: done)
1863: @for file in ${_IGNOREFILES}; do \
1.75 espie 1864: ${ECHO} "MD5 ($$file) = IGNORE" >> ${CHECKSUM_FILE}; \
1.50 espie 1865: done
1.85 ! espie 1866: @sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
1.75 espie 1867: @if [ `${SED} -e 's/\=.*$$//' ${CHECKSUM_FILE} | uniq -d | wc -l` -ne 0 ]; then \
1868: ${ECHO} "Inconsistent checksum in ${CHECKSUM_FILE}"; \
1.76 espie 1869: ${FALSE}; \
1.50 espie 1870: else \
1.75 espie 1871: ${ECHO} "${CHECKSUM_FILE} updated okay, don't forget to remove cruft"; \
1.50 espie 1872: fi
1.1 niklas 1873: .endif
1874:
1875: .if !target(checksum)
1876: checksum: fetch
1.75 espie 1877: @if [ ! -f ${CHECKSUM_FILE} ]; then \
1878: ${ECHO_MSG} ">> No checksum file."; \
1.1 niklas 1879: else \
1.9 imp 1880: (cd ${DISTDIR}; OK="true"; \
1881: for file in ${_CKSUMFILES}; do \
1.75 espie 1882: for cipher_sig in ${PREFERRED_CIPHERS}; do \
1883: sig=`${EXPR} $$cipher_sig : '.*\.\(.*\)'`; \
1884: CKSUM2=`${GREP} "^$$sig ($$file)" ${CHECKSUM_FILE} | ${AWK} '{print $$4}'`; \
1885: if [ "$$CKSUM2" = "" ]; then \
1886: ${ECHO_MSG} ">> No $$sig checksum recorded for $$file."; \
1887: else \
1888: cipher=`${EXPR} $$cipher_sig : '\(.*\)\.'`; \
1889: break; \
1890: fi; \
1891: done; \
1.1 niklas 1892: if [ "$$CKSUM2" = "" ]; then \
1.9 imp 1893: ${ECHO_MSG} ">> No checksum recorded for $$file."; \
1894: OK="false"; \
1895: elif [ "$$CKSUM2" = "IGNORE" ]; then \
1896: ${ECHO_MSG} ">> Checksum for $$file is set to IGNORE in md5 file even though"; \
1897: ${ECHO_MSG} " the file is not in the "'$$'"{IGNOREFILES} list."; \
1.1 niklas 1898: OK="false"; \
1.13 imp 1899: else \
1.75 espie 1900: CKSUM=`$$cipher < $$file`; \
1901: if [ "$$CKSUM" = "$$CKSUM2" ]; then \
1902: ${ECHO_MSG} ">> Checksum OK for $$file. ($$sig)"; \
1903: else \
1904: ${ECHO_MSG} ">> Checksum mismatch for $$file. ($$sig)"; \
1905: OK="false"; \
1906: fi; \
1.1 niklas 1907: fi; \
1908: done; \
1.9 imp 1909: for file in ${_IGNOREFILES}; do \
1.75 espie 1910: CKSUM2=`${GREP} "($$file)" ${CHECKSUM_FILE} | ${AWK} '{print $$4}'`; \
1.9 imp 1911: if [ "$$CKSUM2" = "" ]; then \
1912: ${ECHO_MSG} ">> No checksum recorded for $$file, file is in "'$$'"{IGNOREFILES} list."; \
1913: OK="false"; \
1914: elif [ "$$CKSUM2" != "IGNORE" ]; then \
1915: ${ECHO_MSG} ">> Checksum for $$file is not set to IGNORE in md5 file even though"; \
1916: ${ECHO_MSG} " the file is in the "'$$'"{IGNOREFILES} list."; \
1917: OK="false"; \
1918: fi; \
1919: done; \
1.13 imp 1920: if [ "$$OK" != "true" ]; then \
1.75 espie 1921: ${ECHO_MSG} "Make sure the Makefile and checksum file (${CHECKSUM_FILE})"; \
1.13 imp 1922: ${ECHO_MSG} "are up to date. If you want to override this check, type"; \
1923: ${ECHO_MSG} "\"make NO_CHECKSUM=yes [other args]\"."; \
1924: exit 1; \
1.1 niklas 1925: fi) ; \
1926: fi
1.32 marc 1927: .endif
1928:
1929: # packing list utilities. This generates a packing list from a recently
1930: # installed port. Not perfect, but pretty close. The generated file
1931: # will have to have some tweaks done by hand.
1.35 marc 1932: # Note: add @comment PACKAGE(arch=${ARCH}, opsys=${OPSYS}, vers=${OPSYS_VER})
1933: # when port is installed or package created.
1.32 marc 1934: #
1935: .if !target(plist)
1936: plist: install
1937: @${MKDIR} ${PKGDIR}
1938: @(dirs=""; \
1939: ld=""; \
1940: for f in `find ${PREFIX} -newer ${INSTALL_PRE_COOKIE} -print 2> /dev/null`; do \
1941: ff=`${ECHO} $$f | ${SED} -e 's|^${PREFIX}/||'`; \
1.53 form 1942: if [ -d $$f -a ! -h $$f ]; then dirs="$$ff $$dirs"; \
1.32 marc 1943: else \
1944: ${ECHO} $$ff; \
1.45 marc 1945: if ${ECHO} $$f | ${GREP} -E -q -e '[^/]+\.so\.[0-9]+\.[0-9]+$$'; then \
1.32 marc 1946: ld="$$LDCONFIG `${DIRNAME} $$f`"; \
1947: fi; \
1948: fi; \
1949: done; \
1950: for f in $$dirs; do \
1951: if ${GREP} -q -e `${BASENAME} $$f` ${MTREE_FILE}; then \
1952: :; \
1953: else \
1954: ${ECHO} "@dirrm $$f"; \
1955: fi; \
1956: done; \
1957: for f in $$ld; do ${ECHO} "@exec ${LDCONFIG} -m $$f"; done; \
1958: ) > ${PLIST}-auto
1.1 niklas 1959: .endif
1960:
1961: ################################################################
1962: # The special package-building targets
1963: # You probably won't need to touch these
1964: ################################################################
1965:
1.44 marc 1966: HTMLIFY= ${SED} -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g'
1967:
1968: # Set to YES by the README.html target (and passed via depends-list
1969: # and package-depends)
1970: .ifndef PACKAGE_NAME_AS_LINK
1971: PACKAGE_NAME_AS_LINK=NO
1972: .endif # PACKAGE_NAME_AS_LINK
1973:
1974:
1.1 niklas 1975: # Nobody should want to override this unless PKGNAME is simply bogus.
1976:
1977: .if !target(package-name)
1978: package-name:
1.44 marc 1979: .if (${PACKAGE_NAME_AS_LINK} == "YES")
1980: @${ECHO} '<A HREF="../../'`${MAKE} package-path | ${HTMLIFY}`'/README.html">'`echo ${PKGNAME} | ${HTMLIFY}`'</A>'
1981: .else
1982: @${ECHO} '${PKGNAME}'
1983: .endif # PACKAGE_NAME_AS_LINK != ""
1984: .endif # !target(package-name)
1985:
1986: .if !target(package-path)
1987: package-path:
1988: @pwd | sed s@`cd ${PORTSDIR} ; pwd`/@@g
1.1 niklas 1989: .endif
1990:
1991: # Show (recursively) all the packages this package depends on.
1992:
1993: .if !target(package-depends)
1994: package-depends:
1.13 imp 1995: @for dir in `${ECHO} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
1996: if [ -d $$dir ]; then \
1.44 marc 1997: (cd $$dir ; ${MAKE} package-name package-depends PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}); \
1.13 imp 1998: else \
1999: ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
2000: fi; \
1.1 niklas 2001: done
2002: .endif
2003:
2004: # Build a package but don't check the package cookie
2005:
2006: .if !target(repackage)
2007: repackage: pre-repackage package
2008:
2009: pre-repackage:
2010: @${RM} -f ${PACKAGE_COOKIE}
2011: .endif
2012:
2013: # Build a package but don't check the cookie for installation, also don't
2014: # install package cookie
2015:
2016: .if !target(package-noinstall)
2017: package-noinstall:
1.6 niklas 2018: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} PACKAGE_NOINSTALL=yes real-package
1.1 niklas 2019: .endif
2020:
2021: ################################################################
2022: # Dependency checking
2023: ################################################################
2024:
2025: .if !target(depends)
2026: depends: lib-depends misc-depends
1.6 niklas 2027: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} fetch-depends
2028: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends
2029: @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends
1.1 niklas 2030:
2031: .if make(fetch-depends)
2032: DEPENDS_TMP+= ${FETCH_DEPENDS}
2033: .endif
2034:
2035: .if make(build-depends)
2036: DEPENDS_TMP+= ${BUILD_DEPENDS}
2037: .endif
2038:
2039: .if make(run-depends)
2040: DEPENDS_TMP+= ${RUN_DEPENDS}
2041: .endif
2042:
2043: _DEPENDS_USE: .USE
2044: .if defined(DEPENDS_TMP)
1.13 imp 2045: .if !defined(NO_DEPENDS)
1.52 espie 2046: @PATH=${PORTPATH}; \
2047: for i in ${DEPENDS_TMP}; do \
1.1 niklas 2048: prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
1.13 imp 2049: dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
1.52 espie 2050: if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.13 imp 2051: target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
2052: dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
1.1 niklas 2053: else \
1.13 imp 2054: target=${DEPENDS_TARGET}; \
1.1 niklas 2055: fi; \
1.44 marc 2056: found=not; \
1.52 espie 2057: if ${EXPR} "$$prog" : \\/ >/dev/null; then \
1.1 niklas 2058: if [ -e "$$prog" ]; then \
2059: ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \
1.44 marc 2060: found=""; \
1.1 niklas 2061: else \
2062: ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \
2063: fi; \
2064: else \
1.44 marc 2065: for d in `echo $$PATH | tr ':' ' '`; do \
2066: if [ -x $$d/$$prog ]; then \
2067: found="$$d/$$prog"; \
2068: break; \
2069: fi \
2070: done; \
2071: ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - $$found found"; \
1.1 niklas 2072: fi; \
1.44 marc 2073: if [ X"$$found" = Xnot ]; then \
1.13 imp 2074: ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \
1.1 niklas 2075: if [ ! -d "$$dir" ]; then \
2076: ${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \
2077: else \
1.13 imp 2078: (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
1.1 niklas 2079: ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \
2080: fi; \
2081: fi; \
2082: done
2083: .endif
2084: .else
2085: @${DO_NADA}
2086: .endif
2087:
2088: fetch-depends: _DEPENDS_USE
2089: build-depends: _DEPENDS_USE
2090: run-depends: _DEPENDS_USE
2091:
2092: lib-depends:
2093: .if defined(LIB_DEPENDS)
1.13 imp 2094: .if !defined(NO_DEPENDS)
1.64 marc 2095: .if defined(NO_SHARED_LIBS)
1.16 niklas 2096: @for i in ${LIB_DEPENDS}; do \
1.83 marc 2097: lib=`${ECHO} $$i | ${SED} -e 's/:.*//' -e 's|\([^\\]\)[\\\.].*|\1|'`; \
1.16 niklas 2098: dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
1.52 espie 2099: if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.16 niklas 2100: target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
2101: dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
2102: else \
2103: target=${DEPENDS_TARGET}; \
2104: fi; \
1.17 niklas 2105: tmp=`mktemp /tmp/bpmXXXXXXXXXX`; \
1.42 marc 2106: if ${LD} -r -o $$tmp -L${LOCALBASE}/lib -L${X11BASE}/lib -l$$lib; then \
1.16 niklas 2107: ${ECHO_MSG} "===> ${PKGNAME} depends on library: $$lib - found"; \
2108: else \
2109: ${ECHO_MSG} "===> ${PKGNAME} depends on library: $$lib - not found"; \
2110: ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \
2111: if [ ! -d "$$dir" ]; then \
2112: ${ECHO_MSG} ">> No directory for $$lib. Skipping.."; \
2113: else \
2114: (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
2115: ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \
2116: fi; \
2117: fi; \
1.17 niklas 2118: ${RM} -f $$tmp; \
1.16 niklas 2119: done
2120: .else
1.1 niklas 2121: @for i in ${LIB_DEPENDS}; do \
1.44 marc 2122: lib=`${ECHO} $$i | ${SED} -e 's/:.*//' -e 's|\([^\\]\)\.|\1\\\\.|g'`; \
1.13 imp 2123: dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
1.52 espie 2124: if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.13 imp 2125: target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
2126: dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
2127: else \
2128: target=${DEPENDS_TARGET}; \
2129: fi; \
1.44 marc 2130: libname=`${ECHO} $$lib | ${SED} -e 's|\\\\||g'`; \
2131: reallib=`${LDCONFIG} -r | ${GREP} -e "-l$$lib" | awk '{ print $$3 }'`; \
2132: if [ "X$$reallib" = X"" ]; then \
2133: ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$libname - not found"; \
2134: ${ECHO_MSG} "===> Verifying $$target for $$libname in $$dir"; \
1.1 niklas 2135: if [ ! -d "$$dir" ]; then \
1.44 marc 2136: ${ECHO_MSG} ">> No directory for $$libname. Skipping.."; \
1.1 niklas 2137: else \
1.13 imp 2138: (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
1.1 niklas 2139: ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \
2140: fi; \
1.44 marc 2141: else \
2142: ${ECHO_MSG} "===> ${PKGNAME} depends on shared library: $$libname - $$reallib found"; \
1.1 niklas 2143: fi; \
2144: done
1.16 niklas 2145: .endif
1.1 niklas 2146: .endif
2147: .else
2148: @${DO_NADA}
2149: .endif
2150:
2151: misc-depends:
2152: .if defined(DEPENDS)
2153: .if !defined(NO_DEPENDS)
1.13 imp 2154: @for dir in ${DEPENDS}; do \
1.52 espie 2155: if ${EXPR} "$$dir" : '.*:' > /dev/null; then \
1.13 imp 2156: target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
2157: dir=`${ECHO} $$dir | ${SED} -e 's/:.*//'`; \
2158: else \
2159: target=${DEPENDS_TARGET}; \
2160: fi; \
2161: ${ECHO_MSG} "===> ${PKGNAME} depends on: $$dir"; \
2162: ${ECHO_MSG} "===> Verifying $$target for $$dir"; \
2163: if [ ! -d $$dir ]; then \
2164: ${ECHO_MSG} ">> No directory for $$dir. Skipping.."; \
1.1 niklas 2165: else \
1.13 imp 2166: (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
1.1 niklas 2167: fi \
2168: done
2169: @${ECHO_MSG} "===> Returning to build of ${PKGNAME}"
2170: .endif
2171: .else
2172: @${DO_NADA}
2173: .endif
2174:
2175: .endif
2176:
1.9 imp 2177: .if !target(clean-depends)
2178: clean-depends:
2179: .if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) \
2180: || defined(RUN_DEPENDS)
1.13 imp 2181: @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u`; do \
2182: if [ -d $$dir ] ; then \
2183: (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
2184: fi \
1.9 imp 2185: done
2186: .endif
2187: .if defined(DEPENDS)
1.13 imp 2188: @for dir in `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
2189: if [ -d $$dir ] ; then \
2190: (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \
2191: fi \
1.9 imp 2192: done
2193: .endif
2194: .endif
2195:
1.1 niklas 2196: .if !target(depends-list)
2197: depends-list:
1.13 imp 2198: @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
1.44 marc 2199: (cd $$dir; ${MAKE} package-name depends-list PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}; ); \
1.1 niklas 2200: done
2201: .endif
2202:
2203: ################################################################
2204: # Everything after here are internal targets and really
2205: # shouldn't be touched by anybody but the release engineers.
2206: ################################################################
2207:
2208: # This target generates an index entry suitable for aggregation into
2209: # a large index. Format is:
2210: #
2211: # distribution-name|port-path|installation-prefix|comment| \
1.44 marc 2212: # description-file|maintainer|categories|build deps|run deps|for arch
1.1 niklas 2213: #
2214: .if !target(describe)
2215: describe:
1.13 imp 2216: @${ECHO} -n "${PKGNAME}|${.CURDIR}|"; \
2217: ${ECHO} -n "${PREFIX}|"; \
2218: if [ -f ${COMMENT} ]; then \
2219: ${ECHO} -n "`${CAT} ${COMMENT}`"; \
1.1 niklas 2220: else \
2221: ${ECHO} -n "** No Description"; \
1.13 imp 2222: fi; \
2223: if [ -f ${DESCR} ]; then \
2224: ${ECHO} -n "|${DESCR}"; \
1.1 niklas 2225: else \
2226: ${ECHO} -n "|/dev/null"; \
1.13 imp 2227: fi; \
2228: ${ECHO} -n "|${MAINTAINER}|${CATEGORIES}|"; \
2229: case "A${FETCH_DEPENDS}B${BUILD_DEPENDS}C${LIB_DEPENDS}D${DEPENDS}E" in \
2230: ABCDE) ;; \
2231: *) cd ${.CURDIR} && ${ECHO} -n `make depends-list|sort -u`;; \
2232: esac; \
2233: ${ECHO} -n "|"; \
2234: case "A${RUN_DEPENDS}B${LIB_DEPENDS}C${DEPENDS}D" in \
2235: ABCD) ;; \
2236: *) cd ${.CURDIR} && ${ECHO} -n `make package-depends|sort -u`;; \
2237: esac; \
1.44 marc 2238: ${ECHO} -n "|"; \
2239: if [ "${ONLY_FOR_ARCHS}" = "" ]; then \
2240: ${ECHO} -n "any"; \
2241: else \
2242: ${ECHO} -n "${ONLY_FOR_ARCHS}"; \
2243: fi; \
1.13 imp 2244: ${ECHO} ""
1.1 niklas 2245: .endif
2246:
2247: .if !target(readmes)
2248: readmes: readme
2249: .endif
2250:
2251: .if !target(readme)
2252: readme:
2253: @rm -f README.html
1.6 niklas 2254: @cd ${.CURDIR} && make README.html
1.1 niklas 2255: .endif
2256:
1.44 marc 2257: README_NAME= ${TEMPLATES}/README.port
2258:
1.1 niklas 2259: README.html:
2260: @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}"
1.44 marc 2261: @${MAKE} depends-list PACKAGE_NAME_AS_LINK=YES >> $@.tmp1
2262: @[ -s $@.tmp1 ] || echo "(none)" >> $@.tmp1
2263: @${MAKE} package-depends PACKAGE_NAME_AS_LINK=YES >> $@.tmp2
2264: @[ -s $@.tmp2 ] || echo "(none)" >> $@.tmp2
2265: @${ECHO} ${PKGNAME} | ${HTMLIFY} >> $@.tmp3
2266: @${CAT} ${README_NAME} | \
2267: ${SED} -e 's|%%PORT%%|'"`${MAKE} package-path | ${HTMLIFY}`"'|g' \
2268: -e '/%%PKG%%/r$@.tmp3' \
2269: -e '/%%PKG%%/d' \
1.1 niklas 2270: -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \
2271: -e '/%%COMMENT%%/d' \
1.44 marc 2272: -e '/%%BUILD_DEPENDS%%/r$@.tmp1' \
2273: -e '/%%BUILD_DEPENDS%%/d' \
2274: -e '/%%RUN_DEPENDS%%/r$@.tmp2' \
2275: -e '/%%RUN_DEPENDS%%/d' \
1.1 niklas 2276: >> $@
1.44 marc 2277: @rm -f $@.tmp1 $@.tmp2 $@.tmp3
1.1 niklas 2278:
2279: .if !target(print-depends-list)
2280: print-depends-list:
2281: .if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || \
2282: defined(LIB_DEPENDS) || defined(DEPENDS)
2283: @${ECHO} -n 'This port requires package(s) "'
1.9 imp 2284: @${ECHO} -n `make depends-list | sort -u`
1.1 niklas 2285: @${ECHO} '" to build.'
2286: .endif
2287: .endif
2288:
2289: .if !target(print-package-depends)
2290: print-package-depends:
2291: .if defined(RUN_DEPENDS) || defined(LIB_DEPENDS) || defined(DEPENDS)
2292: @${ECHO} -n 'This port requires package(s) "'
1.9 imp 2293: @${ECHO} -n `make package-depends | sort -u`
1.1 niklas 2294: @${ECHO} '" to run.'
2295: .endif
2296: .endif
2297:
2298: # Fake installation of package so that user can pkg_delete it later.
2299: # Also, make sure that an installed port is recognized correctly in
2300: # accordance to the @pkgdep directive in the packing lists
2301:
2302: .if !target(fake-pkg)
2303: fake-pkg:
1.13 imp 2304: @if [ ! -f ${PLIST} -o ! -f ${COMMENT} -o ! -f ${DESCR} ]; then ${ECHO} "** Missing package files for ${PKGNAME} - installation not recorded."; exit 1; fi
1.66 marc 2305: @if [ `/bin/ls -l ${COMMENT} | ${AWK} '{print $$5}'` -gt 60 ]; then \
2306: ${ECHO} "** ${COMMENT} too large - installation not recorded."; \
2307: exit 1; \
2308: fi
1.9 imp 2309: @if [ ! -d ${PKG_DBDIR} ]; then ${RM} -f ${PKG_DBDIR}; ${MKDIR} ${PKG_DBDIR}; fi
1.1 niklas 2310: .if defined(FORCE_PKG_REGISTER)
2311: @${RM} -rf ${PKG_DBDIR}/${PKGNAME}
2312: .endif
2313: @if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
2314: ${ECHO_MSG} "===> Registering installation for ${PKGNAME}"; \
1.9 imp 2315: ${MKDIR} ${PKG_DBDIR}/${PKGNAME}; \
1.1 niklas 2316: ${PKG_CMD} ${PKG_ARGS} -O ${PKGFILE} > ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \
1.13 imp 2317: ${CP} ${DESCR} ${PKG_DBDIR}/${PKGNAME}/+DESC; \
2318: ${CP} ${COMMENT} ${PKG_DBDIR}/${PKGNAME}/+COMMENT; \
1.1 niklas 2319: if [ -f ${PKGDIR}/INSTALL ]; then \
2320: ${CP} ${PKGDIR}/INSTALL ${PKG_DBDIR}/${PKGNAME}/+INSTALL; \
2321: fi; \
2322: if [ -f ${PKGDIR}/DEINSTALL ]; then \
2323: ${CP} ${PKGDIR}/DEINSTALL ${PKG_DBDIR}/${PKGNAME}/+DEINSTALL; \
2324: fi; \
2325: if [ -f ${PKGDIR}/REQ ]; then \
2326: ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \
2327: fi; \
1.44 marc 2328: if [ -f ${PKGDIR}/MESSAGE ]; then \
2329: ${CP} ${PKGDIR}/MESSAGE ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
2330: fi; \
2331: for dep in `make package-depends ECHO_MSG=${TRUE} | sort -u`; do \
1.13 imp 2332: if [ -d ${PKG_DBDIR}/$$dep ]; then \
2333: if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \
2334: >/dev/null 2>&1; then \
2335: ${ECHO} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \
2336: fi; \
2337: fi; \
2338: done; \
1.1 niklas 2339: fi
2340: .endif
2341:
2342: # Depend is generally meaningless for arbitrary ports, but if someone wants
2343: # one they can override this. This is just to catch people who've gotten into
2344: # the habit of typing `make depend all install' as a matter of course.
2345: #
2346: .if !target(depend)
2347: depend:
2348: .endif
2349:
2350: # Same goes for tags
2351: .if !target(tags)
2352: tags:
1.10 niklas 2353: .endif
2354:
1.68 espie 2355: .PHONY: \
2356: addsum all build build-depends checkpatch \
2357: checksum clean clean-depends configure deinstall \
2358: delete-package delete-package-links depend depends depends-list \
2359: describe distclean do-build do-configure do-extract \
1.82 marc 2360: do-fetch do-install do-package do-patch extract list-distfiles \
1.68 espie 2361: fake-pkg fetch fetch-depends fetch-list fetch-list-one-pkg \
2362: fetch-list-recursive install lib-depends makesum mirror-distfiles \
2363: misc-depends package package-depends package-links package-name \
2364: package-noinstall package-path patch plist post-build \
2365: post-configure post-extract post-fetch post-install post-package \
2366: post-patch pre-build pre-clean pre-configure pre-distclean \
2367: pre-extract pre-fetch pre-install pre-package pre-patch \
2368: pre-repackage print-depends-list print-package-depends readme \
2369: readmes real-extract real-fetch real-install reinstall \
1.85 ! espie 2370: repackage run-depends tags uninstall fetch-all