Blob Blame History Raw
%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
Name:           chipmunk
Version:        5.3.1
Release:        1%{?dist}
Summary:        Physics engine for 2D games

Group:          Development/Libraries
License:        MIT
URL:            http://code.google.com/p/chipmunk-physics/
Source0:        http://files.slembcke.net/chipmunk/release/Chipmunk-%{version}.tgz
#Patch0:         chipmunk-4.1.0-cmake.patch
#Patch1:         chipmunk-4.1.0-dsolink.patch
Patch2:         chipmunk-5.2.0-dsolink.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: cmake
BuildRequires: freeglut-devel
BuildRequires: mesa-libGL-devel
BuildRequires: ruby, ruby-devel
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXi-devel
BuildRequires: libXmu-devel
#BuildRequires: ruby
Obsoletes:	chipmunk-ruby <= 4.1.0-9

%description
Chipmunk is a 2D rigid body physics library distributed under the MIT license.
Though not yet complete, it is intended to be fast, numerically stable, and 
easy to use.


%package        devel
Summary:        Development tools for programs which will use the chipmunk library
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
Chipmunk is a 2D rigid body physics library distributed under the MIT license.
Though not yet complete, it is intended to be fast, numerically stable, and 
easy to use.

This package contains the header files and  static libraries to develop
programs that will use the chipmunk library.  You should
install this package if you need to develop programs which will use the 
chipmunk library functions.  You'll also need to install the chipmunk package.

#%package        ruby
#Summary:        Ruby interface to the chipmunk library
#Group:          Development/Libraries
#Requires:       %{name} = %{version}-%{release}
#Requires:       ruby(abi) = 1.8
#
#%description    ruby
#Chipmunk is a 2D rigid body physics library distributed under the MIT license.
#Though not yet complete, it is intended to be fast, numerically stable, and 
#easy to use.
#
#This package contains the Ruby interface to the chipmunk library.
#You'll also need to install the chipmunk package.


%prep
%setup -qn Chipmunk-%{version}
#%patch0 -p1
#%patch1 -p0
%patch2 -p0

%build
%if "%{?_lib}" == "lib64"
  %{cmake} -DLIB_SUFFIX=64
%else
  %{cmake}
%endif 

%{__make} VERBOSE=1 %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
#pushd ruby
#ruby extconf.rb
#make
#popd

%install
rm -rf $RPM_BUILD_ROOT

#mkdir -p $RPM_BUILD_ROOT/%{ruby_sitearch}
#install -m 755 ruby/chipmunk.so $RPM_BUILD_ROOT/%{ruby_sitearch}

make install DESTDIR=$RPM_BUILD_ROOT
%if "%{?_lib}" == "lib64" 
  mv $RPM_BUILD_ROOT/usr/lib/* $RPM_BUILD_ROOT/usr/lib64/
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt
%{_libdir}/*.so.*
%exclude %{_libdir}/*.a

%files devel
%defattr(-,root,root,-)
%doc Demo/
%{_includedir}/chipmunk
%{_libdir}/*.so

#%files ruby
#%defattr(-,root,root,-)
#%{ruby_sitearch}/chipmunk.so


%changelog
* Fri Aug 20 2010 Jon Ciesla <limb@jcomserv.net> - 5.3.1-1
- latest upstream.

* Thu Jul 15 2010 Jon Ciesla <limb@jcomserv.net> - 5.2.0-1
- Latest upstream, BZ 545475.
- Dropped cmake patch, updated dsolink patch.
- Dropped ruby extension for now, not up to date per upstream.

* Mon Jun 28 2010 Jon Ciesla <limb@jcomserv.net> - 4.1.0-9
- Fix FTBFS, BZ 599950.

* Thu Oct  1 2009 Hans de Goede <hdegoede@redhat.com> - 4.1.0-8
- Fix FTBFS

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Mar 10 2009 Jon Ciesla <limb@jcomserv.net> - 4.1.0-6
- ruby extension fix, BZ 489187.

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jan 08 2009 Jon Ciesla <limb@jcomserv.net> - 4.1.0-4
- Attempted 64-bit fix.

* Wed Jan 07 2009 Jon Ciesla <limb@jcomserv.net> - 4.1.0-3
- Review fixes.

* Wed Jan 07 2009 Jon Ciesla <limb@jcomserv.net> - 4.1.0-2
- Review fixes.

* Mon Dec 01 2008 Jon Ciesla <limb@jcomserv.net> - 4.1.0-1
- New version.

* Mon Sep 15 2008 Jon Ciesla <limb@jcomserv.net> - 4.0.2-1
- Created package.