Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 2df189707a5265842f3dff94e7f0b212 > files > 8

poker-eval-136.0-1mdv2010.1.src.rpm

%bcond_without          java

%if %with java
%define gcj_support     1
%endif

%define lib_major       1
%define lib_name        %{mklibname %name %lib_major}
%define develname	%{mklibname -d %name}

Name:           poker-eval
Version:        136.0
Release:        %mkrel 1
Epoch:          0
Summary:        Poker hand evaluator library
Group:          System/Libraries
License:        GPLv3+
URL:            http://pokersource.org/poker-eval/
Source0:        http://download.gna.org/pokersource/sources/poker-eval-%{version}.tar.gz
Source1:        %{name}-java.tar.bz2
Source2:        %{name}.Makefile-java
Source3:        %{name}-saie.script
Patch0:         %{name}-java-junit.patch
Patch1:         %{name}-java-load-library.patch
# Patch from Gentoo (11/2009)
Patch2:		poker-eval-136.0-bash40.patch
BuildRequires:  valgrind
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

%description
This package is a free (GPL) toolkit for writing programs which
simulate or analyze poker games.

%package -n %{lib_name}
Summary:        Main library for %{name}
Group:          System/Libraries
Provides:       %{name} = %{epoch}:%{version}-%{release}

%description -n %{lib_name}
This package is a free (GPL) toolkit for writing programs which
simulate or analyze poker games.

%package -n %{develname}
Summary: Poker hand evaluator library development files
Group: System/Libraries
Requires:       %{lib_name} = %{epoch}:%{version}-%{release}
Provides:       %{name}-devel = %{epoch}:%{version}-%{release}
Provides:       lib%{name}-devel = %{epoch}:%{version}-%{release}
Obsoletes:	%{_lib}poker-eval1-devel

%description -n %{develname}
This package contains the library needed to run programs dynamically
linked with %{name}.

%if %with java
%package -n pokersource
Summary:        Java library for %{name}
Group:          Development/Java
Provides:       %{_lib}%{name}-java = %{epoch}:%{version}-%{release}
Provides:       %{name}-java = %{epoch}:%{version}-%{release}
BuildRequires:  gnu.getopt
BuildRequires:  java-rpmbuild
BuildRequires:  junit
BuildRequires:  oro
%if %{gcj_support}
BuildRequires:  java-gcj-compat-devel
%else
BuildRequires:  java-devel >= 0:1.4.2
%endif

%description -n pokersource
This package is a free (GPL) toolkit for writing java programs which
simulate or analyze poker games.

%package -n pokersource-javadoc
Summary:        Javadoc for pokersource
Group:          Development/Java

%description -n pokersource-javadoc
Javadoc for pokersource-javadoc.
%endif

%prep
%setup -q
%if %with java
%setup -q -a 1
%patch0 -p1
%patch1 -p1
%patch2 -p0
%{__cp} -a %{SOURCE2} java/Makefile
%{__mkdir_p} java/lib
pushd java/lib
%{__ln_s} %{_javadir}/gnu.getopt.jar gnu.getopt.jar
%{__ln_s} %{_javadir}/junit.jar junit.jar
%{__ln_s} %{_javadir}/jakarta-oro.jar jakarta-oro.jar
popd
%endif

