pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Apply the "convention over configuration" principle:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7dbf73094324
branches:  trunk
changeset: 516770:7dbf73094324
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Jul 27 15:16:44 2006 +0000

description:
Apply the "convention over configuration" principle:

If ${FILESDIR}/getsite.sh exists, then use it to determine the fetch
URL for each of the distfiles for the package.  Otherwise, use
SITE_<file> and MASTER_SITES, in order, to determine the URL for each
distfile.

If the script path differs from ${FILESDIR}/getsite.sh, then set
DYNAMIC_SITE_SCRIPT to the full path to that script.

Remove the need to set DYNAMIC_MASTER_SITES explicitly in the package
Makefile for:

        graphics/ns-cult3d
        wm/sawfish-themes
        www/apache-tomcat55
        www/jakarta-tomcat4
        www/jakarta-tomcat5

diffstat:

 doc/Makefile-example         |  4 ++--
 graphics/ns-cult3d/Makefile  |  3 +--
 mk/fetch/fetch-list.mk       |  8 ++++----
 mk/fetch/fetch.mk            |  8 +++++---
 wm/sawfish-themes/Makefile   |  3 +--
 www/apache-tomcat55/Makefile |  3 +--
 www/jakarta-tomcat4/Makefile |  3 +--
 www/jakarta-tomcat5/Makefile |  3 +--
 8 files changed, 16 insertions(+), 19 deletions(-)

diffs (151 lines):

diff -r ea1cce0ab180 -r 7dbf73094324 doc/Makefile-example
--- a/doc/Makefile-example      Thu Jul 27 14:54:07 2006 +0000
+++ b/doc/Makefile-example      Thu Jul 27 15:16:44 2006 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile-example,v 1.13 2006/04/09 01:14:52 jlam Exp $
+# $NetBSD: Makefile-example,v 1.14 2006/07/27 15:16:44 jlam Exp $
 
 # First paragraph - distfile and binary package data
 # DISTNAME PKGNAME PKGREVISION SVR4_PKGNAME CATEGORIES MASTER_SITES
-# DYNAMIC_MASTER_SITES MASTER_SITE_SUBDIR EXTRACT_SUFX DISTFILES
+# MASTER_SITE_SUBDIR EXTRACT_SUFX DISTFILES
 DISTNAME=              make-3.80
 PKGNAME=               gmake-3.80      # only to be added if the package name is different from DISTNAME
 #PKGREVISION=          2               # should be added/incremented for user-visible changes
diff -r ea1cce0ab180 -r 7dbf73094324 graphics/ns-cult3d/Makefile
--- a/graphics/ns-cult3d/Makefile       Thu Jul 27 14:54:07 2006 +0000
+++ b/graphics/ns-cult3d/Makefile       Thu Jul 27 15:16:44 2006 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.7 2006/05/22 22:22:03 jlam Exp $
+# $NetBSD: Makefile,v 1.8 2006/07/27 15:16:44 jlam Exp $
 #
 
 DISTNAME=      Cult3D_NS4_5.2b1
 PKGNAME=       ns-cult3d-5.2
 CATEGORIES=    www graphics
-DYNAMIC_MASTER_SITES= YES
 
 MAINTAINER=    abs%NetBSD.org@localhost
 HOMEPAGE=      http://www.cult3d.com/
diff -r ea1cce0ab180 -r 7dbf73094324 mk/fetch/fetch-list.mk
--- a/mk/fetch/fetch-list.mk    Thu Jul 27 14:54:07 2006 +0000
+++ b/mk/fetch/fetch-list.mk    Thu Jul 27 15:16:44 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: fetch-list.mk,v 1.3 2006/07/27 13:51:21 jlam Exp $
+# $NetBSD: fetch-list.mk,v 1.4 2006/07/27 15:16:44 jlam Exp $
 
 # Prints out a script to fetch all needed files (no checksumming).
 .PHONY: fetch-list
@@ -44,7 +44,7 @@
        @location=`${PWD_CMD} | ${AWK} -F / '{ print $$(NF-1) "/" $$NF }'`; \
                ${ECHO} '# Need additional files for ${PKGNAME} ('$$location')...'
 .    for fetchfile in ${_ALLFILES}
