commit 949a380ca660df1d1c846e4967619602aaad26ce786e8dc721e16ad53583fb66 Author: Fridrich Strba Date: Sat Mar 16 18:47:20 2019 +0000 OBS-URL: https://build.opensuse.org/package/show/Java:packages/google-guice?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/4.1.tar.gz b/4.1.tar.gz new file mode 100644 index 0000000..473b84a --- /dev/null +++ b/4.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77650231a0b12c0f0551202ae4dcfc1a4364e090f461cc3d21616d45bfc49537 +size 23212767 diff --git a/google-guice.spec b/google-guice.spec new file mode 100644 index 0000000..d00be56 --- /dev/null +++ b/google-guice.spec @@ -0,0 +1,285 @@ +# +# spec file for package google +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global short_name guice + +Name: google-%{short_name} +Version: 4.1 +Release: 0 +Summary: Lightweight dependency injection framework for Java 5 and above +License: Apache-2.0 +Group: Development/Libraries/Java +URL: https://github.com/google/%{short_name} +BuildArch: noarch + +Source0: https://github.com/google/%{short_name}/archive/%{version}.tar.gz +Patch0: guice-4.1-fixup-ant.patch +Patch1: guice-4.1-disabledextensions.patch +Patch2: guice-4.1-javadoc.patch + +BuildRequires: ant +BuildRequires: aopalliance +BuildRequires: aqute-bnd +BuildRequires: atinject +BuildRequires: cglib +BuildRequires: fdupes +BuildRequires: glassfish-servlet-api +BuildRequires: guava20 +BuildRequires: jarjar +BuildRequires: java-devel >= 1.7 +BuildRequires: javapackages-local +BuildRequires: objectweb-asm +BuildRequires: slf4j +BuildRequires: xmvn-install +BuildRequires: xmvn-resolve + +%description +Put simply, Guice alleviates the need for factories and the use of new +in your Java code. Think of Guice's @Inject as the new new. You will +still need to write factories in some cases, but your code will not +depend directly on them. Your code will be easier to change, unit test +and reuse in other contexts. + +Guice embraces Java's type safe nature, especially when it comes to +features introduced in Java 5 such as generics and annotations. You +might think of Guice as filling in missing features for core +Java. Ideally, the language itself would provide most of the same +features, but until such a language comes along, we have Guice. + +Guice helps you design better APIs, and the Guice API itself sets a +good example. Guice is not a kitchen sink. We justify each feature +with at least three use cases. When in doubt, we leave it out. We +build general functionality which enables you to extend Guice rather +than adding every feature to the core framework. + +%package -n %{short_name}-parent +Summary: Guice parent POM +Group: Development/Libraries/Java + +%description -n %{short_name}-parent +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides parent POM for Guice modules. + +%package -n %{short_name}-assistedinject +Summary: AssistedInject extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-assistedinject +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides AssistedInject module for Guice. + +%package -n %{short_name}-extensions +Summary: Extensions for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-extensions +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides extensions POM for Guice. + +%package -n %{short_name}-grapher +Summary: Grapher extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-grapher +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Grapher module for Guice. + +%package -n %{short_name}-jmx +Summary: JMX extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-jmx +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides JMX module for Guice. + +%package -n %{short_name}-jndi +Summary: JNDI extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-jndi +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides JNDI module for Guice. + +%package -n %{short_name}-multibindings +Summary: MultiBindings extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-multibindings +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides MultiBindings module for Guice. + +%package -n %{short_name}-servlet +Summary: Servlet extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-servlet +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Servlet module for Guice. + +%package -n %{short_name}-testlib +Summary: TestLib extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-testlib +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides TestLib module for Guice. + +%package -n %{short_name}-throwingproviders +Summary: ThrowingProviders extension module for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-throwingproviders +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides ThrowingProviders module for Guice. + +%package -n %{short_name}-bom +Summary: Bill of Materials for Guice +Group: Development/Libraries/Java + +%description -n %{short_name}-bom +Guice is a lightweight dependency injection framework for Java 5 +and above. This package provides Bill of Materials module for Guice. + +%package javadoc +Summary: API documentation for Guice +Group: Documentation/HTML + +%description javadoc +This package provides %{summary}. + + +%prep +%setup -q -n %{short_name}-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +find . -name "*.jar" -and ! -name "munge.jar" -delete +find . -name "*.class" -delete + +# We don't have struts2 in Fedora yet. +%pom_disable_module struts2 extensions +# Android-specific extension +%pom_disable_module dagger-adapter extensions + +# Fix OSGi metadata due to not using jarjar +%pom_xpath_set "pom:instructions/pom:Import-Package" \ + "!com.google.inject.*,*" core + +# Animal sniffer is only causing problems. Disable it for now. +%pom_remove_plugin :animal-sniffer-maven-plugin core +%pom_remove_plugin :animal-sniffer-maven-plugin extensions + +%pom_remove_plugin :maven-gpg-plugin + +# We don't have the custom doclet used by upstream. Remove +# maven-javadoc-plugin to generate javadocs with default style. +%pom_remove_plugin -r :maven-javadoc-plugin + +# remove test dependency to make sure we don't produce requires +# see #1007498 +%pom_remove_dep :guava-testlib extensions +%pom_xpath_remove "pom:dependency[pom:classifier[text()='tests']]" extensions + +%pom_remove_parent +%pom_set_parent com.google.inject:guice-parent:%{version} jdk8-tests + +%pom_disable_module persist extensions +%pom_disable_module spring extensions + +%pom_disable_module jdk8-tests + +%pom_remove_plugin :maven-remote-resources-plugin +%pom_remove_plugin :maven-bundle-plugin +%pom_remove_plugin :maven-source-plugin + +%pom_remove_plugin :maven-remote-resources-plugin extensions +%pom_remove_plugin :maven-bundle-plugin extensions +%pom_remove_plugin :maven-source-plugin extensions + +%pom_xpath_remove "pom:dependency[pom:scope[text()='test']]" core +%pom_xpath_remove "pom:profiles" core +%pom_xpath_remove "pom:build" core +%pom_xpath_remove "pom:optional" core + +%build +%mvn_alias "com.google.inject.extensions:" "org.sonatype.sisu.inject:" + +%mvn_package :::no_aop: guice +%mvn_package :{*} @1 + +%mvn_file ":guice-{*}" %{short_name}/guice-@1 +%mvn_file ":guice" %{short_name}/%{name} %{name} +%mvn_alias ":guice" "org.sonatype.sisu:sisu-guice" + +build-jar-repository -s -p lib/build \ + guava20 javax.inject glassfish-servlet-api aopalliance cglib objectweb-asm aqute-bnd jarjar +%ant clean.all no_aop +pushd build/no_aop +%pom_xpath_inject "pom:project" "no_aop" core +%ant -Dversion=%{version} jar +popd +%ant -Dversion=%{version} dist javadoc + +%mvn_artifact pom.xml +%mvn_artifact bom/pom.xml +%mvn_artifact build/no_aop/core/pom.xml build/no_aop/build/guice-%{version}.jar +# a huge hack to force the no_aop classifier to the version 2.3.0 reactor +perl -pi -e 's#guice#guiceno_aop#g' .xmvn-reactor +%mvn_artifact core/pom.xml build/guice-%{version}.jar +%mvn_artifact extensions/pom.xml +%mvn_artifact extensions/jmx/pom.xml build/dist/guice-jmx-%{version}.jar +%mvn_artifact extensions/assistedinject/pom.xml build/dist/guice-assistedinject-%{version}.jar +%mvn_artifact extensions/multibindings/pom.xml build/dist/guice-multibindings-%{version}.jar +%mvn_artifact extensions/throwingproviders/pom.xml build/dist/guice-throwingproviders-%{version}.jar +%mvn_artifact extensions/servlet/pom.xml build/dist/guice-servlet-%{version}.jar +%mvn_artifact extensions/jndi/pom.xml build/dist/guice-jndi-%{version}.jar +%mvn_artifact extensions/testlib/pom.xml build/dist/guice-testlib-%{version}.jar +%mvn_artifact extensions/grapher/pom.xml build/dist/guice-grapher-%{version}.jar + +%install +%mvn_install -J build/docs/javadoc +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles-guice +%dir %{_javadir}/%{short_name} + +%files -n %{short_name}-parent -f .mfiles-guice-parent +%doc COPYING + +%files -n %{short_name}-assistedinject -f .mfiles-guice-assistedinject +%files -n %{short_name}-extensions -f .mfiles-extensions-parent +%files -n %{short_name}-grapher -f .mfiles-guice-grapher +%files -n %{short_name}-jmx -f .mfiles-guice-jmx +%files -n %{short_name}-jndi -f .mfiles-guice-jndi +%files -n %{short_name}-multibindings -f .mfiles-guice-multibindings +%if %{with jpa} +%files -n %{short_name}-persist -f .mfiles-guice-persist +%endif +%files -n %{short_name}-servlet -f .mfiles-guice-servlet +%if %{with spring} +%files -n %{short_name}-spring -f .mfiles-guice-spring +%endif +%files -n %{short_name}-testlib -f .mfiles-guice-testlib +%files -n %{short_name}-throwingproviders -f .mfiles-guice-throwingproviders + +%files -n %{short_name}-bom -f .mfiles-guice-bom + +%files javadoc -f .mfiles-javadoc +%doc COPYING + +%changelog diff --git a/guice-4.1-disabledextensions.patch b/guice-4.1-disabledextensions.patch new file mode 100644 index 0000000..368857e --- /dev/null +++ b/guice-4.1-disabledextensions.patch @@ -0,0 +1,102 @@ +--- guice-4.1/build.xml 2018-10-30 11:38:11.568428971 +0100 ++++ guice-4.1/build.xml 2018-10-30 11:38:32.188523986 +0100 +@@ -25,15 +25,11 @@ + + +- +- + + + + + +- +- + + + +@@ -41,12 +37,6 @@ + + + +- +- +- +- +- +- + + + +@@ -62,12 +52,6 @@ + + + +- +- +- +- +- +- + + + +@@ -154,15 +138,11 @@ + + + +- + + + + + +- +- +- + + + +@@ -216,9 +196,6 @@ + + + +- +- +- + + + +@@ -228,15 +205,6 @@ + + + +- +- +- +- +- +- +- +- +- + + + +@@ -300,15 +268,11 @@ + depends="clean" + description="Remove generated files."> + +- +- + + + + + +- +- + + + diff --git a/guice-4.1-fixup-ant.patch b/guice-4.1-fixup-ant.patch new file mode 100644 index 0000000..e5c4343 --- /dev/null +++ b/guice-4.1-fixup-ant.patch @@ -0,0 +1,147 @@ +diff -urEbwB guice-4.1/build.properties guice-4.1.new/build.properties +--- guice-4.1/build.properties 2016-06-17 20:00:06.000000000 +0200 ++++ guice-4.1.new/build.properties 2019-02-13 23:51:02.592074396 +0100 +@@ -37,4 +37,4 @@ + com.google.inject.testing.fieldbinder + test.class=com.google.inject.AllTests + module=com.google.inject +-imports=!net.sf.cglib.*,!org.objectweb.asm.* ++imports=net.sf.cglib.*,org.objectweb.asm.* +diff -urEbwB guice-4.1/build.xml guice-4.1.new/build.xml +--- guice-4.1/build.xml 2016-06-17 20:00:06.000000000 +0200 ++++ guice-4.1.new/build.xml 2019-02-13 23:51:02.596074414 +0100 +@@ -18,10 +18,10 @@ + + + +- +- ++ +- ++ + + + +@@ -118,16 +118,8 @@ + + + +- +- +- +- +- +- +- +- +- +- ++ ++ + + + +diff -urEbwB guice-4.1/common.xml guice-4.1.new/common.xml +--- guice-4.1/common.xml 2016-06-17 20:00:06.000000000 +0200 ++++ guice-4.1.new/common.xml 2019-02-13 23:51:18.596146420 +0100 +@@ -14,7 +14,7 @@ + ++ source="1.6" target="1.6" encoding="UTF-8" includeantruntime="false"> + + + +@@ -26,7 +26,7 @@ + + + ++ classpathref="compile.classpath"/> + + + +@@ -48,7 +48,7 @@ + + + +- ++ + + + +@@ -60,13 +60,19 @@ + + + +- ++ ++ ++ ++ ++ + + + + + + ++ ++ + + + ++ source="1.6" target="1.6" encoding="UTF-8" includeantruntime="false"> + + + +@@ -120,37 +126,16 @@ + description="Build jar files"/> + + ++ description="Build a jar of tests."> + + +- +- +- +- +- +- +- +- +- +- ++ + + + ++ description="Build jar."> + + +- +- +- +- +- +- +- +- +- +- +- ++ + + diff --git a/guice-4.1-javadoc.patch b/guice-4.1-javadoc.patch new file mode 100644 index 0000000..19d14e9 --- /dev/null +++ b/guice-4.1-javadoc.patch @@ -0,0 +1,46 @@ +diff -urEbwB guice-4.1/build.xml guice-4.1.new/build.xml +--- guice-4.1/build.xml 2019-02-13 23:43:35.806063663 +0100 ++++ guice-4.1.new/build.xml 2019-02-13 23:46:22.818815271 +0100 +@@ -126,7 +126,7 @@ + + + + +@@ -151,7 +151,7 @@ + + +@@ -170,9 +170,9 @@ + + +@@ -205,12 +205,6 @@ + + + +- +- +- +- +- +- + + +