# use examples/ directory for devel package %doc section
%{__mkdir_p} tmp/examples && %{__cp} -a examples/*.c tmp/examples
%{__rm} -f tmp/examples/getopt_w32.c

%build

# 11/2009 incubusss : -DPIC -fPIC not added with configure, set it here (x86_64 only)
%ifarch x86_64
CPPFLAGS="${CPPFLAGS:-%optflags -DPIC -fPIC}" ; export CPPFLAGS ;
CXXFLAGS="${CXXFLAGS:-%optflags -DPIC -fPIC}" ; export CXXFLAGS ;
CFLAGS="${CFLAGS:-%optflags -DPIC -fPIC}" ; export CFLAGS ;
%endif

%{configure2_5x} --disable-static
%{make}
%if %with java
pushd java
export CLASSPATH=.
%{__make} CC="gcc" CFLAGS="-fPIC %{optflags}" JDKHOME=%{java_home} JAVAC="%{javac} -source 1.4" JAVADOC="%{javadoc} -source 1.4" || :
popd
%endif

%install
%{__rm} -rf %{buildroot}
%{makeinstall_std}
%{__rm} -rf %{buildroot}%{_libdir}/*.la

%if %with java
pushd java
%{__mkdir_p} %{buildroot}%{_javadir}
%{__install} -p -m 644 pokersource.jar \
%{buildroot}%{_javadir}/pokersource-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %{__ln_s} ${jar} ${jar/-%{version}/}; done)

%{__mkdir_p} %{buildroot}%{_javadocdir}/pokersource-%{version}
# FIXME: javadoc -source 1.4 still doesn't like the enum keyword
%{__cp} -a javadoc/* %{buildroot}%{_javadocdir}/pokersource-%{version} || :
(cd %{buildroot}%{_javadocdir} && %{__ln_s} pokersource-%{version} pokersource)

%{__mkdir_p} %{buildroot}%{_libdir}
%{__install} -m 755 ../lib/libpokerjni.so %{buildroot}%{_libdir}

%{__mkdir_p} %{buildroot}%{_bindir}
%{__install} -m 755 %{SOURCE3} %{buildroot}%{_bindir}/saie
%{__perl} -pi -e 's|/usr/lib|%{_libdir}|g' %{buildroot}%{_bindir}/saie
popd

%multiarch_includes %{buildroot}%{_includedir}/%{name}/poker_config.h

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%endif

%check
%{make} check

%if %with java
pushd java
# FIXME: doesn't work, can't find poker-eval library
#%%{make} JDKHOME=%{java_home} JAVA="%{java} -Djava.library.path=%{buildroot}%{_libdir} -cp %{buildroot}%{_javadir}/pokersource.jar:$(build-classpath gnu.getopt jakarta-oro)" test develtest
popd
%endif

%clean
%{__rm} -rf %{buildroot}

%if %mdkversion < 200900
%post -n %{lib_name} -p /sbin/ldconfig
%endif

%if %mdkversion < 200900
%postun -n %{lib_name} -p /sbin/ldconfig
%endif

%if %with java
%if %{gcj_support}
%post -n pokersource
%{update_gcjdb}

%postun -n pokersource
%{clean_gcjdb}
%endif
%endif

%files -n %{lib_name}
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README TODO WHATS-HERE
%{_libdir}/libpoker-eval*.so.*

%files -n %{develname}
%defattr(-,root,root,-)
%doc tmp/examples
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/combinations.h
%{_includedir}/%{name}/deck.h
%{_includedir}/%{name}/deck_astud.h
%{_includedir}/%{name}/deck_joker.h
%{_includedir}/%{name}/deck_std.h
%{_includedir}/%{name}/deck_undef.h
%{_includedir}/%{name}/enumdefs.h
%{_includedir}/%{name}/enumerate.h
%{_includedir}/%{name}/enumord.h
%{_includedir}/%{name}/evx_defs.h
%{_includedir}/%{name}/game_astud.h
%{_includedir}/%{name}/game_joker.h
%{_includedir}/%{name}/game_std.h
%{_includedir}/%{name}/handval.h
%{_includedir}/%{name}/handval_low.h
%multiarch %{_includedir}/%{name}/poker_config.h
%{multiarch_includedir}/*
%{_includedir}/%{name}/poker_defs.h
%{_includedir}/%{name}/poker_wrapper.h
%{_includedir}/%{name}/pokereval_export.h
%{_includedir}/%{name}/rules_astud.h
%{_includedir}/%{name}/rules_joker.h
%{_includedir}/%{name}/rules_std.h
%{_includedir}/%{name}/rules_undef.h
%{_includedir}/%{name}/inlines/eval.h
%{_includedir}/%{name}/inlines/eval_astud.h
%{_includedir}/%{name}/inlines/eval_joker.h
%{_includedir}/%{name}/inlines/eval_joker_low.h
%{_includedir}/%{name}/inlines/eval_joker_low8.h
%{_includedir}/%{name}/inlines/eval_low.h
%{_includedir}/%{name}/inlines/eval_low27.h
%{_includedir}/%{name}/inlines/eval_low8.h
%{_includedir}/%{name}/inlines/eval_omaha.h
%{_includedir}/%{name}/inlines/eval_type.h
%{_includedir}/%{name}/inlines/evx5.h
%{_includedir}/%{name}/inlines/evx7.h
%{_includedir}/%{name}/inlines/evx_action.h
%{_includedir}/%{name}/inlines/evx_inlines.h
%{_libdir}/libpoker-eval*.so
%{_libdir}/pkgconfig/%{name}.pc

%if %with java
%files -n pokersource
%defattr(0644,root,root,0755)
%doc WHATS-HERE.Java java/sample1.hho
%attr(0755,root,root) %{_bindir}/saie
%{_javadir}/pokersource.jar
%{_javadir}/pokersource-%{version}.jar
%attr(-,root,root) %{_libdir}/libpokerjni.so
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/*.jar.*
%endif

%files -n pokersource-javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/pokersource-%{version}
%{_javadocdir}/pokersource
%endif




%changelog
* Mon Nov 30 2009 Jérôme Brenier <incubusss@mandriva.org> 0:136.0-1mdv2010.1
+ Revision: 472124
- new version 136.0
- fix build on x86_64 (-DPIC -fPIC added)
- fix test (patch from Gentoo)
- fix license tag

  + Thierry Vignaud <tvignaud@mandriva.com>
    - rebuild

* Sat Dec 27 2008 Funda Wang <fwang@mandriva.org> 0:135.0-1mdv2009.1
+ Revision: 320066
- New version 135.0

* Fri Aug 01 2008 Thierry Vignaud <tvignaud@mandriva.com> 0:134.0-8mdv2009.0
+ Revision: 259146
- rebuild

* Thu Jul 24 2008 Thierry Vignaud <tvignaud@mandriva.com> 0:134.0-7mdv2009.0
+ Revision: 247083
- rebuild

  + Pixel <pixel@mandriva.com>
    - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers

* Sat Jan 05 2008 David Walluck <walluck@mandriva.org> 0:134.0-5mdv2008.1
+ Revision: 145639
- fix missing %%endif
- fix build by disabling javadocs and tests

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

  + Anssi Hannula <anssi@mandriva.org>
    - buildrequire java-rpmbuild, i.e. build with icedtea on x86(_64)
    - remove unnecessary Requires(post) on java-gcj-compat

* Mon May 21 2007 David Walluck <walluck@mandriva.org> 0:134.0-2mdv2008.0
+ Revision: 29575
- fix multiarch build by removing spurious BuildArch: noarch
- fix java build by setting CLASSPATH=.

* Mon May 21 2007 David Walluck <walluck@mandriva.org> 0:134.0-1mdv2008.0
+ Revision: 29528
- 134.0
- explicit file list
- disable java as build fails (for now)


* Mon Dec 11 2006 David Walluck <walluck@mandriva.org> 133.0-1mdv2007.0
+ Revision: 95063
- 133.0
- 133.0
- Import poker-eval

* Tue Sep 05 2006 David Walluck <walluck@mandriva.org> 0:132.0-2mdv2007.0
- fix duplicate files

* Fri Aug 25 2006 David Walluck <walluck@mandriva.org> 0:132.0-1mdv2007.0
- release

* Tue Jun 13 2006 Christopher Stone <chris.stone@gmail.com> 131.0-3
- Remove %%makeinstall macro

* Sat Jun 10 2006 Christopher Stone <chris.stone@gmail.com> 131.0-2
- Add pkgconfig to devel Requires
- Use macros for system commands
- Use %%makeinstall macro

* Sun May 14 2006 Christopher Stone <chris.stone@gmail.com> 131.0-1
- upstream sync
- Remove rpmlint fix since it's no longer needed

* Mon Apr 24 2006 Christopher Stone <chris.stone@gmail.com> 130.0-5
- Update URL to new permanent URL

* Mon Apr 24 2006 Christopher Stone <chris.stone@gmail.com> 130.0-4
- Update URL tag to new home page
- Minor spec file cleanups
- Bump release number for rebuild on devel

* Sun Apr 23 2006 Christopher Stone <chris.stone@gmail.com> 130.0-3
- Copy .c files in tmp/examples directory and use this for devel's %%doc

* Wed Apr 19 2006 Christopher Stone <chris.stone@gmail.com> 130.0-2
- Added %%check section
- Removed make build_tables
- Updated Source0 and URL

* Fri Mar 31 2006 Loic Dachary <loic at gnu.org> 130.0-1
- upstream sync

* Sat Mar 18 2006 Christopher Stone <chris.stone@gmail.com> 129.0-1
- Initial RPM release