diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3edfbf4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/v18.0.tar.gz diff --git a/.rh-maven35-guava.metadata b/.rh-maven35-guava.metadata new file mode 100644 index 0000000..14cacc9 --- /dev/null +++ b/.rh-maven35-guava.metadata @@ -0,0 +1 @@ +63e0357e9beff7ded24129083121f9c316ac11d5 SOURCES/v18.0.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/guava-java8.patch b/SOURCES/guava-java8.patch new file mode 100644 index 0000000..45fbaa5 --- /dev/null +++ b/SOURCES/guava-java8.patch @@ -0,0 +1,45 @@ +From e1cc5f8e84ab071654d31a55f11db207188c7567 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Fri, 20 Jun 2014 09:29:44 +0200 +Subject: [PATCH] Implement reflection methods required by Java 8 + +--- + guava/src/com/google/common/reflect/Types.java | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/guava/src/com/google/common/reflect/Types.java b/guava/src/com/google/common/reflect/Types.java +index 0f05f78..d5bd950 100644 +--- a/guava/src/com/google/common/reflect/Types.java ++++ b/guava/src/com/google/common/reflect/Types.java +@@ -29,6 +29,8 @@ import com.google.common.collect.ImmutableList; + import com.google.common.collect.Iterables; + + import java.io.Serializable; ++import java.lang.annotation.Annotation; ++import java.lang.reflect.AnnotatedType; + import java.lang.reflect.AnnotatedElement; + import java.lang.reflect.Array; + import java.lang.reflect.GenericArrayType; +@@ -371,6 +373,22 @@ final class Types { + return false; + } + } ++ ++ @Override public T getAnnotation(Class annotationClass) { ++ return null; ++ } ++ ++ @Override public Annotation[] getAnnotations() { ++ return new Annotation[0]; ++ } ++ ++ @Override public Annotation[] getDeclaredAnnotations() { ++ return new Annotation[0]; ++ } ++ ++ @Override public AnnotatedType[] getAnnotatedBounds() { ++ return new AnnotatedType[0]; ++ } + } + + static final class WildcardTypeImpl implements WildcardType, Serializable { diff --git a/SOURCES/guava-jdk8-HashMap-testfix.patch b/SOURCES/guava-jdk8-HashMap-testfix.patch new file mode 100644 index 0000000..d4f2f9d --- /dev/null +++ b/SOURCES/guava-jdk8-HashMap-testfix.patch @@ -0,0 +1,33 @@ +diff -ur guava-18.0.vanilla/guava/src/com/google/common/collect/Maps.java guava-18.0/guava/src/com/google/common/collect/Maps.java +--- guava-18.0.vanilla/guava/src/com/google/common/collect/Maps.java 2014-08-25 18:39:22.000000000 +0000 ++++ guava-18.0/guava/src/com/google/common/collect/Maps.java 2015-06-03 21:02:12.498000000 +0000 +@@ -206,11 +206,15 @@ + return expectedSize + 1; + } + if (expectedSize < Ints.MAX_POWER_OF_TWO) { +- return expectedSize + expectedSize / 3; ++ // This is the calculation used in JDK8 to resize when a putAll ++ // happens; it seems to be the most conservative calculation we ++ // can make. 0.75 is the default load factor. ++ return (int) ((float) expectedSize / 0.75F + 1.0F); + } + return Integer.MAX_VALUE; // any large value + } + ++ + /** + * Creates a mutable {@code HashMap} instance with the same mappings as + * the specified map. +diff -ur guava-18.0.vanilla/guava-tests/test/com/google/common/collect/MapsTest.java guava-18.0/guava-tests/test/com/google/common/collect/MapsTest.java +--- guava-18.0.vanilla/guava-tests/test/com/google/common/collect/MapsTest.java 2014-08-25 18:39:22.000000000 +0000 ++++ guava-18.0/guava-tests/test/com/google/common/collect/MapsTest.java 2015-06-03 21:04:15.463000000 +0000 +@@ -156,7 +156,8 @@ + Field tableField = HashMap.class.getDeclaredField("table"); + tableField.setAccessible(true); + Object[] table = (Object[]) tableField.get(hashMap); +- return table.length; ++ // In JDK8, table is set lazily, so it may be null. ++ return table == null ? 0 : table.length; + } + + public void testCapacityForLargeSizes() { diff --git a/SPECS/guava.spec b/SPECS/guava.spec new file mode 100644 index 0000000..33fcd50 --- /dev/null +++ b/SPECS/guava.spec @@ -0,0 +1,216 @@ +%{?scl:%scl_package guava} +%{!?scl:%global pkg_name %{name}} + +%if 0%{?fedora} +%bcond_without testlib +%endif + +Name: %{?scl_prefix}guava +Version: 18.0 +Release: 10.2%{?dist} +Summary: Google Core Libraries for Java +License: ASL 2.0 +URL: https://github.com/google/guava +BuildArch: noarch + +Source0: https://github.com/google/guava/archive/v%{version}.tar.gz + +Patch0: %{pkg_name}-java8.patch +Patch1: guava-jdk8-HashMap-testfix.patch + +BuildRequires: %{?scl_prefix}maven-local +BuildRequires: %{?scl_prefix}mvn(com.google.code.findbugs:jsr305) +BuildRequires: %{?scl_prefix}mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: %{?scl_prefix}mvn(org.sonatype.oss:oss-parent:pom:) +%if %{with testlib} +BuildRequires: mvn(com.google.truth:truth) +BuildRequires: %{?scl_prefix}mvn(junit:junit) +%endif + +%description +Guava is a suite of core and expanded libraries that include +utility classes, Google’s collections, io classes, and much +much more. +This project is a complete packaging of all the Guava libraries +into a single jar. Individual portions of Guava can be used +by downloading the appropriate module and its dependencies. + +%package javadoc +Summary: Javadoc for %{pkg_name} + +%description javadoc +API documentation for %{pkg_name}. + +%if %{with testlib} + +%package testlib +Summary: The guava-testlib subartefact + +%description testlib +guava-testlib provides additional functionality for conveinent unit testing +%endif + +%prep +%setup -n %{pkg_name}-%{version} -q +%patch0 -p1 +%patch1 -p1 +find . -name '*.jar' -delete + +%pom_disable_module guava-gwt +%if %{without testlib} +%pom_disable_module guava-testlib +%endif +%pom_remove_plugin -r :animal-sniffer-maven-plugin +%pom_remove_plugin :maven-gpg-plugin +%pom_remove_dep jdk:srczip guava +%pom_remove_dep :caliper guava-tests +%mvn_package :guava-parent guava +%mvn_package :guava-tests __noinstall + +# javadoc generation fails due to strict doclint in JDK 1.8.0_45 +%pom_remove_plugin -r :maven-javadoc-plugin + +%pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true" guava/pom.xml + +%build + +%mvn_file :%{pkg_name} %{pkg_name} +%mvn_alias :%{pkg_name} com.google.collections:google-collections com.google.guava:guava-jdk5 +# Tests fail on Koji due to insufficient memory, +# see https://bugzilla.redhat.com/show_bug.cgi?id=1332971 +%mvn_build -s -f + +%install +%mvn_install + +%files -f .mfiles-guava +%doc AUTHORS CONTRIBUTORS README* +%license COPYING + +%files javadoc -f .mfiles-javadoc +%license COPYING + +%if %{with testlib} + +%files testlib -f .mfiles-guava-testlib +%endif + +%changelog +* Thu Jun 22 2017 Michael Simacek - 18.0-10.2 +- Mass rebuild 2017-06-22 + +* Wed Jun 21 2017 Java Maintainers - 18.0-10.1 +- Automated package import and SCL-ization + +* Fri Feb 10 2017 Fedora Release Engineering - 18.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Oct 10 2016 Mikolaj Izdebski - 18.0-9 +- Allow conditional builds without testlib + +* Thu Jun 16 2016 Mikolaj Izdebski - 18.0-8 +- Cleanup package + +* Tue May 10 2016 Mikolaj Izdebski - 18.0-7 +- Disable tests due to insufficient memory on Koji + +* Wed Feb 03 2016 Fedora Release Engineering - 18.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 22 2015 Noa Resare - 18.0-5 +- enable module guava-testlib +- enable tests in guava-testlib +- backport fix to HashMap related test from 19.0-SNAPSHOT + +* Wed Jun 17 2015 Fedora Release Engineering - 18.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu May 14 2015 Mikolaj Izdebski - 18.0-3 +- Remove maven-javadoc-plugin execution + +* Fri Feb 6 2015 Mikolaj Izdebski - 18.0-2 +- Update upstream website URL + +* Wed Jan 7 2015 Zbigniew Jędrzejewski-Szmek - 18.0-1 +- Update to v. 18 (#1175401) +- Use %license + +* Wed Oct 8 2014 Mikolaj Izdebski - 17.0-2 +- Add alias for com.google.guava:guava-jdk5 + +* Fri Jun 20 2014 Mikolaj Izdebski - 17.0-1 +- Add patch for Java 8 + +* Tue Jun 17 2014 Roland Grunberg - 15.0-4 +- Do not generate uses directive for exports. + +* Fri Jun 13 2014 Zbigniew Jędrzejewski-Szmek 17.0-1 +- Update to latest upstream version (#1109442). + +* Sat Jun 07 2014 Fedora Release Engineering - 15.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Mar 04 2014 Stanislav Ochotnicky - 15.0-2 +- Use Requires: java-headless rebuild (#1067528) + +* Wed Jan 8 2014 Mikolaj Izdebski - 15.0-1 +- Update to upstream version 15.0 + +* Mon Aug 12 2013 gil cattaneo 13.0-6 +- fix rhbz#992456 +- update to current packaging guidelines + +* Sat Aug 03 2013 Fedora Release Engineering - 13.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Jun 28 2013 Mikolaj Izdebski - 13.0-4 +- Replace BR on ant-nodeps with ant + +* Fri Jun 28 2013 Mikolaj Izdebski - 13.0-4 +- Rebuild to regenerate API documentation +- Resolves: CVE-2013-1571 + +* Thu Feb 14 2013 Fedora Release Engineering - 13.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Feb 06 2013 Java SIG - 13.0-2 +- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild +- Replace maven BuildRequires with maven-local + +* Tue Aug 7 2012 Mikolaj Izdebski - 13.0-1 +- Update to upstream version 13.0 +- Remove RPM bug workaround +- Convert patches to pom macros + +* Thu Jul 19 2012 Fedora Release Engineering - 11.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Apr 28 2012 gil cattaneo 11.0.2-1 +- Update to 11.0.2 + +* Fri Jan 13 2012 Fedora Release Engineering - 09-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Sep 12 2011 Stanislav Ochotnicky - 09-1 +- Update to 09 +- Packaging fixes +- Build with maven + +* Wed Feb 09 2011 Fedora Release Engineering - 05-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Jul 14 2010 Hui wang - 05-4 +- Patch pom + +* Fri Jun 18 2010 Hui Wang - 05-3 +- Fixed jar name in install section +- Removed spaces in description + +* Thu Jun 17 2010 Hui Wang - 05-2 +- Fixed summary +- Fixed description +- Fixed creating symlink insturctions +- add depmap + +* Thu Jun 10 2010 Hui Wang - 05-1 +- Initial version of the package