[qhull] Modernize spec.

corsepiu corsepiu at fedoraproject.org
Mon Jul 9 05:13:00 UTC 2012


commit e6fd58d29f40d91b9c31e7496a3585d795f124c6
Author: Ralf Corsépius <corsepiu at fedoraproject.org>
Date:   Mon Jul 9 07:12:51 2012 +0200

    Modernize spec.
    
    - Add qhull.pc.
    - Misc. 64bit fixes.

 qhull-2003.1-64bit.patch     |   26 ++++++++++++++++++++++++++
 qhull-2003.1-pkgconfig.patch |   15 +++++++++++++++
 qhull.spec                   |   34 ++++++++++++++++++++++++++--------
 3 files changed, 67 insertions(+), 8 deletions(-)
---
diff --git a/qhull-2003.1-64bit.patch b/qhull-2003.1-64bit.patch
new file mode 100644
index 0000000..da82b9b
--- /dev/null
+++ b/qhull-2003.1-64bit.patch
@@ -0,0 +1,26 @@
+diff -Naur qhull-2003.1-17/src/io.c qhull-2003.1/src/io.c
+--- qhull-2003.1-17/src/io.c	2004-02-29 23:44:43.000000000 +0100
++++ qhull-2003.1/src/io.c	2012-07-08 10:46:03.935558318 +0200
+@@ -66,8 +66,8 @@
+     qh_memstatistics (qh ferr);
+     d_1= sizeof(setT) + (qh hull_dim - 1) * SETelemsize;
+     fprintf(qh ferr, "\
+-    size in bytes: merge %d ridge %d vertex %d facet %d\n\
+-         normal %d ridge vertices %d facet vertices or neighbors %d\n",
++    size in bytes: merge %zd ridge %zd vertex %zd facet %zd\n\
++         normal %d ridge vertices %d facet vertices or neighbors %zd\n",
+ 	    sizeof(mergeT), sizeof(ridgeT),
+ 	    sizeof(vertexT), sizeof(facetT),
+ 	    qh normal_size, d_1, d_1 + SETelemsize);
+diff -Naur qhull-2003.1-17/src/stat.c qhull-2003.1/src/stat.c
+--- qhull-2003.1-17/src/stat.c	2004-01-31 12:00:15.000000000 +0100
++++ qhull-2003.1/src/stat.c	2012-07-08 10:39:41.827320428 +0200
+@@ -460,7 +460,7 @@
+   qh_allstatI();
+   if (qhstat next > sizeof(qhstat id)) {
+     fprintf (qhmem.ferr, "qhull error (qh_initstatistics): increase size of qhstat.id[].\n\
+-      qhstat.next %d should be <= sizeof(qhstat id) %d\n", qhstat next, sizeof(qhstat id));
++      qhstat.next %d should be <= sizeof(qhstat id) %zd\n", qhstat next, sizeof(qhstat id));
+ #if 0 /* for locating error, Znumridges should be duplicated */
+     for (i=0; i < ZEND; i++) {
+       int j;
diff --git a/qhull-2003.1-pkgconfig.patch b/qhull-2003.1-pkgconfig.patch
new file mode 100644
index 0000000..d27d50b
--- /dev/null
+++ b/qhull-2003.1-pkgconfig.patch
@@ -0,0 +1,15 @@
+diff -Naur qhull-2003.1.orig/qhull.pc.in qhull-2003.1/qhull.pc.in
+--- qhull-2003.1.orig/qhull.pc.in	1970-01-01 01:00:00.000000000 +0100
++++ qhull-2003.1/qhull.pc.in	2012-07-08 08:04:07.795336862 +0200
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++includedir=@includedir@
++libdir=@libdir@
++
++Name: qhull
++Description: General dimension convex hull library
++Version: @VERSION@
++Requires:
++Libs: -L${libdir} -lqhull -lm
++Cflags: -I${includedir}
diff --git a/qhull.spec b/qhull.spec
index 8519e12..043beca 100644
--- a/qhull.spec
+++ b/qhull.spec
@@ -1,15 +1,18 @@
 Summary: General dimension convex hull programs
 Name: qhull
 Version: 2003.1
-Release: 16%{?dist}
+Release: 17%{?dist}
 License: Qhull
 Group: System Environment/Libraries
 Source0: http://www.qhull.org/download/qhull-%{version}.tar.gz
 Patch0: qhull-2003.1-alias.patch
 Patch1: http://www.qhull.org/download/qhull-2003.1-qh_gethash.patch
+# Add pkgconfig support
+Patch2: qhull-2003.1-pkgconfig.patch
+# Misc. fixes related to 64bit compliance
+Patch3: qhull-2003.1-64bit.patch
 
 URL: http://www.qhull.org
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -37,6 +40,8 @@ about a point.
 %setup -q -n %{name}-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 sed -i -e "s,\"../html/,\"html/,g" src/*.htm
 
 %build
@@ -46,14 +51,20 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 
 make
 
+sed -e 's|@prefix@|%{_prefix}|' \
+  -e 's|@exec_prefix@|%{_exec_prefix}|' \
+  -e 's|@includedir@|%{_includedir}|' \
+  -e 's|@libdir@|%{_libdir}|' \
+  -e 's|@VERSION@|%{version}|' \
+  qhull.pc.in > qhull.pc
+
 %install
-rm -rf $RPM_BUILD_ROOT
 make DESTDIR=$RPM_BUILD_ROOT \
   docdir=%{_docdir}/%{name}-%{version} install
-rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la
+rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
+
+install -m644 -D qhull.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/qhull.pc
 
-%clean
-rm -rf $RPM_BUILD_ROOT
 
 %post -p /sbin/ldconfig
 
@@ -68,10 +79,17 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(-,root,root)
-%_libdir/*.so
-%_includedir/*
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/qhull.pc
+%{_includedir}/*
+
 
 %changelog
+* Sun Jul 08 2012 Ralf Corsépius <corsepiu at fedoraproject.org> - 2003.1-17
+- Modernize spec.
+- Add qhull.pc.
+- Misc. 64bit fixes.
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2003.1-16
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list