File osgi-core.spec of Package osgi-core

#
# spec file for package osgi-core
#
# Copyright (c) 2013 Peter Conrad
#
# 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 http://bugs.opensuse.org/
#

Name:		osgi-core
Version:	4.2
Release:	1
License:	Apache-2.0
Summary:	OSGi core API specification
Url:		http://www.osgi.org/
Group:		Development/Libraries/Java
Source:		org.osgi.core-811885.tar.bz2
BuildRequires:	java-devel
%if 0%{?fedora} > 0
BuildRequires:	java-1.5.0-gcj-devel
%endif
%if 0%{?suse_version} > 1300
BuildRequires: javapackages-tools
%endif
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%description
The Apache Felix OSGi Core sub-project simply repackages the
standard OSGi core API packages provided by the OSGi Alliance into a
Maven module.

%package javadoc
Summary:	API documentation of OSGi core API
Group:		Development/Libraries/Java

%description javadoc
This package contains the API documentation of the OSGi core.

%prep
%setup -q -n org.osgi.core-811885

%build
FILES="`find src -name \*.java`"

%__mkdir_p build/classes
javac -encoding UTF-8 -d build/classes -source 1.5 -target 1.5 -g $FILES
jar cf build/osgi-core.jar -C build/classes .

%__mkdir_p build/doc
javadoc -encoding UTF-8 -d build/doc -sourcepath src/main/java -classpath build/classes $FILES

%install
%__install -dm 755 "%{buildroot}%{_javadir}"
%__install -m 0644 build/osgi-core.jar "%{buildroot}%{_javadir}/osgi-core-%{version}.jar"
%__ln_s "osgi-core-%{version}.jar" "%{buildroot}%{_javadir}/osgi-core.jar"

%__install -dm 755 "%{buildroot}/%{_javadocdir}/osgi-core-%{version}"
cp -pr build/doc "%{buildroot}/%{_javadocdir}/osgi-core-%{version}/"

%files
%defattr(-,root,root,-)
%doc LICENSE NOTICE doc/apache-felix-osgi-core.html doc/changelog.txt
%{_javadir}/osgi-core-%{version}.jar
%{_javadir}/osgi-core.jar

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/osgi-core-%{version}/

%changelog
openSUSE Build Service is sponsored by