diff --git a/_service b/_service
new file mode 100644
index 0000000..14d0456
--- /dev/null
+++ b/_service
@@ -0,0 +1,14 @@
+
+
+ git
+ git://github.com/cdi-spec/cdi
+ 1.2
+ 1.2
+ api
+
+
+ *.tar
+ xz
+
+
+
diff --git a/cdi-1.2.tar.xz b/cdi-1.2.tar.xz
new file mode 100644
index 0000000..4aeffec
--- /dev/null
+++ b/cdi-1.2.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f38b66047deaf0f79004f41b68be1dbbe2061d8e94a42401b93f9c911484f14f
+size 46560
diff --git a/cdi-api-1.2.tar.xz b/cdi-api-1.2.tar.xz
deleted file mode 100644
index f15e520..0000000
--- a/cdi-api-1.2.tar.xz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e2a400ceeade6f10cfcd857b638b8466821a9e86ba4ee1fd6885b586b22afda3
-size 46600
diff --git a/cdi-api.changes b/cdi-api.changes
index 9efed0f..522566b 100644
--- a/cdi-api.changes
+++ b/cdi-api.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Sat Apr 6 22:29:10 UTC 2019 - Jan Engelhardt
+
+- Use _service instead of custom create-tarball.sh.
+- Avoid double-shipping license file.
+
-------------------------------------------------------------------
Wed Apr 3 10:59:32 UTC 2019 - Fridrich Strba
diff --git a/cdi-api.spec b/cdi-api.spec
index ef88a1e..b26676a 100644
--- a/cdi-api.spec
+++ b/cdi-api.spec
@@ -25,10 +25,9 @@ License: Apache-2.0
Group: Development/Libraries/Java
URL: http://seamframework.org/Weld
# sh create-tarball.sh %%{version}
-Source0: %{name}-%{version}.tar.xz
+Source0: cdi-%{version}.tar.xz
Source1: %{name}-build.xml
Source2: http://www.apache.org/licenses/LICENSE-2.0.txt
-Source3: create-tarball.sh
BuildRequires: ant
BuildRequires: atinject
BuildRequires: fdupes
@@ -51,7 +50,8 @@ Group: Documentation/HTML
This package contains the API documentation for %{name}.
%prep
-%setup -q
+%setup -qn cdi-%{version}
+pushd api/
cp %{SOURCE1} build.xml
cp %{SOURCE2} LICENSE
@@ -59,8 +59,10 @@ cp %{SOURCE2} LICENSE
%pom_change_dep "javax.interceptor:javax.interceptor-api" "org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.2_spec"
%pom_remove_parent
+popd
%build
+pushd api/
mkdir -p lib
build-jar-repository -s lib glassfish-el-api jboss-interceptors-1.2-api javax.inject
%{ant} \
@@ -68,8 +70,10 @@ build-jar-repository -s lib glassfish-el-api jboss-interceptors-1.2-api javax.in
-Dtest.skip=true \
%endif
jar javadoc
+popd
%install
+pushd api/
# jar
install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -dm 0755 %{buildroot}%{_javadir}/javax.enterprise.inject
@@ -82,14 +86,14 @@ install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/
+popd
%fdupes -s %{buildroot}%{_javadocdir}
-%files -f .mfiles
-%license LICENSE
+%files -f api/.mfiles
+%license api/LICENSE
%{_javadir}/javax.enterprise.inject
%files javadoc
-%license LICENSE
%{_javadocdir}/%{name}
%changelog
diff --git a/create-tarball.sh b/create-tarball.sh
deleted file mode 100644
index 363f018..0000000
--- a/create-tarball.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-set -e -x
-test $# -eq 1
-test ! -d cdi
-git clone git://github.com/cdi-spec/cdi.git
-cd ./cdi
-git checkout -b tag-${1} ${1}
-git archive --format=tar --prefix=cdi-api-${1}/ HEAD:api \
- | xz >../cdi-api-${1}.tar.xz