Name: jinput Version: 2.0.7 Release: %mkrel 0.20140526svn.1 Summary: Java Game Controller API Group: Development/Java License: BSD URL: http://java.net/projects/jinput # Upstream only provides subversion checkout or nightly build. # Also, some (non-Linux) plugin code is non-free. As long as we are deleting # non-free plugins, we also delete plugins for non-Linux operating systems. # Create the source tarball as follows: # svn export -r 253 https://svn.java.net/svn/jinput~svn/trunk jinput-2.0.7 # rm -rf jinput-2.0.7/plugins/{OSX,windows,wintab} # tar cJf jinput-2.0.7.tar.xz jinput-2.0.7 Source0: %{name}-%{version}.tar.xz # Fedora-specific patch: will not be sent upstream. Remove build.xml rules # for building non-free plugin code. Patch0: 001_jinput_build.patch # Fedora-specific patch: will not be sent upstream. Do not strip the native # library. Patch1: 002_jinput_dontstripso.patch # Fedora-specific patch: will not be sent upstream. Load the shared library # from the Fedora-mandated location. Patch2: 003_jinput_usesystemload.patch # Patch from http://java.net/jira/browse/JINPUT-44 to not access usage bits, # which are not supported in current Linux kernels Patch3: 004_jinput_usagebits.patch # Patch from https://java.net/jira/browse/JINPUT-51 to fix a resource leak Patch4: 005_jinput_leak.patch # Patch to be sent upstream to migrate to Java 5 (Java generics) Patch5: 006_jinput_java5.patch BuildRequires: ant BuildRequires: java-devel BuildRequires: java-javadoc BuildRequires: jpackage-utils BuildRequires: jutils BuildRequires: jutils-javadoc Requires: java-headless Requires: jpackage-utils Requires: jutils %description jinput is an implementation of an API for game controller discovery and polled input. It is part of a suite of open-source technologies initiated by the Game Technology Group at Sun Microsystems with the intention of making the development of high performance games in Java a reality. The API itself is pure Java and presents a platform-neutral, completely portable model of controller discovery and polling. It can handle arbitrary controllers and returns both human and machine understandable descriptions of the inputs available. %package javadoc Summary: Javadocs for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} Requires: jutils-javadoc BuildArch: noarch %description javadoc This package contains the API documentation for %{name}. %prep %setup -q %patch0 %patch1 %patch2 %patch3 %patch4 %patch5 # Don't use prebuilt jars rm -f lib/*.jar build-jar-repository -s -p lib jutils fixtimestamp() { touch -r $1.orig $1 rm -f $1.orig } # Fix the version string in the POMs for fil in jinput.pom jinput-platform.pom; do sed -i.orig 's/@VERSION@/%{version}/' $fil fixtimestamp $fil done # Fix the version string in net.java.games.input.Version %global buildnum %(cut -d. -f1 <<< %{release}) sed -i.orig 's/@API_VERSION@/%{version}/;s/@BUILD_NUMBER@/%{buildnum}/' \ coreAPI/src/java/net/java/games/input/Version.java fixtimestamp coreAPI/src/java/net/java/games/input/Version.java # Use Fedora's CFLAGS and LDFLAGS sed -i "s/-O2 -Wall/$RPM_OPT_FLAGS/;s/-shared/& $RPM_LD_FLAGS/" \ plugins/linux/src/native/build.xml # Prevent jutils.jar from being included in jinput.jar sed -i '\@zipfileset.*/>@d' build.xml %build # Get the latest definitions from <linux/input.h> %ant -f plugins/linux/src/native/build.xml createNativeDefinitions.java # Build %ant dist # The ant target to build javadocs has several problems. It looks for the # jutils jar in the wrong place. It doesn't link to the jutils javadocs. # It creates distinct sets of javadoc pages for the coreAPI and for the # plugins, where we would like all of the pages to be in a single javadoc # package. We can solve all but the last with a bit of judicious hacking in # the appropriate build.xml files, but that last point is difficult to address # without resulting in broken links from the plugin pages to the coreAPI pages. # Therefore, we throw up our hands in despair and do this instead: javadoc -d javadoc -classpath lib/jutils.jar:dist/jinput.jar -package \ -sourcepath plugins/awt/src:plugins/linux/src/java:coreAPI/src/java \ -link file://%{_javadocdir}/jutils -link file://%{_javadocdir}/java \ -source 1.5 net.java.games.input %install # jar install -Dp -m 644 dist/%{name}.jar %{buildroot}%{_jnidir}/%{name}.jar # jni install -Dp -m 755 dist/libjinput* \ %{buildroot}%{_libdir}/%{name}/libjinput.so ln -s ../../..%{_jnidir}/%{name}.jar %{buildroot}%{_libdir}/%{name}/ # javadoc mkdir -p %{buildroot}%{_javadocdir} cp -a javadoc %{buildroot}%{_javadocdir}/%{name} # pom install -d -m 755 %{buildroot}%{_mavenpomdir} install -pm 644 jinput-platform.pom \ %{buildroot}%{_mavenpomdir}/JPP-%{name}-platform.pom install -pm 644 jinput.pom %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap %add_maven_depmap JPP-%{name}-platform.pom %check %ant versiontest %files -f .mfiles %doc README.txt %{_libdir}/%{name}/ %files javadoc %{_javadocdir}/%{name}/ %changelog * Tue Jan 20 2015 daviddavid <daviddavid> 2.0.7-0.20140526svn.1.mga5 + Revision: 811619 - Sync with fc21 (update to 2.0.7) * Wed Oct 15 2014 umeabot <umeabot> 2.0.6-3.20110801svn.5.mga5 + Revision: 740491 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 2.0.6-3.20110801svn.4.mga5 + Revision: 680814 - Mageia 5 Mass Rebuild * Sun Dec 22 2013 dmorgan <dmorgan> 2.0.6-3.20110801svn.3.mga4 + Revision: 559940 - Use add_maven_depmap instead of add_to_maven_depmap to fix FTBFS + umeabot <umeabot> - Mageia 4 Mass Rebuild * Mon Feb 18 2013 dmorgan <dmorgan> 2.0.6-3.20110801svn.1.mga3 + Revision: 399131 - Fix build + umeabot <umeabot> - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Fri Aug 05 2011 dmorgan <dmorgan> 2.0.6-1.mga2 + Revision: 131845 - Fix install - Simply spec file + gil <gil> - imported package jinput * Thu Jun 23 2011 gil <gil> 2.0.6-0.%%mkrel - initial rpm