[babl] don't hardcode API version

Nils Philippsen nphilipp at fedoraproject.org
Tue Apr 3 09:19:06 UTC 2012


commit 0672a2bc9a390560f0d96578f8405d766cfb386d
Author: Nils Philippsen <nils at redhat.com>
Date:   Tue Apr 3 11:18:36 2012 +0200

    don't hardcode API version

 babl.spec |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/babl.spec b/babl.spec
index 7ae3ec1..5413b7e 100644
--- a/babl.spec
+++ b/babl.spec
@@ -6,11 +6,19 @@ Summary:	A dynamic, any to any, pixel format conversion library
 Name:		babl
 Version:	0.1.10
 Release:	1%{?dist}
+
+# Compute some version related macros
+# Ugly hack, you need to get your quoting backslashes/percent signs straight
+%global major %(ver=%version; echo ${ver%%%%.*})
+%global minor %(ver=%version; ver=${ver#%major.}; echo ${ver%%%%.*})
+%global micro %(ver=%version; ver=${ver#%major.%minor.}; echo ${ver%%%%.*})
+%global apiver %major.%minor
+
 # The gggl codes contained in this package are under the GPL, with exceptions allowing their use under libraries covered under the LGPL
 License:	LGPLv3+ and GPLv3+
 Group:		System Environment/Libraries
 URL:		http://www.gegl.org/babl/
-Source0:	ftp://ftp.gimp.org/pub/babl/0.1/%{name}-%{version}.tar.bz2
+Source0:	ftp://ftp.gimp.org/pub/babl/%{apiver}/%{name}-%{version}.tar.bz2
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	librsvg2 w3m
 
@@ -92,11 +100,11 @@ rm -rf %{buildroot}
 %defattr(-, root, root, -)
 %doc AUTHORS ChangeLog COPYING README NEWS
 %{_libdir}/*.so.*
-%{_libdir}/babl-0.1/
+%{_libdir}/babl-%{apiver}/
 
 %files devel
 %defattr(-, root, root, -)
-%{_includedir}/babl-0.1/
+%{_includedir}/babl-%{apiver}/
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/%{name}.pc
 


More information about the scm-commits mailing list