%global gitdate 20150716 %global commit0 7761ee3e1537ccc61820c0d30061eb09edaf1c93 %global srcversion 1.3.8-8 Name: jmake Version: %(echo %{srcversion} |tr - . ) Summary: Make utility for large Java projects License: GPLv2+ # old URLs for v1.0: # https://javamake.sf.net # https://kenai.com/projects/jmake/pages/Home URL: https://github.com/pantsbuild/%{name} %if 0%{?gitdate} Release: 1.%{gitdate}git%(c=%{commit0}; echo ${c:0:7} )%{?dist} Source0: %{url}/archive/%{commit0}.tar.gz#/%{name}-%{commit0}.tar.gz %else Release: 1%{?dist} Source0: %{url}/archive/%{srcversion}.tar.gz#/%{name}-%{version}.tar.gz %endif BuildArch: noarch BuildRequires: ant maven-local BuildRequires: ant-junit BuildRequires: findbugs %description JMake (formerly Javamake) is a tool for Java programmers to make compiling large projects consisting of many packages and source files easy. It is similar in purpose to the make utility familiar to C programmers, except it requires no user configuration. %package javadoc Summary: Javadoc files for %{name} %description javadoc This package contains the API documentation for %{name}. %prep %if 0%{?gitdate} %setup -qn%{name}-%{commit0} %else %setup -qn%{name}-%{srcversion} %endif # unbundle sed -i -r \ -e 's;(file.reference.junit.jar=).*;\1%(build-classpath junit);' \ -e 's;(javac.test.classpath=).*\\;\1%(build-classpath hamcrest):\\;' \ -e 's;(findbugs.file.reference=).*;\1%{_bindir}/findbugs;' \ import.properties nbproject/project.properties # mark binary with version+commit sed -i -e 's;\%VERSION\%;%{srcversion};' -e 's;\%TAG\%;%{commit0};' %{name}.pom %build # build with actual java version ant -Ddefault.javac.source=1.7 -Ddefault.javac.target=1.7 %install %mvn_artifact %{name}.pom dist/%{name}.jar %mvn_install -J dist/javadoc install -m0755 -d %{buildroot}%{_bindir} cat <>%{buildroot}%{_bindir}/%{name} #!/usr/bin/sh java -jar %{_javadir}/%{name}/%{name}.jar \$@ EOT %files -f .mfiles %license LICENSE %doc README %attr(755, root, root) %{_bindir}/%{name} %files javadoc -f .mfiles-javadoc %license LICENSE %changelog * Mon Jun 13 2016 Raphael Groner - 1.3.8.8-1.20150716git7761ee3 - initial