-.      if defined(DYNAMIC_MASTER_SITES)
+.      if exists(${DYNAMIC_SITE_SCRIPT})
        @(if [ ! -f ${_DISTDIR}/${fetchfile:T} ]; then                  \
                ${ECHO};                                                \
                filesize=`${AWK} '                                      \
@@ -53,7 +53,7 @@
                ${ECHO} '# Fetch ${fetchfile} ('$${filesize-???}' bytes):'; \
                ${ECHO} '#';                                            \
                ${ECHO} '${SH} -s ${fetchfile:T} <<"EOF" |(';           \
-               ${CAT} ${FILESDIR}/getsite.sh;                          \
+               ${CAT} ${DYNAMIC_SITE_SCRIPT};                          \
                ${ECHO} EOF;                                            \
                ${ECHO} read unsorted_sites;                            \
                ${ECHO} 'unsorted_sites="$${unsorted_sites} ${_MASTER_SITE_BACKUP}"'; \
@@ -83,7 +83,7 @@
                ${ECHO} '       ${ECHO} ${fetchfile:T} not fetched';    \
                ${ECHO} done;                                           \
        fi)
-.      endif # defined(DYNAMIC_MASTER_SITES)
+.      endif
 .    endfor
 .  endif # !empty(_ALLFILES)
 .endif # !target(fetch-list-one-pkg)
diff -r ea1cce0ab180 -r 7dbf73094324 mk/fetch/fetch.mk
--- a/mk/fetch/fetch.mk Thu Jul 27 14:54:07 2006 +0000
+++ b/mk/fetch/fetch.mk Thu Jul 27 15:16:44 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: fetch.mk,v 1.17 2006/07/27 07:41:40 rillig Exp $
+# $NetBSD: fetch.mk,v 1.18 2006/07/27 15:16:44 jlam Exp $
 
 _MASTER_SITE_BACKUP=   ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
 _MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
@@ -54,9 +54,11 @@
 #
 # Associate each file to fetch with the correct site(s).
 #
-.if defined(DYNAMIC_MASTER_SITES)
+DYNAMIC_SITE_SCRIPT?=  ${FILESDIR}/getsite.sh
+DYNAMIC_SITE_CMD?=     ${SETENV} PATH=${PATH:Q} ${SH} ${DYNAMIC_SITE_SCRIPT}
+.if exists(${DYNAMIC_SITE_SCRIPT})
 .  for fetchfile in ${_ALLFILES}
-SITES_${fetchfile:T:S/=/--/}?= `${SH} ${FILESDIR}/getsite.sh ${fetchfile:T}`
+SITES_${fetchfile:T:S/=/--/}?= `${DYNAMIC_SITE_CMD} ${fetchfile:T}`
 SITES.${fetchfile:T:S/=/--/}?= ${SITES_${fetchfile:T:S/=/--/}}
 .  endfor
 .endif
diff -r ea1cce0ab180 -r 7dbf73094324 wm/sawfish-themes/Makefile
--- a/wm/sawfish-themes/Makefile        Thu Jul 27 14:54:07 2006 +0000
+++ b/wm/sawfish-themes/Makefile        Thu Jul 27 15:16:44 2006 +0000
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2006/06/29 21:00:25 joerg Exp $
+# $NetBSD: Makefile,v 1.13 2006/07/27 15:16:44 jlam Exp $
 
 DISTNAME=              sawfish-themes-0.2
 PKGREVISION=           5
 CATEGORIES=            x11 wm
-DYNAMIC_MASTER_SITES=  yes
 DISTFILES=             ${SAWFISH_THEMES}
 
 MAINTAINER=            jschauma%NetBSD.org@localhost
diff -r ea1cce0ab180 -r 7dbf73094324 www/apache-tomcat55/Makefile
--- a/www/apache-tomcat55/Makefile      Thu Jul 27 14:54:07 2006 +0000
+++ b/www/apache-tomcat55/Makefile      Thu Jul 27 15:16:44 2006 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.7 2006/07/22 19:43:55 abs Exp $
+# $NetBSD: Makefile,v 1.8 2006/07/27 15:16:44 jlam Exp $
 
 DISTNAME=       apache-tomcat-${TOMCAT_VERSION}
 CATEGORIES=    www java
 # The list of sites to download is generated by an apache website.
 # The getsite.sh script parses the HTML and extracts the urls.
-DYNAMIC_MASTER_SITES=1
 
 MAINTAINER=    abs%NetBSD.org@localhost
 HOMEPAGE=      http://tomcat.apache.org/
diff -r ea1cce0ab180 -r 7dbf73094324 www/jakarta-tomcat4/Makefile
--- a/www/jakarta-tomcat4/Makefile      Thu Jul 27 14:54:07 2006 +0000
+++ b/www/jakarta-tomcat4/Makefile      Thu Jul 27 15:16:44 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2006/02/05 23:11:24 joerg Exp $
+# $NetBSD: Makefile,v 1.10 2006/07/27 15:16:44 jlam Exp $
 
 PKGNAME=        jakarta-tomcat4-${TOMCAT_VERSION}
 DISTNAME=       jakarta-tomcat-${TOMCAT_VERSION}
@@ -7,7 +7,6 @@
 CATEGORIES=    www java
 # The list of sites to download is generated by a jakarta website.
 # The getsite.sh script parses the HTML and extracts the urls.
-DYNAMIC_MASTER_SITES=1
 
 MAINTAINER=    erh%NetBSD.org@localhost
 HOMEPAGE=      http://jakarta.apache.org/tomcat/
diff -r ea1cce0ab180 -r 7dbf73094324 www/jakarta-tomcat5/Makefile
--- a/www/jakarta-tomcat5/Makefile      Thu Jul 27 14:54:07 2006 +0000
+++ b/www/jakarta-tomcat5/Makefile      Thu Jul 27 15:16:44 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2006/07/07 03:11:48 minskim Exp $
+# $NetBSD: Makefile,v 1.13 2006/07/27 15:16:44 jlam Exp $
 
 PKGNAME=       jakarta-tomcat5-${TOMCAT_VERSION}
 DISTNAME=      jakarta-tomcat-${TOMCAT_VERSION}
@@ -6,7 +6,6 @@
 CATEGORIES=    www java
 # The list of sites to download is generated by a jakarta website.
 # The getsite.sh script parses the HTML and extracts the urls.
-DYNAMIC_MASTER_SITES=1
 
 MAINTAINER=    erh%NetBSD.org@localhost
 HOMEPAGE=      http://jakarta.apache.org/tomcat/



Home | Main Index | Thread Index | Old Index