[SFML] Make parallel installable with 1.6 (avoid conflict with compat-SFML16)

Hans de Goede jwrdegoede at fedoraproject.org
Tue May 28 05:56:25 UTC 2013


commit 2f7928e357050fc7c6b004a081cddaa9bdd631ca
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Mon May 27 20:36:44 2013 +0200

    Make parallel installable with 1.6 (avoid conflict with compat-SFML16)
    
    - Fix rpmlint warnings
    - Fix Source0 URL

 SFML-2.0-parallel-install.patch |  101 +++++++++++++++++++++++++++++++++++++++
 SFML.spec                       |   35 ++++++++++++--
 2 files changed, 131 insertions(+), 5 deletions(-)
---
diff --git a/SFML-2.0-parallel-install.patch b/SFML-2.0-parallel-install.patch
new file mode 100644
index 0000000..6612240
--- /dev/null
+++ b/SFML-2.0-parallel-install.patch
@@ -0,0 +1,101 @@
+diff -up SFML-2.0/tools/pkg-config/sfml-all.pc.in~ SFML-2.0/tools/pkg-config/sfml-all.pc.in
+--- SFML-2.0/tools/pkg-config/sfml-all.pc.in~	2013-02-20 23:41:08.000000000 +0100
++++ SFML-2.0/tools/pkg-config/sfml-all.pc.in	2013-05-26 19:42:39.311444501 +0200
+@@ -1,7 +1,7 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib at LIB_SUFFIX@
+-includedir=${prefix}/include
++includedir=${prefix}/include/SFML-2.0
+ 
+ Name: SFML-all
+ Description: The Simple and Fast Multimedia Library, all modules.
+diff -up SFML-2.0/tools/pkg-config/sfml-audio.pc.in~ SFML-2.0/tools/pkg-config/sfml-audio.pc.in
+--- SFML-2.0/tools/pkg-config/sfml-audio.pc.in~	2013-02-20 23:41:08.000000000 +0100
++++ SFML-2.0/tools/pkg-config/sfml-audio.pc.in	2013-05-26 19:42:49.311444821 +0200
+@@ -1,12 +1,12 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib at LIB_SUFFIX@
+-includedir=${prefix}/include
++includedir=${prefix}/include/SFML-2.0
+ 
+ Name: SFML-audio
+ Description: The Simple and Fast Multimedia Library, audio module.
+ URL: http://www.sfml-dev.org
+ Version: @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@
+ Requires: sfml-system
+-Libs: -L${libdir} -lsfml-audio
++Libs: -L${libdir} -lsfml-audio-2.0
+ Cflags: -I${includedir}
+diff -up SFML-2.0/tools/pkg-config/sfml-graphics.pc.in~ SFML-2.0/tools/pkg-config/sfml-graphics.pc.in
+--- SFML-2.0/tools/pkg-config/sfml-graphics.pc.in~	2013-02-20 23:41:08.000000000 +0100
++++ SFML-2.0/tools/pkg-config/sfml-graphics.pc.in	2013-05-26 19:42:53.326444950 +0200
+@@ -1,12 +1,12 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib at LIB_SUFFIX@
+-includedir=${prefix}/include
++includedir=${prefix}/include/SFML-2.0
+ 
+ Name: SFML-graphics
+ Description: The Simple and Fast Multimedia Library, graphics module.
+ URL: http://www.sfml-dev.org
+ Version: @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@
+ Requires: sfml-window
+-Libs: -L${libdir} -lsfml-graphics
++Libs: -L${libdir} -lsfml-graphics-2.0
+ Cflags: -I${includedir}
+diff -up SFML-2.0/tools/pkg-config/sfml-network.pc.in~ SFML-2.0/tools/pkg-config/sfml-network.pc.in
+--- SFML-2.0/tools/pkg-config/sfml-network.pc.in~	2013-02-20 23:41:08.000000000 +0100
++++ SFML-2.0/tools/pkg-config/sfml-network.pc.in	2013-05-26 19:42:57.343445078 +0200
+@@ -1,12 +1,12 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib at LIB_SUFFIX@
+-includedir=${prefix}/include
++includedir=${prefix}/include/SFML-2.0
+ 
+ Name: SFML-network
+ Description: The Simple and Fast Multimedia Library, network module.
+ URL: http://www.sfml-dev.org
+ Version: @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@
+ Requires: sfml-system
+-Libs: -L${libdir} -lsfml-network
++Libs: -L${libdir} -lsfml-network-2.0
+ Cflags: -I${includedir}
+diff -up SFML-2.0/tools/pkg-config/sfml-system.pc.in~ SFML-2.0/tools/pkg-config/sfml-system.pc.in
+--- SFML-2.0/tools/pkg-config/sfml-system.pc.in~	2013-02-20 23:41:08.000000000 +0100
++++ SFML-2.0/tools/pkg-config/sfml-system.pc.in	2013-05-26 19:43:01.390445208 +0200
+@@ -1,11 +1,11 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib at LIB_SUFFIX@
+-includedir=${prefix}/include
++includedir=${prefix}/include/SFML-2.0
+ 
+ Name: SFML-system
+ Description: The Simple and Fast Multimedia Library, system module.
+ URL: http://www.sfml-dev.org
+ Version: @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@
+-Libs: -L${libdir} -lsfml-system
++Libs: -L${libdir} -lsfml-system-2.0
+ Cflags: -I${includedir}
+diff -up SFML-2.0/tools/pkg-config/sfml-window.pc.in~ SFML-2.0/tools/pkg-config/sfml-window.pc.in
+--- SFML-2.0/tools/pkg-config/sfml-window.pc.in~	2013-02-20 23:41:08.000000000 +0100
++++ SFML-2.0/tools/pkg-config/sfml-window.pc.in	2013-05-26 19:43:22.878445895 +0200
+@@ -1,12 +1,12 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib at LIB_SUFFIX@
+-includedir=${prefix}/include
++includedir=${prefix}/include/SFML-2.0
+ 
+ Name: SFML-window
+ Description: The Simple and Fast Multimedia Library, window module.
+ URL: http://www.sfml-dev.org
+ Version: @VERSION_MAJOR at .@VERSION_MINOR at .@VERSION_PATCH@
+ Requires: sfml-system
+-Libs: -L${libdir} -lsfml-window
++Libs: -L${libdir} -lsfml-window-2.0
+ Cflags: -I${includedir}
diff --git a/SFML.spec b/SFML.spec
index 2559c6c..b70019b 100644
--- a/SFML.spec
+++ b/SFML.spec
@@ -1,12 +1,13 @@
 Name:           SFML
 Version:        2.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Simple and Fast Multimedia Library
 
 # src/SFML/Audio/stb_vorbis/stb_vorbis.{c,h} are Public Domain
 License:        zlib and Public Domain
 URL:            http://www.sfml-dev.org/
