File lightcouch.spec of Package lightcouch

#
# spec file for package lightcouch
#
# Copyright (c) 2014 Peter Conrad <obs@quisquis.de>
#
# 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:		lightcouch
Version:	0.0.6
Release:	1
License:	Apache-2.0
Summary:	CouchDB Java API
Url:		http://www.lightcouch.org/
Group:		Development/Libraries/Java
Source:		https://github.com/lightcouch/LightCouch/archive/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM: conrad@quisquis.de
Patch:		no-uee.patch
BuildRequires:	java-devel google-gson apache-httpcomponents-client
BuildRequires:	apache-commons-codec apache-commons-logging
Requires:	google-gson apache-httpcomponents-client
Requires:	apache-commons-codec apache-commons-logging
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
BuildArch:	noarch
%if 0%{?fedora} > 0
BuildRequires:	java-1.5.0-gcj-devel
%endif

%description
LightCouch aims at providing a simple and easy-to-use APIs for accessing
CouchDB databases.

It offers a powerful and lightweight persistence interface with minimal
code base and dependency.

%package javadoc
Summary:	Javadoc for %name
Group:		Development/Libraries/Java

%description javadoc
This package contains the documentation for %{name}.

%prep
%setup -q -n LightCouch-%{name}-%{version}
%patch -p0

%build
CP="$(build-classpath google-gson commons-logging commons-codec httpcore httpclient)"
%__mkdir_p build/classes
find src/main/java -name \*.java | \
  xargs javac -g -d build/classes -cp "$CP" -source 1.5 -target 1.5
jar cf "%{name}.jar" -C build/classes .
%__mkdir_p build/doc
javadoc -d build/doc -sourcepath src/main/java -classpath "$CP:%{name}.jar" \
	-subpackages org.lightcouch

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

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

%files
%defattr(-,root,root,-)
%doc LICENSE README.md
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar

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

%changelog
openSUSE Build Service is sponsored by