File yabs.spec of Package yabs

# openSUSE BUILD service build build script
# spec file for package YaBS - Yet another Business software
#
# Copyright (c) lumnis@googlemail.com 
#
# 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/
#

%define relVers beta7

Name:           yabs 
Summary:        Business Crossplatform Billing and Accounting Application
Version:        1.18
Release:        1 
Group:          Productivity/Office/Management 
License:        GPL
Url:            http://openyabs.org
Requires:       java >= 1.6.0
Requires:       jdom
Requires:       expect
#Requires:       appframework, derby, jcalendar, looks, microba, mysql-connector-java
#Requires:       swing-layout, swing-worker
#obs unavailable Requires: dtdparser
BuildRequires:  unzip
BuildRequires:  update-alternatives
%if %suse_version < 1100
BuildRequires:  java-1_6_0-sun-devel
%else
BuildRequires:  java-devel
%endif
BuildRequires:  ant >= 1.7.1
BuildRequires:  ant-nodeps 
BuildRequires:  update-desktop-files
BuildRequires:  jdom
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        Yabs-%{version}-%{relVers}-src.zip
Source1:        Yabs-1.175.1-languages.zip
Source2:        Yabs-1.175.1-templates.zip
Source3:	%{name}.desktop
BuildArch:      noarch


%description

Yabs Billing and Accounting Application

The multi-user, multi language, cross platform, scalable and
extendible accounting solution for small business needs.

* manage contacts, products, invoices, quotes and orders
* export your data to PDF- or ODF-documents (OpenOffice-format)
* use fully customizable ODT templates
* work on Windows, Linux, Solaris or Mac OSX
* use local database or public database servers
* define users and user roles
* synchronize your web shops with Yabs
* add your own functionality to Yabs via plugins

Get help and informations on http://www.openyabs.org

Authors
------------
    Andreas Weber <senior [dot] weber [at] googlemail [dot] com>

%package languages
Summary:        YaBS additional language files
License:        GPL
Requires:       yabs
Group:          Productivity/Office/Management

%description languages
This package provides documentation to the scala programming language.



%package templates
Summary:        YaBS additional template files
License:        GPL
Requires:       yabs
Group:          Productivity/Office/Management

%description templates
This will install some scala examples.


%prep
# nothing to do

#%setup -c "%{name}-%{version}"
%setup -n Yabs-%{version}-%{relVers}-src
#%setup -n Yabs-%{version}-src -D -T -a 1
#%setup -n Yabs-%{version}-src -D -T -a 2

%build

# Start building with ant
#%ant package-for-store
%ant jar

%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
install -d -m 755 %{buildroot}%{_datadir}/%{name}
install -m 755 target/dist/*.jar %{buildroot}%{_datadir}/%{name}/
install -d -m 755 %{buildroot}%{_datadir}/%{name}/lib
install -m 755 target/dist/lib/*.jar %{buildroot}%{_datadir}/%{name}/lib/

# Additional language files directory
install -d -m 755 %{buildroot}%{_datadir}/%{name}/languages
install -m 755 languages/* %{buildroot}%{_datadir}/%{name}/languages/

# Templates
install -d -m 755 %{buildroot}%{_datadir}/%{name}/templates
install -m 755 templates/* %{buildroot}%{_datadir}/%{name}/templates/

# Plugins directory
install -d -m 755 %{buildroot}%{_datadir}/%{name}/plugins


# startscript
cat > %{name} << 'EOF'
#!/bin/sh
#  
# yabs startscript
# 
# Source functions library
echo "Starting %{name} version %{version} ..."

java -jar %{_datadir}/%{name}/%{name}.jar \${@}

EOF

install -d -m 755 %{buildroot}%{_bindir}
install -m 755 %{name} %{buildroot}%{_bindir}/

# Icon
install -D -p -m 644 src/mpv5/resources/images/icon.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

# Desktop menu entry
install -d -m 755 %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file %{name}

%files
%defattr(-,root,root)
%{_bindir}/*
%{_datadir}/%{name}
%{_datadir}/%{name}/*.jar
%{_datadir}/%{name}/lib/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%doc license.txt 

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

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

%changelog
openSUSE Build Service is sponsored by