aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorkrion <krion@FreeBSD.org>2004-11-19 21:45:07 +0800
committerkrion <krion@FreeBSD.org>2004-11-19 21:45:07 +0800
commitf5491a4ff9033cd11b3395f776401f56b5ab93a7 (patch)
tree9e8b4749b0bc68429e958dce4b618bd617c0366d /Mk
parenta29610b2becc324d37650fc70af010751d83c612 (diff)
downloadfreebsd-ports-gnome-f5491a4ff9033cd11b3395f776401f56b5ab93a7.tar.gz
freebsd-ports-gnome-f5491a4ff9033cd11b3395f776401f56b5ab93a7.tar.zst
freebsd-ports-gnome-f5491a4ff9033cd11b3395f776401f56b5ab93a7.zip
* Fix INDEX build if MAINTAINER is not defined. [1]
* Remove USE_QT2 since it's obsolete now. [2] * Clarify comments about ARCH. [3] * Speedup 'make readmes'. Add a perl script "Tools/make_readmes" and modify bsd.port.subdir.mk to avoid recursing into individual port directories to create README.html. [4] * Fix 'make search' to allow case insensitive search on 5-x/6-x. [5] * Add the possibility to search the ports by category. [6] * Remove tk42 and tcl76 from virtual categories since they're obsolete. [7] * Introduce new variable - DISTVERSION, vendor version of the distribution, that can be set instead of PORTVERSION and is automatically converted in a conforming PORTVERSION. [8] * Use --suffix instead of -b option for patch(1) to make it compatible with BSD patch(1) [9] * Fix {WANT,WITH}_MYSQL_VER behavior, to deal with conflicting versions. [10] PR: ports/68895 [1], ports/69486 [2], ports/68539 [3], ports/70018 [4], ports/68896 [5], ports/73299 [6], ports/73570 [7], ports/67171 [8], ports/72182 [9] Submitted by: linimon [1][3], arved [2][7], cperciva [4], Matthew Seaman <m.seaman@infracaninophile.co.uk> [5], Radek Kozlowski <radek@raadradd.com> [6], eik [8], Andreas Hauser <andy-freebsd@splashground.de> [9], clement [10]
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk61
-rw-r--r--Mk/bsd.port.subdir.mk32
2 files changed, 65 insertions, 28 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index c63174abbcac..f4d955b86efb 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -37,7 +37,10 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# you are running on. These are provided in case you need to take
# different actions for different values.
#
-# ARCH - The architecture, as returned by "uname -p".
+# ARCH - The architecture of the target machine, such as would be
+# returned by "uname -p". (Note: Ports should test against
+# ARCH, and not the host machine's architecture which is
+# MACHINE_ARCH, to enable ports to be cross-built.)
# OPSYS - Portability clause. This is the operating system the
# makefile is being used on. Automatically set to
# "FreeBSD," "NetBSD," or "OpenBSD" as appropriate.
@@ -53,7 +56,7 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# These variables are used to identify your port.
#
# PORTNAME - Name of software. Mandatory.
-# PORTVERSION - Version of software. Mandatory.
+# PORTVERSION - Version of software. Mandatory when no DISTVERSION is given.
# PORTREVISION - Version of port. Optional. Commonly used to indicate
# that an update has happened that affects the port
# framework itself, but not the distributed software
@@ -72,9 +75,10 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# UNIQUENAME - A name for your port that is globally unique. By default,
# this is set to ${LATEST_LINK} when LATEST_LINK is set,
# and to ${PKGNAMEPREFIX}${PORTNAME} otherwise.
+# DISTVERSION - Vendor version of the distribution (default: ${PORTVERSION})
# DISTNAME - Name of port or distribution used in generating
# WRKSRC and DISTFILES below (default:
-# ${PORTNAME}-${PORTVERSION}).
+# ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX})
# CATEGORIES - A list of descriptive categories into which this port falls.
# Mandatory.
#
@@ -320,9 +324,8 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org
# USE_KDELIBS_VER - Set to 3 to use the KDE libraries.
# Implies inclusion
# of bsd.kde.mk. Default: not set.
-# USE_QT_VER - Set to either 2 or 3 to use the QT libraries.
-# (Only 3 is currently supported). Implies inclusion
-# of bsd.kde.mk. Default: not set.
+# USE_QT_VER - Set to 3 to use the QT libraries.
+# Implies inclusion of bsd.kde.mk. Default: not set.
#
# USE_LINUX - Set to yes to say the port needs emulators/linux_base.
# Default: not set.
@@ -885,6 +888,9 @@ ECHO_CMD?= echo # Shell builtin
# Used to print all the '===>' style prompts - override this to turn them off.
ECHO_MSG?= ${ECHO_CMD}
+# Get the default maintainer
+MAINTAINER?= ports@FreeBSD.org
+
# Get the architecture
.if !defined(ARCH)
ARCH!= ${UNAME} -p
@@ -968,7 +974,7 @@ _OPTIONSFILE!= ${ECHO_CMD} "${OPTIONSFILE}"
.endif
# check for old, crufty, makefile types, part 1:
-.if !defined(PORTNAME) || !defined(PORTVERSION) || defined(PKGNAME)
+.if !defined(PORTNAME) || !( defined(PORTVERSION) || defined (DISTVERSION) ) || defined(PKGNAME)
check-makefile::
@${ECHO_CMD} "Makefile error: you need to define PORTNAME and PORTVERSION instead of PKGNAME."
@${ECHO_CMD} "(This port is too old for your bsd.port.mk, please update it to match"
@@ -980,6 +986,9 @@ check-makefile::
.if ${PORTVERSION:M*[-_,]*}x != x
BROKEN= "PORTVERSION ${PORTVERSION} may not contain '-' '_' or ','"
.endif
+DISTVERSION?= ${PORTVERSION:S/:/::/g}
+.elif defined(DISTVERSION)
+PORTVERSION= ${DISTVERSION:L:C/([a-z])[a-z]+/\1/g:C/([0-9])([a-z])/\1.\2/g:C/:(.)/\1/g:C/[^a-z0-9+]+/./g}
.endif
PORTREVISION?= 0
@@ -997,7 +1006,7 @@ _SUF2= ,${PORTEPOCH}
.if !defined(PKGNAME)
PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
.endif
-DISTNAME?= ${PORTNAME}-${PORTVERSION}
+DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
# These need to be absolute since we don't know how deep in the ports
# tree we are and thus can't go relative. They can, of course, be overridden
@@ -1161,7 +1170,7 @@ PERL= ${LOCALBASE}/bin/perl
.include "${PORTSDIR}/Mk/bsd.ruby.mk"
.endif
-.if defined(USE_QT) || defined(USE_QT2) || defined(USE_QT_VER) || defined(USE_KDELIBS_VER) || defined(USE_KDEBASE_VER)
+.if defined(USE_QT_VER) || defined(USE_KDELIBS_VER) || defined(USE_KDEBASE_VER)
.include "${PORTSDIR}/Mk/bsd.kde.mk"
.endif
@@ -1548,16 +1557,31 @@ MYSQL41_LIBVER= 14
MYSQL50_LIBVER= 14
# Setting/finding MySQL version we want.
+.if exists(${LOCALBASE}/bin/mysql)
+_MYSQL_VER!= ${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'
+.endif
+
.if defined(WANT_MYSQL_VER)
+.if defined(WITH_MYSQL_VER) && ${WITH_MYSQL_VER} != ${WANT_MYSQL_VER}
+BROKEN= The port wants mysql${WANT_MYSQL_VER}-client and you try to install mysql${WITH_MYSQL_VER}-client.
+.endif
MYSQL_VER= ${WANT_MYSQL_VER}
.elif defined(WITH_MYSQL_VER)
MYSQL_VER= ${WITH_MYSQL_VER}
-.elif exists(${LOCALBASE}/bin/mysql)
-MYSQL_VER!= ${LOCALBASE}/bin/mysql --version | ${SED} -e 's/.*Distrib \([0-9]\)\.\([0-9]*\).*/\1\2/'
+.else
+.if defined(_MYSQL_VER)
+MYSQL_VER= ${_MYSQL_VER}
.else
MYSQL_VER= ${DEFAULT_MYSQL_VER}
+.endif
.endif # WANT_MYSQL_VER
+.if defined(_MYSQL_VER)
+.if ${_MYSQL_VER} != ${MYSQL_VER}
+BROKEN= MySQL versions mismatch: mysql${_MYSQL_VER}-client is installed and wanted version is mysql${MYSQL_VER}-client
+.endif
+.endif
+
# And now we are checking if we can use it
.if exists(${PORTSDIR}/databases/mysql${MYSQL_VER}-client)
.if defined(BROKEN_WITH_MYSQL)
@@ -1729,11 +1753,11 @@ PATCH_DIST_STRIP?= -p0
.if defined(PATCH_DEBUG)
PATCH_DEBUG_TMP= yes
PATCH_ARGS?= -d ${PATCH_WRKSRC} -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?= -b ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
+PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} -E ${PATCH_DIST_STRIP}
.else
PATCH_DEBUG_TMP= no
PATCH_ARGS?= -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_STRIP}
-PATCH_DIST_ARGS?= -b ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
+PATCH_DIST_ARGS?= --suffix ${DISTORIG} -d ${PATCH_WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP}
.endif
.if defined(BATCH)
PATCH_ARGS+= --batch
@@ -1749,8 +1773,8 @@ PATCH_DIST_ARGS+= -C
.endif
.if ${PATCH} == "/usr/bin/patch"
-PATCH_ARGS+= -b .orig
-PATCH_DIST_ARGS+= -b .orig
+PATCH_ARGS+= --suffix .orig
+PATCH_DIST_ARGS+= --suffix .orig
.endif
.if exists(/bin/tar)
@@ -2325,9 +2349,6 @@ _IGNOREFILES?= ${IGNOREFILES}
# by user.
EXTRACT_ONLY?= ${_DISTFILES}
-# Documentation
-MAINTAINER?= ports@FreeBSD.org
-
.if !target(maintainer)
maintainer:
@${ECHO_CMD} "${MAINTAINER}"
@@ -2353,8 +2374,8 @@ VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
offix palm parallel pear perl5 picobsd plan9 polish portuguese print \
python ruby russian \
scheme science security shells sysutils \
- tcl76 tcl80 tcl81 tcl82 tcl83 tcl84 textproc \
- tk42 tk80 tk82 tk83 tk84 tkstep80 \
+ tcl80 tcl81 tcl82 tcl83 tcl84 textproc \
+ tk80 tk82 tk83 tk84 tkstep80 \
ukrainian vietnamese windowmaker www \
x11 x11-clocks x11-fm x11-fonts x11-servers x11-themes x11-toolkits \
x11-wm xfce zope
diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk
index a8f926466762..84d3638846a5 100644
--- a/Mk/bsd.port.subdir.mk
+++ b/Mk/bsd.port.subdir.mk
@@ -236,7 +236,13 @@ describe:
.endif
.if !target(readmes)
+.if defined(PORTSTOP)
readmes: readme ${SUBDIR:S/^/_/:S/$/.readmes/}
+ @${ECHO_MSG} "===> Creating README.html for all ports"
+ @perl ${.CURDIR}/Tools/make_readmes < ${.CURDIR}/${INDEXFILE}
+.else
+readmes: readme
+.endif
.endif
.if !target(readme)
@@ -332,6 +338,7 @@ search: ${PORTSDIR}/${INDEXFILE}
-z "$$path" -a -z "$$xpath" -a \
-z "$$info" -a -z "$$xinfo" -a \
-z "$$maint" -a -z "$$xmaint" -a \
+ -z "$$cat" -a -z "$$xcat" -a \
-z "$$bdeps" -a -z "$$xbdeps" -a \
-z "$$rdeps" -a -z "$$xrdeps" ]; \
then \
@@ -351,19 +358,27 @@ search: ${PORTSDIR}/${INDEXFILE}
-v rdeps="$$rdeps" -v xrdeps="$$xrdeps" \
-v icase="$${icase:-${PORTSEARCH_IGNORECASE}}" \
-v keylim="$${keylim:-${PORTSEARCH_KEYLIM}}" \
- -v xkeylim="$${xkeylim:-${PORTSEARCH_XKEYLIM}}"\
+ -v xkeylim="$${xkeylim:-${PORTSEARCH_XKEYLIM}}" \
-v display="$${display:-${PORTSEARCH_DISPLAY_FIELDS}}" \
'BEGIN { \
if (substr(there, 1, length(top)) == top) \
there = "${PORTSDIR}" substr(there, 1 + length(top)); \
therelen = length(there); \
- IGNORECASE=icase; \
keylen = length(key); keylim = keylim && keylen; \
if (!keylim && keylen) \
- parms[0] = key; \
+ parms[0] = (icase ? tolower(key) : key); \
xkeylen = length(xkey); xkeylim = xkeylim && xkeylen; \
if (!xkeylim && xkeylen) \
- xparms[0] = xkey; \
+ xparms[0] = (icase ? tolower(xkey) : xkey); \
+ if (icase) { \
+ if (length(name)) parms[1] = tolower(name); if (length(xname)) xparms[1] = tolower(xname); \
+ if (length(path)) parms[2] = tolower(path); if (length(xpath)) xparms[2] = tolower(xpath); \
+ if (length(info)) parms[4] = tolower(info); if (length(xinfo)) xparms[4] = tolower(xinfo); \
+ if (length(maint)) parms[6] = tolower(maint); if (length(xmaint)) xparms[6] = tolower(xmaint); \
+ if (length(cat)) parms[7] = tolower(cat); if (length(xcat)) xparms[7] = tolower(xcat); \
+ if (length(bdeps)) parms[8] = tolower(bdeps); if (length(xbdeps)) xparms[8] = tolower(xbdeps); \
+ if (length(rdeps)) parms[9] = tolower(rdeps); if (length(xrdeps)) xparms[9] = tolower(xrdeps); \
+ } else { \
if (length(name)) parms[1] = name; if (length(xname)) xparms[1] = xname; \
if (length(path)) parms[2] = path; if (length(xpath)) xparms[2] = xpath; \
if (length(info)) parms[4] = info; if (length(xinfo)) xparms[4] = xinfo; \
@@ -371,6 +386,7 @@ search: ${PORTSDIR}/${INDEXFILE}
if (length(cat)) parms[7] = cat; if (length(xcat)) xparms[7] = xcat; \
if (length(bdeps)) parms[8] = bdeps; if (length(xbdeps)) xparms[8] = xbdeps; \
if (length(rdeps)) parms[9] = rdeps; if (length(xrdeps)) xparms[9] = xrdeps; \
+ } \
fields["name"] = 1; names[1] = "Port"; \
fields["path"] = 2; names[2] = "Path"; \
fields["info"] = 4; names[4] = "Info"; \
@@ -387,17 +403,17 @@ search: ${PORTSDIR}/${INDEXFILE}
if (substr($$2, 1, therelen) != there) \
next; \
for (i in parms) \
- if ($$i !~ parms[i]) \
+ if ((icase ? tolower($$i) : $$i) !~ parms[i]) \
next; \
for (i in xparms) \
- if ($$i ~ xparms[i]) \
+ if ((icase ? tolower($$i) : $$i) ~ xparms[i]) \
next; \
found = 0; \
for (i = 1; i < 10; i++) \
if (i in disp) { \
- if (xkeylim && $$i ~ xkey) \
+ if (xkeylim && (icase ? tolower($$i) : $$i) ~ xkey) \
next; \
- if (!found && keylim && $$i ~ key) \
+ if (!found && keylim && (icase ? tolower($$i) : $$i) ~ key) \
found = 1; \
} \
if (keylim && !found) \