%global bits 32 %global debug_package %{nil} %ifarch x86_64 ppc64 s390x sparc64 %global bits 64 %endif %global namedreltag %{nil} %global namedversion %{version}%{?namedreltag} Name: native-platform Version: 0.10 Release: 1%{?dist} Summary: Java bindings for various native APIs License: ASL 2.0 URL: https://github.com/adammurdoch/native-platform Source0: https://github.com/adammurdoch/native-platform/archive/%{namedversion}.tar.gz Source1: http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/%{name}/%{namedversion}/%{name}-%{namedversion}.pom Source2: http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/%{name}-linux-i386/%{namedversion}/%{name}-linux-i386-%{namedversion}.pom Source3: http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/%{name}-linux-amd64/%{namedversion}/%{name}-linux-amd64-%{namedversion}.pom # From Debian Source4: %{name}-0.7-Makefile # Try to load native library first from /usr/lib*/native-platform # instead of extractDir or classpath. Patch0: %{name}-0.10-NativeLibraryLocator.patch # Use generate libraries without arch references # Add support for arm and other x64 arches Patch1: %{name}-0.10-native-libraries-name.patch # build tools and deps BuildRequires: java-devel BuildRequires: javapackages-local BuildRequires: ncurses-devel BuildRequires: jopt-simple %description A collection of cross-platform Java APIs for various native APIs. These APIs support Java 5 and later. Some of these APIs overlap with APIs available in later Java versions. %if 0 %package javadoc Summary: Javadoc for %{name} BuildArch: noarch %description javadoc This package contains javadoc for %{name}. %endif %prep %setup -q -n %{name}-%{namedversion} find . -name "*.jar" -delete find . -name "*.class" -delete %patch0 -p0 %patch1 -p0 cp -p %{SOURCE1} pom.xml cp -p %{SOURCE4} Makefile %pom_remove_dep net.rubygrapefruit:%{name}-osx-i386 pom.xml %pom_remove_dep net.rubygrapefruit:%{name}-osx-amd64 pom.xml %pom_remove_dep net.rubygrapefruit:%{name}-windows-i386 pom.xml %pom_remove_dep net.rubygrapefruit:%{name}-windows-amd64 pom.xml %pom_remove_dep net.rubygrapefruit:%{name}-freebsd-i386 pom.xml %pom_remove_dep net.rubygrapefruit:%{name}-freebsd-amd64 pom.xml %if %{bits} == 64 %pom_remove_dep net.rubygrapefruit:%{name}-linux-i386 pom.xml %else %pom_remove_dep net.rubygrapefruit:%{name}-linux-amd64 pom.xml %endif chmod 644 readme.md sed -i 's/\r//' readme.md # TODO mv src/curses/cpp/*.cpp src/main/cpp mv src/shared/cpp/* src/main/cpp sed -i.javadoc8 "s|.PHONY: clean jar javadoc|.PHONY: clean jar|" Makefile sed -i.javadoc8 "s|jar javadoc arch-jar|jar arch-jar|" Makefile %build %if %{bits} == 64 %mvn_file net.rubygrapefruit:%{name}-linux-amd64 %{name}-linux %mvn_artifact %{SOURCE3} %{name}-linux.jar %else %mvn_file net.rubygrapefruit:%{name}-linux-i386 %{name}-linux %mvn_artifact %{SOURCE2} %{name}-linux.jar %endif %mvn_file net.rubygrapefruit:%{name} %{name} %mvn_artifact pom.xml build/%{name}.jar CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; CPPFLAGS="${CPPFLAGS:-%optflags}" ; export CPPFLAGS ; CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; make %{?_smp_mflags} JAVA_HOME=%{_jvmdir}/java %install %if 0 %mvn_install -J build/docs/javadoc %else %mvn_install %endif mkdir -p %{buildroot}%{_libdir}/%{name} install -pm 0755 build/binaries/libnative-platform-curses.so %{buildroot}%{_libdir}/%{name} install -pm 0755 build/binaries/libnative-platform.so %{buildroot}%{_libdir}/%{name} %files -f .mfiles %{_libdir}/%{name} %doc readme.md LICENSE %if 0 %files javadoc -f .mfiles-javadoc %doc LICENSE %endif %changelog * Fri Oct 17 2014 gil cattaneo 0.10-1 - update to 0.10 * Sun Aug 17 2014 Fedora Release Engineering - 0.3-0.6.rc2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 0.3-0.5.rc2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Fri Mar 28 2014 Michael Simacek - 0.3-0.4.rc2 - Use Requires: java-headless rebuild (#1067528) * Tue Oct 15 2013 gil cattaneo 0.3-0.3.rc2 - fix for rhbz#992323 - use make as buildsystem to avoid circular dependencies - removed arch references from installed native jar * Thu May 09 2013 gil cattaneo 0.3-0.2.rc2 - removed unnecessary references to jpackage-utils and gcc-c++ * Tue Apr 30 2013 gil cattaneo 0.3-0.1.rc2 - update to 0.3-rc-2 * Thu Dec 13 2012 gil cattaneo 0.2-1 - initial rpm