Blob Blame History Raw
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 <sean@middleditch.us> 1.13-5
- Correct accidental macro expansion in changelog text.

* Wed Oct 23 2009 Sean Middleditch <sean@middleditch.us> 1.13-4
- Use %%global instead of %%define.
- Note that patches have been sent to upstream.

* Wed Oct 23 2009 Sean Middleditch <sean@middleditch.us> 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 <sean@middleditch.us> 1.13-2
- Fix shared library soname and ld links.

* Wed Oct 21 2009 Sean Middleditch <sean@middleditch.us> 1.13-1
- Initial RPM release.