[gegl] don't hardcode API version

Nils Philippsen nphilipp at fedoraproject.org
Tue Apr 3 12:17:52 UTC 2012


commit ab88d5f1150b67dd1aec640a75443d9fb1a3eaa8
Author: Nils Philippsen <nils at redhat.com>
Date:   Tue Apr 3 14:10:05 2012 +0200

    don't hardcode API version

 gegl.spec |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/gegl.spec b/gegl.spec
index 35bba9c..44aec22 100644
--- a/gegl.spec
+++ b/gegl.spec
@@ -1,9 +1,15 @@
-%global gegl_lib_version 0.1
-
 Summary:    A graph based image processing framework
 Name:       gegl
 Version:    0.1.8
 Release:    3%{?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 binary is under the GPL, while the libs are under LGPL
 License:    LGPLv3+ and GPLv3+
 Group:      System Environment/Libraries
@@ -98,7 +104,7 @@ rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install INSTALL='install -p'
 
 rm -f %{buildroot}%{_libdir}/*.la
-rm -f %{buildroot}%{_libdir}/gegl-%{gegl_lib_version}/*.la
+rm -f %{buildroot}%{_libdir}/gegl-%{apiver}/*.la
 
 %check
 if make check; then
@@ -143,12 +149,12 @@ rm -rf %{buildroot}
 %doc AUTHORS ChangeLog COPYING COPYING.LESSER NEWS README
 %{_bindir}/gegl
 %{_libdir}/*.so.*
-%{_libdir}/gegl-%{gegl_lib_version}/
+%{_libdir}/gegl-%{apiver}/
 
 %files devel
 %defattr(-, root, root, -)
 %doc %{_datadir}/gtk-doc/
-%{_includedir}/gegl-%{gegl_lib_version}/
+%{_includedir}/gegl-%{apiver}/
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/%{name}.pc
 


More information about the scm-commits mailing list