[packages/lensfun] - up to 0.2.6; use cmake; drop apidocs subpkg

arekm arekm at pld-linux.org
Sun Feb 10 08:36:25 CET 2013


commit 37d67a32b4c41813e2b7609c7896cb1a9e72bc47
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Feb 10 08:36:22 2013 +0100

    - up to 0.2.6; use cmake; drop apidocs subpkg

 lensfun-build.patch     | 100 +++++++++++++++++++++---------------------------
 lensfun-vectorize.patch |  80 --------------------------------------
 lensfun.spec            |  62 ++++++++----------------------
 3 files changed, 59 insertions(+), 183 deletions(-)
---
diff --git a/lensfun.spec b/lensfun.spec
index 7461cdc..1a254a8 100644
--- a/lensfun.spec
+++ b/lensfun.spec
@@ -1,15 +1,15 @@
 Summary:	Camera lens database with image correction support
 Summary(pl.UTF-8):	Baza danych obiektywów z funkcją korekcji zdjęć
 Name:		lensfun
-Version:	0.2.5
-Release:	2
+Version:	0.2.6
+Release:	1
 License:	LGPL v3 (library), CC-BY-SA v3.0 (lens database)
 Group:		Libraries
 Source0:	http://download.berlios.de/lensfun/%{name}-%{version}.tar.bz2
-# Source0-md5:	a10438dffae68a5988fc54b0393a3755
+# Source0-md5:	740e4749db04da0a597630dd6339b966
 URL:		http://developer.berlios.de/projects/lensfun/
 Patch0:		%{name}-build.patch
-Patch1:		%{name}-vectorize.patch
+BuildRequires:	cmake
 BuildRequires:	doxygen >= 1.5.0
 BuildRequires:	glib2-devel >= 2.0.0
 BuildRequires:	libpng >= 1.0
@@ -17,6 +17,7 @@ BuildRequires:	libstdc++-devel
 BuildRequires:	make >= 3.81
 BuildRequires:	python
 BuildRequires:	zlib-devel
+Obsoletes:	lensfun-apidocs
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -43,52 +44,25 @@ lensfun library header files.
 %description devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki lensfun.
 
-%package apidocs
-Summary:	lensfun library API documentation
-Summary(pl.UTF-8):	Dokumentacja API biblioteki lensfun
-Group:		Documentation
-
-%description apidocs
-lensfun library API documentation.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API biblioteki lensfun.
-
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p0
 
 %build
-# configure is a python application which tries to mimic autoconf
-CC="%{__cc}" \
-CXX="%{__cxx}" \
-LD="%{__cxx}" \
-./configure \
-	--prefix=%{_prefix} \
-	--bindir=%{_bindir} \
-	--sysconfdir=%{_sysconfdir} \
-	--datadir=%{_datadir}/%{name} \
-	--libdir=%{_libdir} \
-	--includedir=%{_includedir} \
-	--libexecdir=%{_libexecdir} \
-	--cflags="%{rpmcflags}" \
-	--cxxflags="%{rpmcxxflags}" \
-	--ldflags="%{rpmldflags}" \
-	--compiler="gcc"
+install -d build
+cd build
+%{cmake} \
+	-DBUILD_DOC:BOOL=ON \
+	-DBUILD_TESTS:BOOL=OFF \
+	..
 
-# 'all' is not the default target
-%{__make} all V=1
+%{__make} V=1
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
+%{__make} -C build install/fast \
 	DESTDIR=$RPM_BUILD_ROOT
-%{__gzip} -9 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/{README,cc-by-sa-3.0.txt}
-%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/{gpl-3.0.txt,lgpl-3.0.txt}
-
-/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -98,19 +72,13 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
+%doc README docs/cc-by-sa-3.0.txt
 %attr(755,root,root) %{_libdir}/liblensfun.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/liblensfun.so.0
 %{_datadir}/lensfun
