- added build patch (misc compile fixes)
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 5 Nov 2014 15:00:53 +0000 (16:00 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Wed, 5 Nov 2014 15:00:53 +0000 (16:00 +0100)
- added pc patch (remove regular CFLAGS from .pc Cflags)
- added format patch (fixes for -Werror=format-security)
- completed packaging

Coin-build.patch [new file with mode: 0644]
Coin-format.patch [new file with mode: 0644]
Coin-pc.patch [new file with mode: 0644]
Coin.spec

diff --git a/Coin-build.patch b/Coin-build.patch
new file mode 100644 (file)
index 0000000..acdd46c
--- /dev/null
@@ -0,0 +1,23 @@
+--- Coin-3.1.3/include/Inventor/SbBasic.h.orig 2010-03-02 14:20:09.000000000 +0100
++++ Coin-3.1.3/include/Inventor/SbBasic.h      2014-11-02 21:47:43.939298989 +0100
+@@ -25,6 +25,9 @@
+ \**************************************************************************/
+ #include <Inventor/C/basic.h>
++#ifndef NDEBUG
++#include <Inventor/C/errors/debugerror.h>
++#endif
+ /* ********************************************************************** */
+ /* Trap people trying to use Inventor headers while compiling C source code.
+--- Coin-3.1.3/src/fonts/freetype.cpp.orig     2010-03-02 14:20:09.000000000 +0100
++++ Coin-3.1.3/src/fonts/freetype.cpp  2014-11-03 21:09:52.395768445 +0100
+@@ -38,7 +38,7 @@
+ #include "config.h"
+ #endif /* HAVE_CONFIG_H */
+-#include <stdlib.h>
++#include <cstdlib>
+ #include <assert.h>
+ #include "glue/freetype.h"
diff --git a/Coin-format.patch b/Coin-format.patch
new file mode 100644 (file)
index 0000000..afa2f72
--- /dev/null
@@ -0,0 +1,14 @@
+--- Coin-3.1.3/src/profiler/SoProfiler.cpp.orig        2010-03-02 14:20:09.000000000 +0100
++++ Coin-3.1.3/src/profiler/SoProfiler.cpp     2014-11-04 20:53:37.368850092 +0100
+@@ -552,9 +552,9 @@
+     // send ansi-console clear screen code
+     static const char * CLEAR_SEQUENCE = "\033c";
+     if (profiler::console::onstdout) {
+-      fprintf(coin_get_stdout(), CLEAR_SEQUENCE);
++      fputs(CLEAR_SEQUENCE, coin_get_stdout());
+     } else if (profiler::console::onstderr) {
+-      fprintf(coin_get_stderr(), CLEAR_SEQUENCE);
++      fputs(CLEAR_SEQUENCE,coin_get_stderr());
+     }
+   }
diff --git a/Coin-pc.patch b/Coin-pc.patch
new file mode 100644 (file)
index 0000000..f3b7319
--- /dev/null
@@ -0,0 +1,11 @@
+--- Coin-3.1.3/Coin.pc.in.orig 2010-03-02 14:20:09.000000000 +0100
++++ Coin-3.1.3/Coin.pc.in      2014-11-04 19:01:27.505799266 +0100
+@@ -11,7 +11,7 @@
+ Requires:
+ Conflicts:
+ Libs: -L${libdir} @COIN_EXTRA_LDFLAGS@ @COIN_EXTRA_LIBS@
+-Cflags: -I${includedir} @COIN_EXTRA_CFLAGS@ @COIN_EXTRA_CPPFLAGS@
++Cflags: -I${includedir}
+ coin_host=@host@
+ compiler=@COIN_COMPILER@
index 3ac12c0..21ecdbd 100644 (file)
--- a/Coin.spec
+++ b/Coin.spec
 #
+# Conditional build:
+%bcond_without static_libs     # static library
+#
 Summary:       High-level, retained-mode toolkit for effective 3D graphics development
