File benno-archive.spec of Package benno-archive

#
# spec file for package benno-archive
#
# Copyright (c) 2012,2013,2017,2018 FSP Computer & Netzwerke, Schotten, 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 to stefan.schaefer@fsproductions.de
#

# norootforbuild

Name:         benno-archive
Version:      2.10.0
Release:      1
Group:        Productivity/Networking/Email/Servers
Summary:      Email Archive - Benno MailArchiv Archieving Application
License:      AGPL-3.0
Autoreqprov:  on
URL:          http://www.benno-mailarchiv.de
Source:       %{name}-%{version}.tar.bz2
BuildRoot:    %{_tmppath}/%{name}-%{version}-build
PreReq:       /usr/sbin/useradd
BuildRequires: systemd benno-core
Requires:     java >= 1.7.0 benno-lib benno-core log4j
%if 0%{?suse_version} >= 1315 
Requires: benno-systemd-global
%endif

#BuildArch:    noarch
Source1:      README.SUSE
Source2:      benno-archive.init
Source3:	  benno-archive-service.conf
Source4:	  benno-archive-fsp.service

Patch1:		  etc-default.patch

%description
 Benno MailArchiv Archieving Application

Using Benno MailArchiv is not free of charge. It is possible to get a
30 day evaluation license for testing.

For further information about licensing have a look at:
http://www.benno-mailarchiv.de or 
http://www.fsproductions.de (Benno MailArchiv Partner)

Authors:
--------
    Martin Werthmoeller <mw@lw-systems.de>
    Stefan Schaefer <stefan.schaefer@fsproductions.de>

%prep
%setup -n %{name}-%{version}
%patch1 -p1

%build


%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
mkdir -p %{buildroot}
rm -rf install
mv * %{buildroot}
mkdir -p %{buildroot}/srv/benno/archive
mkdir -p %{buildroot}/srv/benno/inbox
mkdir %{buildroot}%{_defaultdocdir}
mv %{buildroot}/usr/share/doc/%{name} %{buildroot}/%{_defaultdocdir}
%{__cp} %{S:1} %{buildroot}%{_defaultdocdir}/%{name}/README.SUSE
%if 0%{?suse_version} >= 1315 
%{__cp} %{S:3} %{buildroot}%{_sysconfdir}/benno/
mkdir -p %{buildroot}%{_unitdir}
%{__cp} %{S:4} %{buildroot}%{_unitdir}
mv %{buildroot}/lib/systemd/system/benno-archive.service %{buildroot}%{_unitdir}
rm -f %{buildroot}%{_sysconfdir}/init.d/%{name}
mkdir %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rc%{name}
%else
%{__cp} %{S:2} %{buildroot}%{_sysconfdir}/init.d/%{name}
mkdir %{buildroot}%{_sbindir}
ln -sf ../../etc/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%endif
rm -f %{buildroot}%{_sysconfdir}/default/benno-archive.orig

%pre
#%{USRADDBENNO}
%if 0%{?suse_version} >= 1315 
%service_add_pre %{name}.service
%endif

%post
%if 0%{?suse_version} >= 1315 
%service_add_post %{name}.service
%endif

%preun
%if 0%{?suse_version} >= 1315 
%service_del_preun %{name}.service
%endif
%stop_on_removal %{name}

%postun 
%restart_on_update %{name}
%if 0%{?suse_version} >= 1315 
%service_del_postun %{name}.service
%else
%insserv_cleanup %{name}
%endif

%files
%defattr(-,root,root)
%dir %doc %{_defaultdocdir}/%{name}
%doc %{_defaultdocdir}/%{name}/*
%config %{_sysconfdir}/benno/archive-log4j.xml
%config(noreplace) %{_sysconfdir}/default/%{name}
%dir /opt/benno/sbin

%if 0%{?suse_version} >= 1315 
%config(noreplace) %{_sysconfdir}/benno/%{name}-service.conf
%attr(644,root,root) %{_unitdir}/%{name}-fsp.service
%attr(644,root,root) %{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%else
%attr(0750,root,root) %{_sysconfdir}/init.d/%{name}
%attr(0644,root,root) %{_sbindir}/rc%{name}
%endif
%attr(0644,root,root) /opt/benno/bennoarchive.jar
%attr(0750,benno,root) /opt/benno/sbin/benno-mgmt
%attr(0755,benno,benno) /srv/benno
%attr(0750,benno,benno) /srv/benno/archive
%attr(0775,benno,benno) /srv/benno/inbox
%changelog
openSUSE Build Service is sponsored by