-%{_docdir}/%{name}-%{version}/README.gz
-%{_docdir}/%{name}-%{version}/cc-by-sa-3.0.txt.gz
-%dir %{_docdir}/%{name}-%{version}
 
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/liblensfun.so
-%{_includedir}/lensfun.h
+%{_includedir}/lensfun
 %{_pkgconfigdir}/lensfun.pc
-
-%files apidocs
-%defattr(644,root,root,755)
-%{_docdir}/%{name}-%{version}/manual
diff --git a/lensfun-build.patch b/lensfun-build.patch
index d2e7454..1fa8c74 100644
--- a/lensfun-build.patch
+++ b/lensfun-build.patch
@@ -1,56 +1,44 @@
---- lensfun-0.2.3/tibs.py~orig	2008-07-14 21:28:32.000000000 +0200
-+++ lensfun-0.2.3/tibs.py	2008-11-19 18:51:55.000000000 +0100
-@@ -301,7 +301,6 @@
- 
-     add_config_h ("PLATFORM_" + TARGET [0].upper ())
-     add_config_h ("ARCH_" + TARGET [1].upper ())
--    add_config_h ("TUNE_" + TARGET [2].upper ())
- 
-     add_config_mak ("HOST", HOST [0])
-     add_config_mak ("TARGET", TARGET [0])
---- lensfun-0.2.3/tibs.py~orig	2008-11-19 18:56:06.000000000 +0100
-+++ lensfun-0.2.3/tibs.py	2008-11-19 18:56:54.000000000 +0100
-@@ -142,7 +142,6 @@
-             add_config_h ("CONF_SYMBOL_VISIBILITY")
- 
-         check_cflags ("-Wno-non-virtual-dtor", "CXXFLAGS", "-Werror")
--        check_cflags ("-mtune=" + TARGET [2], "CFLAGS")
- 
-         add_config_mak ("GCC.CC", self.CC + " -c")
-         add_config_mak ("GCC.CXX", self.CXX + " -c")
---- lensfun-0.2.3/build/tibs/compiler/gcc.mak~orig	2008-05-11 17:50:15.000000000 +0200
-+++ lensfun-0.2.3/build/tibs/compiler/gcc.mak	2008-11-19 19:03:12.000000000 +0100
-@@ -71,7 +71,7 @@
- endef
- 
- LINK.GCC.AR = $(GCC.AR) $(GCC.ARFLAGS) $@ $^
--LINK.GCC.EXEC = $(GCC.LD) -o $@ $(GCC.LDFLAGS) $(LDFLAGS) $1 $^ $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
-+LINK.GCC.EXEC = $(GCC.LD) -o $@ $(GCC.LDFLAGS) $(LDFLAGS) $^ $1 $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
- define LINK.GCC.SO.VER
- 	$(GCC.LD) -o $@.$(SHARED.$3) -Wl,"-soname=$(notdir $@).$(basename $(basename $(SHARED.$3)))" $(GCC.LDFLAGS.SHARED) $(GCC.LDFLAGS) $(LDFLAGS) $1 $^ $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
- 	ln -fs $(notdir $@.$(SHARED.$3)) $@.$(basename $(basename $(SHARED.$3)))
---- lensfun-0.2.3/build/tibs/compiler/gcc.mak~orig	2008-11-19 19:05:55.000000000 +0100
-+++ lensfun-0.2.3/build/tibs/compiler/gcc.mak	2008-11-19 19:09:17.000000000 +0100
-@@ -73,9 +73,8 @@
- LINK.GCC.AR = $(GCC.AR) $(GCC.ARFLAGS) $@ $^
- LINK.GCC.EXEC = $(GCC.LD) -o $@ $(GCC.LDFLAGS) $(LDFLAGS) $^ $1 $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
- define LINK.GCC.SO.VER
--	$(GCC.LD) -o $@.$(SHARED.$3) $(call GCC.LDFLAGS.SHARED,$(notdir $@).$(basename $(basename $(SHARED.$3))),$(dir $@)) $(GCC.LDFLAGS) $(LDFLAGS) $1 $^ $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
--	ln -fs $(notdir $@.$(SHARED.$3)) $@.$(basename $(basename $(SHARED.$3)))
--	ln -fs $(notdir $@.$(basename $(basename $(SHARED.$3)))) $@
-+	$(GCC.LD) -o $@.$(SHARED.$3) $(call GCC.LDFLAGS.SHARED,$(notdir $@).$(basename $(basename $(SHARED.$3))),$(dir $@)) $(GCC.LDFLAGS) $(LDFLAGS) $^ $1 $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
-+	ln -fs $(notdir $@.$(SHARED.$3)) $@
- endef
- define LINK.GCC.SO.NOVER
- 	$(GCC.LD) -o $@ $(call GCC.LDFLAGS.SHARED,$(notdir $@),$(dir $@)) $(GCC.LDFLAGS) $(LDFLAGS) $1 $^ $(GCC.LDFLAGS.LIBS) $(LDFLAGS.LIBS) $2
---- lensfun-0.2.3/build/tibs/compiler/gcc.mak~orig	2008-11-19 19:09:32.000000000 +0100
-+++ lensfun-0.2.3/build/tibs/compiler/gcc.mak	2008-11-19 19:11:39.000000000 +0100
-@@ -93,7 +93,7 @@
- # $3 = full target file name)
- define MKIRULES.GCC
- $(if $(findstring $L,$2),\
--$(foreach _,$3 $(if $(call VALID_VERSION,$(SHARED.$2)),$3.$(basename $(basename $(SHARED.$2))) $3.$(SHARED.$2)),
-+$(foreach _,$3 $(if $(call VALID_VERSION,$(SHARED.$2)),$3.$(SHARED.$2)),
- 	$(if $V,, at echo INSTALL $_ to $(call .INSTDIR,$1,$2,LIB,$(CONF_LIBDIR)) &&)\
- 	$$(call INSTALL,$_,$(call .INSTDIR,$1,$2,LIB,$(CONF_LIBDIR)),$(call .INSTMODE,$1,$2,$(if $(SHARED.$2),0755,0644)))))\
- $(if $(findstring $E,$2),
+diff -up lensfun-0.2.6/CMakeLists.txt.LIB_SUFFIX lensfun-0.2.6/CMakeLists.txt
+--- lensfun-0.2.6/CMakeLists.txt.LIB_SUFFIX	2012-06-10 09:19:35.000000000 -0500
++++ lensfun-0.2.6/CMakeLists.txt	2012-06-28 08:32:16.628591449 -0500
+@@ -74,7 +74,7 @@ ENDIF()
+  
+ # define destination dirs (relative to prefix)
+ SET(BINDIR bin)
+-SET(LIBDIR lib)
++SET(LIBDIR lib${LIB_SUFFIX})
+ SET(INCLUDEDIR include)
+ SET(DATADIR share/lensfun)
+ SET(DOCDIR share/doc/lensfun-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}.${VERSION_BUGFIX})
+diff --git a/libs/lensfun/CMakeLists.txt b/libs/lensfun/CMakeLists.txt
+index ef3dcf0..253a08c 100644
+--- a/libs/lensfun/CMakeLists.txt
++++ b/libs/lensfun/CMakeLists.txt
+@@ -26,3 +26,8 @@ INSTALL(TARGETS lensfun
+         RUNTIME DESTINATION ${BINDIR}
+         LIBRARY DESTINATION ${LIBDIR}
+         ARCHIVE DESTINATION ${LIBDIR})
++
++# pkgconfig support
++CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/lensfun.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/lensfun.pc @ONLY)
++INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/lensfun.pc DESTINATION ${LIBDIR}/pkgconfig )
++
+diff --git a/libs/lensfun/lensfun.pc.cmake b/libs/lensfun/lensfun.pc.cmake
+new file mode 100644
+index 0000000..6d14b12
+--- /dev/null
++++ b/libs/lensfun/lensfun.pc.cmake
+@@ -0,0 +1,13 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++bindir=@CMAKE_INSTALL_PREFIX@/@BINDIR@
++libdir=@CMAKE_INSTALL_PREFIX@/@LIBDIR@
++includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDEDIR@
++datadir=@CMAKE_INSTALL_PREFIX@/@DATADIR@
++docdir=@CMAKE_INSTALL_PREFIX@/@DOCDIR@
++
++Name: lensfun
++Description: A photographic lens database and access library
++Version: @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_MICRO at .@VERSION_BUGFIX@
++Requires.private: glib-2.0
++Libs: -L${libdir} -llensfun
++Cflags: -I${includedir} -I${includedir}/lensfun
diff --git a/lensfun-vectorize.patch b/lensfun-vectorize.patch
deleted file mode 100644
index 638ea53..0000000
--- a/lensfun-vectorize.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-Index: configure
-===================================================================
---- configure	(revision 107)
-+++ configure	(revision 110)
-@@ -118,4 +118,5 @@
- print "Target directory for libraries:     " + tibs.LIBDIR
- print "Target directory for include files: " + tibs.INCLUDEDIR
- print "Target directory for documentation: " + tibs.DOCDIR
-+print "Use vector instruction set(-s):     " + ", ".join (x for x in tibs.VECTORIZATION)
- print "--------------------------------------------------------------------"
-Index: libs/lensfun/cpuid.cpp
-===================================================================
---- libs/lensfun/cpuid.cpp	(revision 107)
-+++ libs/lensfun/cpuid.cpp	(revision 110)
-@@ -25,17 +25,14 @@
- guint _lf_detect_cpu_features ()
- {
- #define cpuid(cmd) \
--    asm ( \
-+    __asm volatile ( \
-         "push %%"R_BX"\n" \
-         "cpuid\n" \
-         "pop %%"R_BX"\n" \
-        : "=a" (ax), "=c" (cx),  "=d" (dx) \
-        : "0" (cmd))
- 
--    register __SIZE_TYPE__ ax asm (R_AX);
--    register __SIZE_TYPE__ bx asm (R_BX);
--    register __SIZE_TYPE__ dx asm (R_DX);
--    register __SIZE_TYPE__ cx asm (R_CX);
-+    __SIZE_TYPE__ ax, cx, dx, tmp;
-     static GStaticMutex lock = G_STATIC_MUTEX_INIT;
-     static guint cpuflags = -1;
- 
-@@ -45,7 +42,7 @@
-         cpuflags = 0;
- 
-         /* Test cpuid presence by checking bit 21 of eflags */
--        asm (
-+        __asm volatile (
-             "pushf\n"
-             "pop     %0\n"
-             "mov     %0, %1\n"
-@@ -57,7 +54,7 @@
-             "cmp     %0, %1\n"
-             "setne   %%al\n"
-             "movzb   %%al, %0\n"
--            : "=r" (ax), "=r" (bx));
-+            : "=r" (ax), "=r" (tmp));
- 
-         if (ax)
-         {
-@@ -88,12 +85,12 @@
-                     cpuflags |= LF_CPU_FLAG_SSE4_2;
-             }
- 
--            /* Is there extensions */
-+            /* Are there extensions? */
-             cpuid (0x80000000);
- 
-             if (ax)
-             {
--                /* Request for extensions */
-+                /* Ask extensions */
-                 cpuid (0x80000001);
- 
-                 if (dx & 0x80000000)
-@@ -112,12 +109,4 @@
- #undef cpuid
- }
- 
--#else
--
--guint
--rs_detect_cpu_features()
--{
--    return 0;
--}
--
- #endif /* __i386__ || __x86_64__ */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lensfun.git/commitdiff/37d67a32b4c41813e2b7609c7896cb1a9e72bc47



More information about the pld-cvs-commit mailing list