diff --git a/avoid-jarjar-bundling.patch b/avoid-jarjar-bundling.patch new file mode 100644 index 0000000000000000000000000000000000000000..904e88eb7ab15998e5aa5b9f710fbdd7a3228972 --- /dev/null +++ b/avoid-jarjar-bundling.patch @@ -0,0 +1,84 @@ +--- ivy.xml.orig 2018-04-18 12:50:14.434879557 +0100 ++++ ivy.xml 2018-04-18 12:50:41.064751141 +0100 +@@ -18,16 +18,14 @@ + + + +- + ]> + + +- ++ + + + + +- + + + +@@ -58,10 +56,6 @@ + + + +- +- +- +- + + + +--- build.xml.orig 2018-04-18 12:53:28.583943322 +0100 ++++ build.xml 2018-04-18 12:59:08.082561554 +0100 +@@ -183,7 +183,6 @@ + + + +- + + + +@@ -212,7 +211,6 @@ + + + +- + + + +@@ -368,31 +366,17 @@ + + + +- + +- ++ + +- +- +- +- +- +- +- +- +- +- +- +- +- + + + + + + +- +- ++ ++ + + + diff --git a/fix-gradle-maven-build.patch b/fix-gradle-maven-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..730c35940659306980112090b2f2081436791db3 --- /dev/null +++ b/fix-gradle-maven-build.patch @@ -0,0 +1,34 @@ +--- ivy.xml.orig 2018-04-18 14:00:02.327714780 +0100 ++++ ivy.xml 2018-04-18 14:01:58.665183881 +0100 +@@ -32,8 +32,13 @@ + + + ++ ++ + + ++ ++ ++ + + + +--- src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java.orig 2018-04-18 13:57:53.359303320 +0100 ++++ src/main/java/de/thetaphi/forbiddenapis/gradle/CheckForbiddenApis.java 2018-04-18 13:57:59.455275501 +0100 +@@ -45,7 +45,6 @@ + import org.gradle.api.tasks.InputFiles; + import org.gradle.api.tasks.Optional; + import org.gradle.api.tasks.OutputDirectories; +-import org.gradle.api.tasks.ParallelizableTask; + import org.gradle.api.tasks.SkipWhenEmpty; + import org.gradle.api.tasks.TaskAction; + import org.gradle.api.tasks.VerificationTask; +@@ -103,7 +102,6 @@ + * + * @since 2.0 + */ +-@ParallelizableTask + public class CheckForbiddenApis extends DefaultTask implements PatternFilterable,VerificationTask,Constants { + + private static final String NL = System.getProperty("line.separator", "\n"); diff --git a/forbidden-apis-2.5.tar.gz b/forbidden-apis-2.5.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4f7225a226bc35b43ae41a6dda30229e37e3fedb Binary files /dev/null and b/forbidden-apis-2.5.tar.gz differ diff --git a/forbidden-apis.spec b/forbidden-apis.spec new file mode 100644 index 0000000000000000000000000000000000000000..5583184a6b4bbfad32f1c2dc9b230e9c6cc735a2 --- /dev/null +++ b/forbidden-apis.spec @@ -0,0 +1,77 @@ +Name: forbidden-apis +Version: 2.5 +Release: 1 +Summary: Policeman's Forbidden API Checker +License: ASL 2.0 +URL: https://github.com/policeman-tools/forbidden-apis +Source0: https://github.com/policeman-tools/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0: avoid-jarjar-bundling.patch +Patch1: fix-gradle-maven-build.patch +BuildArch: noarch +BuildRequires: gradle-local ivy-local maven-local ant ant-antunit ant-contrib ant-junit +BuildRequires: objectweb-asm plexus-utils maven-plugin-plugin sonatype-oss-parent + +%description +Allows to parse Java byte code to find invocations of method/class/field +signatures and fail build (Apache Ant, Apache Maven, or Gradle). + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +This package contains API documentation for %{name}. + +%prep +%setup -q +%patch0 +%patch1 +find . -name "*.jar" -print -delete +find . -name "*.class" -print -delete +sed -i -e '/ivy:configure/d' build.xml +%pom_xpath_remove "target/artifact:pom" build.xml +%pom_xpath_remove "target/artifact:mvn" build.xml +%pom_xpath_remove "target/artifact:install" build.xml +%pom_xpath_inject "target[@name='maven-descriptor']" \ +" + + + + + + + + + + +" build.xml +sed -i -e '/maven-ant-tasks/d' ivy.xml +sed -i -e '/uri="antlib:org.apache.maven.artifact.ant/d' build.xml +sed -i -e '/apache-rat/d' ivy.xml +sed -i -e '/uri="antlib:org.apache.rat.anttasks/d' build.xml + +%build +ant -Divy.mode=local jar documentation test-junit + +%install +%pom_add_dep org.apache.ant:ant:1.7.0:provided build/maven/pom-deploy.xml +%pom_add_dep org.ow2.asm:asm:6.1.1 build/maven/pom-deploy.xml +%pom_add_dep org.ow2.asm:asm-commons:6.1.1 build/maven/pom-deploy.xml +%pom_add_dep org.codehaus.plexus:plexus-utils:1.1 build/maven/pom-deploy.xml +%pom_add_dep commons-cli:commons-cli:1.3.1 build/maven/pom-deploy.xml +%mvn_artifact build/maven/pom-deploy.xml dist/forbiddenapis-2.5.jar +%mvn_install -J build/docs +mkdir -p %{buildroot}%{_sysconfdir}/ant.d +echo "%{name} ant apache-commons-cli objectweb-asm/asm objectweb-asm/asm-commons plexus/utils" > %{name}-ant +install -pm 644 %{name}-ant %{buildroot}%{_sysconfdir}/ant.d/%{name} + +%files -f .mfiles +%config(noreplace) %{_sysconfdir}/ant.d/%{name} +%license LICENSE.txt NOTICE.txt +%doc README.md + +%files javadoc -f .mfiles-javadoc +%license LICENSE.txt NOTICE.txt + +%changelog +* Thu Jul 30 2020 leiju - 2.5-1 +- Package init diff --git a/forbidden-apis.yaml b/forbidden-apis.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9352383baad95457539f1792ecb34fa1a573cb1b --- /dev/null +++ b/forbidden-apis.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: policeman-tools/forbidden-apis +tag_prefix: "^" +seperator: "."