build: override PACKAGE_VERSION in pkg-config generation for libraries
authorAndrew Tridgell <tridge@samba.org>
Mon, 29 Mar 2010 04:27:54 +0000 (15:27 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:15 +0000 (20:27 +1000)
we should use the vnum

buildtools/wafsamba/wafsamba.py

index 291d8acb4b271f767590c48695466dba7f08e5f5..1ab583fcc9d24b807f33da65a9744d3ea5bdd9d5 100644 (file)
@@ -217,7 +217,7 @@ def SAMBA_LIBRARY(bld, libname, source,
         bld.PUBLIC_HEADERS(public_headers, header_path=header_path)
 
     if pc_files is not None:
-        bld.PKG_CONFIG_FILES(pc_files)
+        bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
 
 Build.BuildContext.SAMBA_LIBRARY = SAMBA_LIBRARY
 
@@ -761,16 +761,18 @@ def subst_at_vars(task):
 
 
 
-def PKG_CONFIG_FILES(bld, pc_files):
+def PKG_CONFIG_FILES(bld, pc_files, vnum=None):
     '''install some pkg_config pc files'''
     dest = '${PKGCONFIGDIR}'
     dest = bld.EXPAND_VARIABLES(dest)
     for f in TO_LIST(pc_files):
         base=os.path.basename(f)
-        bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
-                            rule=subst_at_vars,
-                            source=f+'.in',
-                            target=f)
+        t = bld.SAMBA_GENERATOR('PKGCONFIG_%s' % base,
+                                rule=subst_at_vars,
+                                source=f+'.in',
+                                target=f)
+        if vnum:
+            t.env.PACKAGE_VERSION = vnum
         INSTALL_FILES(bld, dest, f, flat=True, destname=base)
 Build.BuildContext.PKG_CONFIG_FILES = PKG_CONFIG_FILES