%global gittag 5.4.0.201906121030-r %bcond_with tests Name: jgit Version: 5.4.0 Release: 1 Summary: A pure java implementation of git License: BSD URL: https://www.eclipse.org/jgit/ Source0: https://git.eclipse.org/c/jgit/jgit.git/snapshot/jgit-%{gittag}.tar.xz Patch0: 0001-Ensure-the-correct-classpath-is-set-for-the-jgit-com.patch Patch1: 0002-Ensure-all-packages-are-exported.patch Patch2: 0003-Remove-dependency-on-javax.xml.bind-package.patch BuildArch: noarch BuildRequires: maven-local mvn(args4j:args4j) mvn(com.google.code.gson:gson) BuildRequires: mvn(com.googlecode.javaewah:JavaEWAH) mvn(com.jcraft:jsch) BuildRequires: mvn(com.jcraft:jzlib) mvn(javax.servlet:javax.servlet-api) mvn(junit:junit) BuildRequires: mvn(net.i2p.crypto:eddsa) mvn(org.apache.ant:ant) BuildRequires: mvn(org.apache.commons:commons-compress) BuildRequires: mvn(org.apache.httpcomponents:httpclient) BuildRequires: mvn(org.apache.httpcomponents:httpcore) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.apache.sshd:sshd-osgi) >= 2.2.0 mvn(org.apache.sshd:sshd-sftp) >= 2.2.0 BuildRequires: mvn(org.bouncycastle:bcpg-jdk15on) >= 1.61 BuildRequires: mvn(org.bouncycastle:bcpkix-jdk15on) >= 1.61 BuildRequires: mvn(org.bouncycastle:bcprov-jdk15on) >= 1.61 BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) BuildRequires: mvn(org.eclipse.jetty:jetty-servlet) mvn(org.osgi:osgi.core) BuildRequires: mvn(org.slf4j:slf4j-api) mvn(org.slf4j:slf4j-simple) mvn(org.tukaani:xz) %if %{with tests} BuildRequires: git mvn(org.hamcrest:hamcrest-library) mvn(org.mockito:mockito-core) %endif Requires: bouncycastle >= 1.61 apache-sshd >= 1:2.2.0 %description A pure Java implementation of the Git version control system and command line interface. %package javadoc Summary: API documentation for %{name} %description javadoc %{summary}. %prep %setup -n jgit-%{gittag} -q %patch0 -p1 %patch1 -p1 %patch2 -p1 rm .mvn/maven.config %pom_xpath_remove "pom:plugin[pom:artifactId='maven-compiler-plugin']/pom:executions/pom:execution[pom:id='compile-with-errorprone']" pom.xml %pom_xpath_remove "pom:plugin[pom:artifactId='maven-compiler-plugin']/pom:executions/pom:execution[pom:id='default-compile']/pom:configuration" pom.xml %pom_xpath_remove "pom:plugin[pom:artifactId='maven-compiler-plugin']/pom:dependencies" pom.xml %pom_change_dep -r org.osgi:org.osgi.core org.osgi:osgi.core:provided %pom_disable_module org.eclipse.jgit.coverage %pom_remove_plugin :jacoco-maven-plugin %pom_remove_plugin :maven-javadoc-plugin %pom_remove_plugin -r :maven-source-plugin %pom_remove_plugin :maven-enforcer-plugin %pom_remove_plugin -r :japicmp-maven-plugin sed -i -e 's/@{argLine}//' $(find -name pom.xml) %pom_remove_plugin org.codehaus.mojo:build-helper-maven-plugin org.eclipse.jgit.pgm %pom_remove_plugin :spring-boot-maven-plugin org.eclipse.jgit.pgm %pom_xpath_remove "pom:plugins/pom:plugin/pom:executions/pom:execution[pom:id='create_jgit']" org.eclipse.jgit.pgm sed -i -e 's/org\.springframework\.boot\.loader\.JarLauncher/org.eclipse.jgit.pgm.Main/' \ org.eclipse.jgit.pgm/jgit.sh %pom_remove_dep log4j:log4j . org.eclipse.jgit.pgm %pom_change_dep org.slf4j:slf4j-log4j12 org.slf4j:slf4j-simple . org.eclipse.jgit.pgm %if %{without tests} sed -i -e '/\.test<\/module>/d' pom.xml %endif %mvn_package ":*.test" __noinstall %build %if %{without tests} %mvn_build -f -- -Pjavac %else %mvn_build -- -Pjavac -Dmaven.test.failure.ignore=true %endif %install %mvn_install install -dm 755 %{buildroot}%{_bindir} install -m 755 org.eclipse.jgit.pgm/jgit.sh %{buildroot}%{_bindir}/jgit install -dm 755 %{buildroot}%{_sysconfdir}/ant.d cat > %{buildroot}%{_sysconfdir}/ant.d/jgit < - 5.4.0-1 - Package init