A new user interface for you! Read more...

File db4o.spec of Package db4o

#
# spec file for package db4o
#
# 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:		db4o
Version:	8.0
Release:	1
License:	GPL-2.0
Summary:	Object–Oriented Database
Url:		http://db4o.com/about/productinformation/db4o/
Group:		Development/Libraries/Java
Source:		http://www.db4o.com/downloads/db4o-%{version}-java.zip
BuildArch:	noarch
Requires:	ant osgi-core easymock
BuildRequires:	java-devel ant unzip osgi-core easymock jpackage-utils dos2unix
BuildRequires:	fdupes
%if 0%{?fedora} > 0
BuildRequires:	java-devel >= 1.6.0
%endif
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%description
db4o is the open source object-oriented database that enables Java and .NET
developers to store and retrieve any application object with only one line of
code, eliminating the need to predefine or maintain a separate, rigid data
model.

%package doc
Summary:	Tutorial and examples of db4o
Group:		Development/Libraries/Java

%description doc
This package contains a tutorial and example code for using the
db4o database engine.

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

%description javadoc
This package contains the API documentation of the db4o database.

%prep
%setup -q
find . -name \*.jar | xargs rm

%build
find doc/reference doc/tutorial -type f | xargs file | grep text.*CRLF | cut -d: -f 1 | xargs dos2unix -q
dos2unix -q *.html

pushd src
%__mv db4oj core
%__mv db4oj.optional optional
%__mv db4o.cs cs
%__mv db4o.cs.optional cs.optional
%__mv db4ounit unit
%__mv db4ounit.extensions unit.extensions
%__mv db4o.instrumentation instrumentation
%__mv db4onqopt nqopt
%__mv db4oj.tests tests
%__mv db4otaj taj
%__mv db4otools tools
%__mv db4o_osgi osgi
popd

CP="$(build-classpath ant.jar osgi-core.jar easymock.jar cglib.jar objenesis.jar)"
for i in core optional cs cs.optional bloat unit unit.extensions instrumentation nqopt tests taj tools osgi; do
  FILES="`find "src/$i" -name \*.java`"

  file $FILES | grep 'CR,' | cut -d: -f 1 | xargs dos2unix -c mac
  %__sed -i '/@decaf\./d' $FILES

  %__mkdir_p "build/classes/$i"
  javac -d "build/classes/$i" -g -source 1.5 -target 1.5 -cp "$CP" -encoding utf8 $FILES
  jar cf "build/$i.jar" -C "build/classes/$i" .
  CP="$CP:build/$i.jar"

  %__mkdir_p "build/doc/db4o-$i-%{version}"
  javadoc -classpath "$CP" -sourcepath "src/$i" -d "build/doc/db4o-$i-%{version}" -encoding utf8 $LINKS $FILES
  LINKS="$LINKS -link ../db4o-$i-%{version}"
done

%install
%__install -dm 755 "%{buildroot}%{_javadir}"
cd build
for i in *.jar; do
  %__install -m 0644 "$i" "%{buildroot}%{_javadir}/db4o-%{version}-${i%%.jar}-java5.jar"
  %__ln_s "db4o-%{version}-${i%%.jar}-java5.jar" "%{buildroot}%{_javadir}/db4o-$i"
done

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

%__install -dm 755 "%{buildroot}/%{_datadir}/doc/%{name}"
cp -pr ../doc/reference ../doc/tutorial "%{buildroot}/%{_datadir}/doc/%{name}/"

fdupes -q1r "%{buildroot}" | while read one rest; do for i in $rest; do ln -f "$one" "$i"; done; done

%files
%defattr(-,root,root,-)
%doc *.html
%{_javadir}/db4o-*.jar

%files doc
%defattr(-,root,root,-)
%{_datadir}/doc/%{name}/

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/db4o-*/

%changelog