-Summary(pl.UTF-8):     Zbiór narzędzi wysokiego poziomu do efektywnego rozwijania grafiki 3D
+Summary(pl.UTF-8):     Wysokopoziomowy toolkit do efektywnego rozwijania grafiki 3D
 Name:          Coin
 Version:       3.1.3
-Release:       0.1
-License:       GPL
+Release:       1
+License:       GPL or Coin PEL or Coin EL
 Group:         X11/Libraries
-Source0:       http://ftp.coin3d.org/coin/src/all/%{name}-%{version}.tar.gz
+Source0:       https://bitbucket.org/Coin3D/coin/downloads/%{name}-%{version}.tar.gz
 # Source0-md5: 1538682f8d92cdf03e845c786879fbea
+Patch0:                %{name}-build.patch
+Patch1:                %{name}-pc.patch
+Patch2:                %{name}-format.patch
 URL:           http://www.coin3d.org/
+BuildRequires: OpenAL-devel
 BuildRequires: OpenGL-GLU-devel
 BuildRequires: OpenGL-devel
-BuildRequires: automake
+BuildRequires: bzip2-devel
+BuildRequires: fontconfig-devel
+BuildRequires: freetype-devel >= 2
+#BuildRequires:        js-devel
 BuildRequires: libstdc++-devel
 BuildRequires: xorg-lib-libX11-devel
+BuildRequires: zlib-devel
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define specflags -DCOIN_INTERNAL -DCOIN_DEBUG=0
+#define specflags -DCOIN_INTERNAL -DCOIN_DEBUG=0
 
 %description
 High-level, retained-mode toolkit for effective 3D graphics
-development.
+development. It's fully compatible with SGI Open Inventor 2.1.
+
+%description -l pl.UTF-8
+Wysokopoziomowy toolkit trybu przechowującego do efektywnego
+rozwijania grafiki 3D. Jest w pełni kompatybilny z pakietem SGI Open
+Inventor 2.1.
 
 %package devel
-Summary:       Header files for ... library
-Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki ...
+Summary:       Header files for Coin3D library
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki Coin3D
 Group:         X11/Development/Libraries
-# if base package contains shared library for which these headers are
 Requires:      %{name} = %{version}-%{release}
-# if -libs package contains shared library for which these headers are
-#Requires:     %{name}-libs = %{version}-%{release}
 
 %description devel
-Header files for ... library.
+Header files for Coin3D library.
 
 %description devel -l pl.UTF-8
-Pliki nagłówkowe biblioteki ....
+Pliki nagłówkowe biblioteki Coin3D.
 
+%package static
+Summary:       Static Coin3D library
+Summary(pl.UTF-8):     Statyczna biblioteka Coin3D
+Group:         X11/Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
 
-%prep
-%setup -q
-#%setup -q -c -T
-#%setup -q -n %{name}
-#%setup -q -n %{name}-%{version}.orig -a 1
-#%patch0 -p1
-
-# undos the source
-#find '(' -name '*.php' -o -name '*.inc' ')' -print0 | xargs -0 %{__sed} -i -e 's,\r$,,'
+%description static
+Static Coin3D library.
 
-# remove CVS control files
-#find -name CVS -print0 | xargs -0 rm -rf
+%description static -l pl.UTF-8
+Statyczna biblioteka Coin3D.
 
-# you'll need this if you cp -a complete dir in source
-# cleanup backups after patching
-find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
-# if ac/am/* rebuilding is necessary, do it in this order and add
-# appropriate BuildRequires
-#%%{__intltoolize}
-#%%{__gettextize}
-#%%{__libtoolize}
-#%%{__aclocal}
-#%%{__autoconf}
-#%%{__autoheader}
-#%%{__automake}
-# if not running libtool or automake, but config.sub is too old:
-# cp -f /usr/share/automake/config.sub .
+# must include COIN_INTERNAL and COIN_DEBUG in CFLAGS/CXXFLAGS, because
+# internal CPPFLAGS are not propagated everywhere
+CFLAGS="%{rpmcflags} -DCOIN_INTERNAL -DCOIN_DEBUG=0"
+CXXFLAGS="%{rpmcxxflags} -DCOIN_INTERNAL -DCOIN_DEBUG=0"
 %configure \
