atinject/atinject.spec

135 lines
4.0 KiB
RPMSpec

#
# spec file for package atinject
#
# Copyright (c) 2018 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 base_version 1
%global svn_version 20100611svn86
Name: atinject
Version: %{base_version}+%{svn_version}
Release: 0
Summary: Dependency injection specification for Java (JSR-330)
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://code.google.com/p/atinject/
# latest release doesn't generate javadocs and there is no source
# tarball with pom.xml or ant build file
#
# svn export -r86 http://atinject.googlecode.com/svn/trunk atinject-1
# rm -rf atinject-1/{lib,javadoc}/
# tar caf atinject-1.tar.xz atinject-1
Source0: %{name}-%{base_version}.tar.xz
# These manifests based on the ones shipped by eclipse.org
Source1: MANIFEST.MF
Source2: MANIFEST-TCK.MF
Source3: http://www.apache.org/licenses/LICENSE-2.0.txt
# Compile with source/target 6
Patch0: %{name}-target-6.patch
BuildRequires: fdupes
BuildRequires: java-devel > 1.6
BuildRequires: javapackages-local
BuildRequires: junit
BuildArch: noarch
%description
This package specifies a means for obtaining objects in such a way as
to maximize reusability, testability and maintainability compared to
traditional approaches such as constructors, factories, and service
locators (e.g., JNDI). This process, known as dependency injection, is
beneficial to most nontrivial applications.
%package tck
Summary: TCK for testing %{name} compatibility with JSR-330
Requires: %{name} = %{version}-%{release}
Requires: junit
%description tck
%{summary}.
%package javadoc
Summary: API documentation for %{name}
%description javadoc
API documentation for %{name}.
%prep
%setup -q -n %{name}-%{base_version}
cp %{SOURCE3} LICENSE
mkdir lib
build-jar-repository -p lib junit
%patch0 -p1
# Fix dep in TCK pom
sed -i -e 's/pom\.groupId/project.groupId/' tck-pom.xml
%build
set -e
alias rm=:
alias xargs=:
alias javadoc='javadoc -Xdoclint:none -source 6'
. ./build.sh
# Inject OSGi manifests required by Eclipse.
jar umf %{SOURCE1} build/dist/javax.inject.jar
jar umf %{SOURCE2} build/tck/dist/javax.inject-tck.jar
mv build/tck/javadoc build/javadoc/tck
%install
# jars
install -dm 755 %{buildroot}%{_javadir}/javax.inject
install -m 0644 build/dist/javax.inject.jar %{buildroot}%{_javadir}/%{name}.jar
(cd %{buildroot}%{_javadir} && ln -s %{name}.jar javax.inject/)
install -m 0644 build/tck/dist/javax.inject-tck.jar %{buildroot}%{_javadir}/%{name}-tck.jar
# poms
install -dm 755 %{buildroot}%{_mavenpomdir}
install -m 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
install -m 0644 tck-pom.xml %{buildroot}%{_mavenpomdir}/%{name}-tck.pom
%add_maven_depmap %{name}.pom %{name}.jar
%add_maven_depmap %{name}-tck.pom %{name}-tck.jar -f tck
# javadoc
install -dm 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/javadoc/* %{buildroot}%{_javadocdir}/%{name}/
%fdupes -s %{buildroot}%{_javadocdir}/%{name}/
%files
%license LICENSE
%{_javadir}/javax.inject
%{_javadir}/%{name}.jar
%{_mavenpomdir}/%{name}.pom
%if %{defined _maven_repository}
%{_mavendepmapfragdir}/%{name}
%else
%{_datadir}/maven-metadata/%{name}.xml*
%endif
%files tck
%{_javadir}/%{name}-tck.jar
%{_mavenpomdir}/%{name}-tck.pom
%if %{defined _maven_repository}
%{_mavendepmapfragdir}/%{name}-tck
%else
%{_datadir}/maven-metadata/%{name}-tck.xml*
%endif
%files javadoc
%{_javadocdir}/%{name}
%changelog