-Source0:        http://downloads.sourceforge.net/sfml/%{name}-%{version}-sources.zip
+Source0:        http://www.sfml-dev.org/download/sfml/2.0/SFML-2.0-sources.zip
+Patch0:         SFML-2.0-parallel-install.patch
 
 BuildRequires:  cmake
 BuildRequires:  doxygen
@@ -35,22 +36,41 @@ developing applications that use %{name}.
 
 %prep
 %setup -q
+%patch0 -p1
+# fixup non needed executable permission on regular files
+find -type f -print0 | xargs -0 chmod -x
+# fixup %%doc files line endings
+sed -i.bak 's/\r//' license.txt readme.txt
+touch -r license.txt.bak license.txt
+touch -r readme.txt.bak readme.txt
 #make sure system-wide libraries are used
 rm -rf extlibs
 
+
 %build
 %cmake -DSFML_BUILD_DOC=TRUE .
 make %{?_smp_mflags}
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
+# Make parallel installable with 1.6, pkg-config files are adjusted likewise
+# by patch0, so apps properly using pkg-config, won't notice any difference
+mkdir $RPM_BUILD_ROOT%{_includedir}/%{name}-2.0
+mv $RPM_BUILD_ROOT%{_includedir}/%{name} \
+  $RPM_BUILD_ROOT%{_includedir}/%{name}-2.0
+pushd $RPM_BUILD_ROOT%{_libdir}
+for i in libsfml-*.so; do
+    mv $i $(echo $i | sed 's/.so/-2.0.so/')
+done
+popd
+
 #remove duplicated documentation
 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
 
+
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -63,12 +83,17 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/*.txt
 
 %files devel
 %doc doc/html/*
-%{_includedir}/%{name}
+%{_includedir}/%{name}-2.0
 %{_libdir}/pkgconfig/sfml-*.pc
-%{_libdir}/*.so
+%{_libdir}/libsfml-*-2.0.so
 
 
 %changelog
+* Sun May 26 2013 Hans de Goede <hdegoede at redhat.com> - 2.0-2
+- Make parallel installable with 1.6 (avoid conflict with compat-SFML16)
+- Fix rpmlint warnings
+- Fix Source0 URL
+
 * Wed May 01 2013 Julian Sikorski <belegdol at fedoraproject.org> - 2.0-1
 - Updated to 2.0
 


More information about the scm-commits mailing list