diff --git a/.cvsignore b/.cvsignore index e69de29..65cc08c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +AntTweakBar_113.zip diff --git a/AntTweakBar-fix-includes.patch b/AntTweakBar-fix-includes.patch new file mode 100644 index 0000000..8075c4d --- /dev/null +++ b/AntTweakBar-fix-includes.patch @@ -0,0 +1,84 @@ +diff -uNr AntTweakBar/examples/TwAdvanced1.cpp AntTweakBar-Fedora/examples/TwAdvanced1.cpp +--- AntTweakBar/examples/TwAdvanced1.cpp 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/examples/TwAdvanced1.cpp 2009-10-21 13:32:07.142268590 -0700 +@@ -30,6 +30,10 @@ + #define GLFW_DLL // use GLFW as a dynamically linked library + #include "glfw.h" + ++// Fedora patch: missing includes ++#include ++#include ++ + #include + #include + #if !defined(_WIN32) && !defined(_WIN64) +diff -uNr AntTweakBar/examples/TwString.cpp AntTweakBar-Fedora/examples/TwString.cpp +--- AntTweakBar/examples/TwString.cpp 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/examples/TwString.cpp 2009-10-21 13:32:51.538505701 -0700 +@@ -27,6 +27,10 @@ + # define _snprintf snprintf + #endif + ++// Fedora patch: missing includes ++#include ++#include ++#include + + // --------------------------------------------------------------------------- + // 1) Callback functions for std::string variables +diff -uNr AntTweakBar/src/TwBar.cpp AntTweakBar-Fedora/src/TwBar.cpp +--- AntTweakBar/src/TwBar.cpp 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/src/TwBar.cpp 2009-10-21 11:11:14.164153448 -0700 +@@ -15,6 +15,10 @@ + #include "TwMgr.h" + #include "TwBar.h" + #include "TwColors.h" ++ ++// Fedora patch: memset(), free(), and friends ++#include ++#include + + using namespace std; + +diff -uNr AntTweakBar/src/TwFonts.cpp AntTweakBar-Fedora/src/TwFonts.cpp +--- AntTweakBar/src/TwFonts.cpp 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/src/TwFonts.cpp 2009-10-21 11:10:27.427520003 -0700 +@@ -14,6 +14,10 @@ + #include "TwMgr.h" + #include "TwFonts.h" + ++// Fedora patch: memset() ++#include ++using std::memset; ++ + + // --------------------------------------------------------------------------- + +diff -uNr AntTweakBar/src/TwMgr.cpp AntTweakBar-Fedora/src/TwMgr.cpp +--- AntTweakBar/src/TwMgr.cpp 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/src/TwMgr.cpp 2009-10-21 11:18:54.890146180 -0700 +@@ -28,6 +28,11 @@ + #if !defined(ANT_WINDOWS) + # define _snprintf snprintf + #endif // defined(ANT_WINDOWS) ++ ++// Fedora patch: include fix ++#include ++#include ++#include + + + using namespace std; +diff -uNr AntTweakBar/src/TwOpenGL.cpp AntTweakBar-Fedora/src/TwOpenGL.cpp +--- AntTweakBar/src/TwOpenGL.cpp 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/src/TwOpenGL.cpp 2009-10-21 11:10:07.041520158 -0700 +@@ -15,6 +15,9 @@ + #include "TwOpenGL.h" + #include "TwMgr.h" + ++// Fedora patch: memset() ++#include ++ + using namespace std; + + const char *g_ErrCantLoadOGL = "Cannot load OpenGL library dynamically"; diff --git a/AntTweakBar-makefile.patch b/AntTweakBar-makefile.patch new file mode 100644 index 0000000..84d6d7e --- /dev/null +++ b/AntTweakBar-makefile.patch @@ -0,0 +1,35 @@ +--- AntTweakBar/src/Makefile 2009-04-23 13:03:08.000000000 -0700 ++++ AntTweakBar-Fedora/src/Makefile 2009-10-21 13:13:35.007138035 -0700 +@@ -5,15 +5,20 @@ + #SO_EXT = .dll + #---- LINUX + SO_EXT = .so ++SO_VERSION = 0 + + #---- Release +-CXXCFG = -O3 +-LFLAGS = -Wl,-s +-OUT_DIR = ../lib ++#CXXCFG = -O3 ++#LFLAGS = -Wl,-s ++#OUT_DIR = ../lib + #---- Debug + #CXXCFG = -g -D_DEBUG + #LFLAGS = + #OUT_DIR = ../lib/debug ++#---- Fedora Build ++CXXCFG = $(FEDORA_CXXFLAGS) ++LFLAGS = ++OUT_DIR = ../lib + + + CXX = gcc +@@ -67,7 +72,7 @@ + + $(TARGET): $(OBJS) + @echo "===== Link $@ =====" +- $(LINK) $(LFLAGS) -shared -Wl,-soname,lib$(TARGET)$(SO_EXT) -o $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OBJS) $(LIBS) ++ $(LINK) $(LFLAGS) -shared -Wl,-soname,lib$(TARGET)$(SO_EXT).$(SO_VERSION) -o $(OUT_DIR)/lib$(TARGET)$(SO_EXT) $(OBJS) $(LIBS) + + .cpp.o: + @echo "===== Compile $< =====" diff --git a/AntTweakBar.spec b/AntTweakBar.spec new file mode 100644 index 0000000..6e42356 --- /dev/null +++ b/AntTweakBar.spec @@ -0,0 +1,113 @@ +Name: AntTweakBar +Version: 1.13 +Release: 5%{?dist} +Summary: GUI library for videogame property editing UIs + +Group: Applications/Internet +License: zlib +URL: http://www.antisphere.com/Wiki/tools:anttweakbar +Source0: http://www.antisphere.com/Tools/AntTweakBar/AntTweakBar_113.zip +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: mesa-libGL-devel +BuildRequires: mesa-libGLU-devel +BuildRequires: libX11-devel +BuildRequires: xorg-x11-proto-devel + +# upstream has missing includes for standard libc functions +# patch sent to upstream author via email. +Patch0: AntTweakBar-fix-includes.patch + +# allow overriding CXXFLAGS with Fedora preferred build options, +# and attach a proper soname to the shared library generated. +# patch sent to upstream author via email. +Patch1: AntTweakBar-makefile.patch + +# DOS mode file in upstream source makes this necessary +%global _default_patch_fuzz 2 + +%description +Library for easily creating and using tweakable properties in an OpenGL +or SDL application, designed primarily for professional game developers. + +%package devel +Summary: Header files for AntTweakBar +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +Header files for developing applications making use of AntTweakBar. + +%prep +%setup -q -n AntTweakBar +%patch0 -p1 +%patch1 -p1 + +# fix encoding in license file +iconv --from=iso-8859-1 --to=utf8 ./License.txt > ./License.txt.utf8 +touch -r ./License.txt ./License.txt.utf8 +mv ./License.txt.utf8 ./License.txt + +# fix DOS newlines in one of our examples +sed "s|\r||g" ./examples/TwSimpleGLUT.c > ./TwSimpleGLUT.c +touch -r ./examples/TwSimpleGLUT.c ./TwSimpleGLUT.c +mv ./TwSimpleGLUT.c ./examples/TwSimpleGLUT.c + +# fix file permissions (unzip makes everything executable) +# not doing this causes spurious executable bit warnings in +# rpmlint on the debuginfo package and on the doc files +find Readme.txt License.txt src examples include -type f -print0 | xargs -0 chmod 0644 + +%build +cd src +make %{?_smp_mflags} FEDORA_CXXFLAGS="%{optflags}" + +%install +rm -rf "%{buildroot}" +install -m 644 -D include/AntTweakBar.h "%{buildroot}/%{_includedir}/AntTweakBar.h" +install -m 755 -D lib/libAntTweakBar.so "%{buildroot}/%{_libdir}/libAntTweakBar.so.0.0.0" +ln -s "%{_libdir}/libAntTweakBar.so.0.0.0" "%{buildroot}/%{_libdir}/libAntTweakBar.so.0" +ln -s "%{_libdir}/libAntTweakBar.so.0.0.0" "%{buildroot}/%{_libdir}/libAntTweakBar.so" + +%clean +rm -rf "%{buildroot}" + +%files +%defattr(-,root,root,-) +%doc Readme.txt +%doc License.txt +%{_libdir}/libAntTweakBar.so.0.0.0 +%{_libdir}/libAntTweakBar.so.0 + +%files devel +%defattr(-,root,root,-) +%{_includedir}/* +%{_libdir}/libAntTweakBar.so +%doc examples/TwAdvanced1.cpp +%doc examples/TwSimpleGLFW.c +%doc examples/TwSimpleGLUT.c +%doc examples/TwSimpleSDL.c +%doc examples/TwString.cpp + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%changelog +* Wed Oct 23 2009 Sean Middleditch 1.13-5 +- Correct accidental macro expansion in changelog text. + +* Wed Oct 23 2009 Sean Middleditch 1.13-4 +- Use %%global instead of %%define. +- Note that patches have been sent to upstream. + +* Wed Oct 23 2009 Sean Middleditch 1.13-3 +- Preserve timestamp on License.txt. +- Renamed patches to comply with naming policy. +- Included Linux-relevant examples in documentation for -devel package. + +* Wed Oct 22 2009 Sean Middleditch 1.13-2 +- Fix shared library soname and ld links. + +* Wed Oct 21 2009 Sean Middleditch 1.13-1 +- Initial RPM release. diff --git a/sources b/sources index e69de29..97854cf 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +2c02dd71d0f86c62f022eed7e0bcb5b8 AntTweakBar_113.zip