[atinject/f22] Add OSGi manifest to tck jar

Mat Booth mbooth at fedoraproject.org
Wed Feb 18 18:06:17 UTC 2015


commit a68927fcb6dff91c1293c0bd58ddcbeed2b8033d
Author: Mat Booth <mat.booth at redhat.com>
Date:   Wed Feb 18 18:05:31 2015 +0000

    Add OSGi manifest to tck jar
    
    - Install with mvn_install

 .gitignore      |    2 +
 MANIFEST-TCK.MF |   12 +++++++++++
 MANIFEST.MF     |    4 +-
 atinject.spec   |   58 ++++++++++++++++++++++++++++++------------------------
 4 files changed, 48 insertions(+), 28 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b69c229..70b56d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 /atinject-1.tar.xz
 /LICENSE-2.0.txt
+/noarch
+/*.src.rpm
diff --git a/MANIFEST-TCK.MF b/MANIFEST-TCK.MF
new file mode 100644
index 0000000..bb864f2
--- /dev/null
+++ b/MANIFEST-TCK.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tck
+Bundle-SymbolicName: com.google.code.atinject.tck
+Bundle-Version: 1.0.0
+Bundle-Vendor: GOOGLE
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="3.8.2"
+Export-Package: org.atinject.tck,
+ org.atinject.tck.auto;x-internal:=true,
+ org.atinject.tck.auto.accessories;x-internal:=true
+Import-Package: javax.inject;version="1.0.0"
diff --git a/MANIFEST.MF b/MANIFEST.MF
index 51d54f5..ccfdaeb 100644
--- a/MANIFEST.MF
+++ b/MANIFEST.MF
@@ -1,10 +1,10 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: %bundleName
+Bundle-Name: Atinject Dependency Injection Annotations
 Bundle-SymbolicName: javax.inject
 Bundle-Version: 1.0.0.v20091030
 Bundle-ClassPath: .
-Bundle-Vendor: %bundleProvider
+Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
 Export-Package: javax.inject;version="1.0.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/atinject.spec b/atinject.spec
index fc4f3e7..ab1ea72 100644
--- a/atinject.spec
+++ b/atinject.spec
@@ -1,6 +1,6 @@
 Name:           atinject
 Version:        1
-Release:        17.20100611svn86%{?dist}
+Release:        18.20100611svn86%{?dist}
 Summary:        Dependency injection specification for Java (JSR-330)
 License:        ASL 2.0
 URL:            http://code.google.com/p/atinject/
@@ -13,15 +13,18 @@ BuildArch:      noarch
 # rm -rf atinject-1/{lib,javadoc}/
 # tar caf atinject-1.tar.xz atinject-1
 Source0:        %{name}-%{version}.tar.xz
+
+# These manifests based on the ones shipped by eclipse.org
 Source1:        MANIFEST.MF
-Source2:        http://www.apache.org/licenses/LICENSE-2.0.txt
+Source2:        MANIFEST-TCK.MF
+
+Source3:        http://www.apache.org/licenses/LICENSE-2.0.txt
 
 # Compile with source/target 1.5
 Patch0:         %{name}-target-1.5.patch
 
-BuildRequires:  java-devel
+BuildRequires:  javapackages-local
 BuildRequires:  junit
-Requires:       java-headless
 
 Provides:       javax.inject
 
@@ -48,55 +51,58 @@ Requires:       junit
 
 %prep
 %setup -q
-cp %{SOURCE2} LICENSE
+cp %{SOURCE3} LICENSE
 ln -s %{_javadir} lib
 
 %patch0 -p1
 
+# Fix dep in TCK pom
+sed -i -e 's/pom\.groupId/project.groupId/' tck-pom.xml
+
+# J2EE API symlinks
+%mvn_file :javax.inject atinject javax.inject/atinject
+
+# TCK sub-package
+%mvn_file :javax.inject-tck atinject-tck
+%mvn_package :javax.inject-tck tck
+
 %build
 set -e
 alias rm=:
 alias xargs=:
 . ./build.sh
 
-# Inject OSGi manifest required by Eclipse.
-jar umf %{SOURCE1} build/dist/*.jar
+# Inject OSGi manifests required by Eclipse.
+jar umf %{SOURCE1} build/dist/javax.inject.jar
+jar umf %{SOURCE2} build/tck/dist/javax.inject-tck.jar
 
-%install
-# Maven POMs
-install -d -m 755 %{buildroot}%{_mavenpomdir}
-install -p -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
-install -p -m 644 tck-pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}-tck.pom
-
-# JARs
-install -d -m 755 %{buildroot}%{_javadir}
-install -p -m 644 build/dist/*.jar %{buildroot}%{_javadir}/%{name}.jar
-install -p -m 644 build/tck/dist/*.jar %{buildroot}%{_javadir}/%{name}-tck.jar
+%mvn_artifact pom.xml build/dist/javax.inject.jar
+%mvn_artifact tck-pom.xml build/tck/dist/javax.inject-tck.jar
 
-# XMvn metadata
-%add_maven_depmap
-%add_maven_depmap JPP-%{name}-tck.pom %{name}-tck.jar -f tck
+%install
+%mvn_install
 
 # Javadocs
 install -d -m 755 %{buildroot}%{_javadocdir}/%{name}/tck
 cp -pr build/javadoc/* %{buildroot}%{_javadocdir}/%{name}
 cp -pr build/tck/javadoc/* %{buildroot}%{_javadocdir}/%{name}/tck
 
-# J2EE API symlinks
-install -d -m 755 %{buildroot}%{_javadir}/javax.inject/
-ln -sf ../%{name}.jar %{buildroot}%{_javadir}/javax.inject/
-
 %files -f .mfiles
 %doc LICENSE
-%{_javadir}/javax.inject
+%dir %{_javadir}/javax.inject
+%dir %{_mavenpomdir}/javax.inject
 
 %files tck -f .mfiles-tck
 
 %files javadoc
 %doc LICENSE
-%doc %{_javadocdir}/%{name}
+%{_javadocdir}/atinject
 
 %changelog
+* Wed Feb 18 2015 Mat Booth <mat.booth at redhat.com> - 1-18.20100611svn86
+- Add OSGi manifest to tck jar
+- Install with mvn_install
+
 * Mon Jun 09 2014 Michal Srb <msrb at redhat.com> - 1-17.20100611svn86
 - Apply the "source/target 1.5" patch
 


More information about the scm-commits mailing list