summaryrefslogtreecommitdiff
path: root/archivers
diff options
context:
space:
mode:
authorheinz <heinz>2006-07-13 13:04:54 +0000
committerheinz <heinz>2006-07-13 13:04:54 +0000
commit105eea62c504cb2254a3b03f19d3f8e465cd8740 (patch)
treefed1a0f8f7008fb6b0490d2543f9f229080cdb68 /archivers
parent376b5daa5b5c4e31b9c5e9517274a88768f8349c (diff)
downloadpkgsrc-105eea62c504cb2254a3b03f19d3f8e465cd8740.tar.gz
Added computation of version number for package bzip2 if there is a
native version available in the system. The awk skript looks for the line in bzlib.h containing the version information. This works for versions < 1.0.0. For versions >= 1.0.0 the script additionally evaluates the copyright date. According to the change history, version 1.0 and 1.0.1 are identical except for a documentation update so we treat both as version 1.0.1 to avoid changing BUILDLINK_API_DEPENDS.bzip2 in buildlink3.mk.
Diffstat (limited to 'archivers')
-rw-r--r--archivers/bzip2/builtin.mk27
1 files changed, 26 insertions, 1 deletions
diff --git a/archivers/bzip2/builtin.mk b/archivers/bzip2/builtin.mk
index 9bf465dd605..1f32dd384d9 100644
--- a/archivers/bzip2/builtin.mk
+++ b/archivers/bzip2/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.6 2006/04/06 06:21:32 reed Exp $
+# $NetBSD: builtin.mk,v 1.7 2006/07/13 13:04:54 heinz Exp $
BUILTIN_PKG:= bzip2
@@ -21,6 +21,31 @@ IS_BUILTIN.bzip2= yes
MAKEVARS+= IS_BUILTIN.bzip2
###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.bzip2) && \
+ !empty(IS_BUILTIN.bzip2:M[yY][eE][sS])
+BUILTIN_VERSION.bzip2!= \
+ ${AWK} '/Copyright[ ]+\(C\).*rights[ ]+reserved/ { \
+ years=$$3; \
+ } \
+ /bzip2\/libbzip2[ ]+version[ ]+/ { \
+ vers=$$3; \
+ if ( vers == "1.0" ) { \
+ vers="1.0.1"; \
+ if ( years == "1996-2002" ) vers="1.0.2";\
+ if ( years == "1996-2005" ) vers="1.0.3";\
+ }; \
+ print vers; \
+ }; \
+ ' ${H_BZIP2:Q}
+
+BUILTIN_PKG.bzip2= bzip2-${BUILTIN_VERSION.bzip2}
+.endif
+MAKEVARS+= BUILTIN_PKG.bzip2
+
+###
### Determine whether we should use the built-in implementation if it
### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
###