diff --git a/4.1.tar.gz b/4.1.tar.gz
deleted file mode 100644
index 473b84a..0000000
--- a/4.1.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:77650231a0b12c0f0551202ae4dcfc1a4364e090f461cc3d21616d45bfc49537
-size 23212767
diff --git a/create-tarball.sh b/create-tarball.sh
new file mode 100644
index 0000000..8033931
--- /dev/null
+++ b/create-tarball.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e -x
+test $# -eq 1
+test ! -d guice
+git clone git://github.com/google/guice.git
+cd ./guice
+git checkout ${1}
+git branch unbundled-${1}
+git checkout unbundled-${1}
+rm -rf $(ls . | grep -E -v 'core|extensions|pom|bom|jdk8-tests|COPYING|common.xml|build.xml|build.properties|lib')
+find . -name "*.jar" -and ! -name munge.jar -delete
+find . -name "*.class" -delete
+find lib -type f -and ! -name munge.jar -delete
+git commit -a -m "Remove unneeded stuff"
+git tag unbundled-${1}
+git archive --format=tar --prefix=google-guice-${1}/ unbundled-${1} \
+ | xz >../google-guice-${1}.tar.xz
diff --git a/google-guice-4.1.tar.xz b/google-guice-4.1.tar.xz
new file mode 100644
index 0000000..e121199
--- /dev/null
+++ b/google-guice-4.1.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad9a303c0b69065b67fc4295b9f4acfdde49920f2886cdb2823153d7b59edab0
+size 383200
diff --git a/google-guice.spec b/google-guice.spec
index d23881a..516dd3d 100644
--- a/google-guice.spec
+++ b/google-guice.spec
@@ -1,5 +1,5 @@
#
-# spec file for package google-guice
+# spec file for package google
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
@@ -17,7 +17,6 @@
%global short_name guice
-
Name: google-%{short_name}
Version: 4.1
Release: 0
@@ -25,13 +24,12 @@ Summary: 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
+# ./create-tarball.sh %%{version}
+Source0: %{name}-%{version}.tar.xz
+Source1: create-tarball.sh
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
@@ -47,6 +45,7 @@ BuildRequires: objectweb-asm
BuildRequires: slf4j
BuildRequires: xmvn-install
BuildRequires: xmvn-resolve
+BuildArch: noarch
%description
Guice alleviates the need for factories and the use of "new" in Java
@@ -152,9 +151,8 @@ Group: Documentation/HTML
%description javadoc
This package provides %{summary}.
-
%prep
-%setup -q -n %{short_name}-%{version}
+%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
@@ -207,39 +205,41 @@ find . -name "*.class" -delete
%pom_xpath_remove "pom:optional" core
%build
-%mvn_alias "com.google.inject.extensions:" "org.sonatype.sisu.inject:"
+%{mvn_alias} "com.google.inject.extensions:" "org.sonatype.sisu.inject:"
-%mvn_package :::no_aop: guice
-%mvn_package :{*} @1
+%{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"
+%{mvn_file} ":guice-{*}" %{short_name}/guice-@1
+%{mvn_file} ":guice" %{short_name}/%{name} %{name}
+%{mvn_alias} ":guice" "org.sonatype.sisu:sisu-guice"
+mkdir -p lib/build
+mkdir -p extensions/servlet/lib/build
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
+%{ant} clean.all no_aop
pushd build/no_aop
%pom_xpath_inject "pom:project" "no_aop" core
-%ant -Dversion=%{version} jar
+%{ant} -Dversion=%{version} jar
popd
-%ant -Dversion=%{version} dist javadoc
+%{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
+%{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
+%{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
@@ -249,27 +249,35 @@ perl -pi -e 's#guice#guice