diff --git a/celestia-1.4.1-strictalias.patch b/celestia-1.4.1-strictalias.patch new file mode 100644 index 0000000..3ff59b3 --- /dev/null +++ b/celestia-1.4.1-strictalias.patch @@ -0,0 +1,13 @@ +--- celestia-1.4.1/src/celengine/modelfile.cpp.strictalias 2006-11-22 14:04:15.000000000 +0100 ++++ celestia-1.4.1/src/celengine/modelfile.cpp 2006-11-22 14:01:27.000000000 +0100 +@@ -1080,7 +1080,9 @@ + static float readFloat(istream& in) + { + int i = readUint(in); +- return *((float*) &i); ++ float f; ++ memcpy(&f, &i, sizeof(float)); ++ return f; + } + + diff --git a/celestia.spec b/celestia.spec index d9d7436..bdb470b 100644 --- a/celestia.spec +++ b/celestia.spec @@ -1,6 +1,6 @@ Name: celestia Version: 1.4.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: OpenGL real-time visual space simulation Group: Amusements/Graphics License: GPL @@ -9,6 +9,7 @@ Source3: celestia.desktop Patch0: celestia-1.4.0-compile.patch Patch1: celestia-1.4.1-lua51.patch Patch2: celestia-1.4.1-lua51-resume.patch +Patch3: celestia-1.4.1-strictalias.patch URL: http://www.shatters.net/celestia/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -22,8 +23,8 @@ BuildRequires: libGLU-devel BuildRequires: libXt-devel BuildRequires: libXmu-devel BuildRequires: lua-devel -BuildRequires: automake17 BuildRequires: gettext-devel +Requires(pre): GConf2 Requires(post): GConf2 Requires(preun): GConf2 @@ -46,21 +47,28 @@ object you want to visit. %patch0 -p0 %patch1 -p1 -b .lua51 %patch2 -p1 -b .lua51-resume +%patch3 -p1 -b .strictalias + +# Make sure we compile with the right CFLAGS/CXXFLAGS (from Hans de Goede). +sed -i 's/CFLAGS="\$CFLAGS \$CELESTIAFLAGS \$CELESTIA_CFLAGS"/CFLAGS="\$CFLAGS \$CELESTIAFLAGS"/' configure +sed -i 's/CXXFLAGS="\$CXXFLAGS \$CELESTIAFLAGS \$CELESTIA_CXXFLAGS"/CXXFLAGS="\$CXXFLAGS \$CELESTIAFLAGS"/' configure +# sigh stop autoxxx from rerunning because of our patches above. +touch aclocal.m4 +touch configure +touch config.h.in +touch `find -name Makefile.in` + %build export GTK_LIBS="$( pkg-config --libs gtkglext-x11-1.0 libgnomeui-2.0 )" -# http://www.shatters.net/forum/viewtopic.php?t=9605 -export CXXFLAGS="%{optflags} -fno-strict-aliasing" -%configure --with-gnome --with-lua --disable-schemas-install +%configure --with-gnome --with-lua make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT -export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 -make install DESTDIR=$RPM_BUILD_ROOT -unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL +GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 make install DESTDIR=$RPM_BUILD_ROOT install -p -m 644 -D src/celestia/kde/data/hi48-app-celestia.png \ $RPM_BUILD_ROOT%{_datadir}/pixmaps/celestia.png @@ -86,15 +94,25 @@ desktop-file-install \ %clean rm -rf $RPM_BUILD_ROOT +%pre +if [ "$1" -gt 1 ]; then + GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ + gconftool-2 --makefile-uninstall-rule \ + %{_sysconfdir}/gconf/schemas/%{name}.schemas &>/dev/null || : + killall -HUP gconfd-2 || : +fi %post GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ - gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/%{name}.schemas &>/dev/null || : + gconftool-2 --makefile-install-rule \ + %{_sysconfdir}/gconf/schemas/%{name}.schemas &>/dev/null || : %preun -if [ "$1" = "0" ] ; then - GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ - gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/%{name}.schemas &>/dev/null || : +if [ "$1" -eq "0" ] ; then + GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ + gconftool-2 --makefile-uninstall-rule \ + %{_sysconfdir}/gconf/schemas/%{name}.schemas &>/dev/null || : + killall -HUP gconfd-2 || : fi @@ -105,12 +123,17 @@ fi # Seem to have gone away in post-1.4.0 CVS... #%doc manual/*.html manual/*.css %{_bindir}/* +%{_sysconfdir}/gconf/schemas/* %{_datadir}/applications/*%{name}.desktop %{_datadir}/%{name} %{_datadir}/pixmaps/%{name}.png %changelog +* Wed Nov 22 2006 Steven Pritchard 1.4.1-7 +- Really fix the cmod models problem (#203525). (Thanks to Hans de Goede.) +- Hopefully really handle the gconf schema properly. + * Mon Aug 28 2006 Steven Pritchard 1.4.1-6 - Add --disable-schemas-install to configure. @@ -218,4 +241,3 @@ fi * Tue May 14 2002 Julien MOUTTE - Initial RPM release. -