-       --enable-system-expat
-
+       --enable-3ds-import \
+       --disable-debug \
+       --enable-java-wrapper \
+       --enable-man \
+       %{?with_static_libs:--enable-static} \
+       --enable-system-expat \
+       --enable-threadsafe
+
+# FIXME: don't use global LIBS to fix libCoin.la linking
+# (but cannot regenerate ac/am because of missing m4 files)
 %{__make} \
        LIBS="-ldl -lGL -lX11 -lpthread"
 
 %install
 rm -rf $RPM_BUILD_ROOT
-# create directories if necessary
-#install -d $RPM_BUILD_ROOT
-%if %{with initscript}
-install -d $RPM_BUILD_ROOT/etc/{sysconfig,rc.d/init.d}
-%endif
-#install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+# sanitize file list
+%{__sed} -i -ne '/^S/p' man/man3/filelist.txt
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libCoin.la
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-
-%if %{with ldconfig}
 %post  -p /sbin/ldconfig
 %postun        -p /sbin/ldconfig
-%endif
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS ChangeLog NEWS README THANKS
+%doc AUTHORS COPYING ChangeLog FAQ FAQ.legal NEWS README README.UNIX RELNOTES THANKS
 %attr(755,root,root) %{_bindir}/coin-config
 %attr(755,root,root) %{_libdir}/libCoin.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libCoin.so.60
 %{_datadir}/%{name}
+%{_mandir}/man1/coin-config.1*
 
 %files devel
 %defattr(644,root,root,755)
-# %doc devel-doc/*
-%{_libdir}/libCoin.so
-%{_libdir}/libCoin.la
-%{_includedir}/Inventor
+%attr(755,root,root) %{_libdir}/libCoin.so
+%dir %{_includedir}/Inventor
+%{_includedir}/Inventor/C
+%{_includedir}/Inventor/VRMLnodes
+%{_includedir}/Inventor/actions
+%{_includedir}/Inventor/annex
+%{_includedir}/Inventor/bundles
+%{_includedir}/Inventor/caches
+%{_includedir}/Inventor/collision
+%{_includedir}/Inventor/details
+%{_includedir}/Inventor/draggers
+%{_includedir}/Inventor/elements
+%{_includedir}/Inventor/engines
+%{_includedir}/Inventor/errors
+%{_includedir}/Inventor/events
+%{_includedir}/Inventor/fields
+%{_includedir}/Inventor/lists
+%{_includedir}/Inventor/lock
+%{_includedir}/Inventor/manips
+%{_includedir}/Inventor/misc
+%{_includedir}/Inventor/nodekits
+%{_includedir}/Inventor/nodes
+%{_includedir}/Inventor/projectors
+%{_includedir}/Inventor/scxml
+%{_includedir}/Inventor/sensors
+%{_includedir}/Inventor/system
+%{_includedir}/Inventor/threads
+%{_includedir}/Inventor/tools
+%{_includedir}/Inventor/Sb*.h
+%{_includedir}/Inventor/So*.h
+%{_includedir}/Inventor/non_winsys.h
+%{_includedir}/Inventor/oivwin32.h
 %{_includedir}/SoDebug.h
 %{_includedir}/SoWinEnterScope.h
 %{_includedir}/SoWinLeaveScope.h
-%{_aclocaldir}/*.m4
-%{_pkgconfigdir}/*.pc
+%{_pkgconfigdir}/Coin.pc
+%{_aclocaldir}/coin.m4
+%{_mandir}/man3/Sb*.3*
+%{_mandir}/man3/Sc*.3*
+%{_mandir}/man3/So*.3*
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libCoin.a
+%endif
This page took 0.092887 seconds and 4 git commands to generate.