File froxlor.spec of Package froxlor

#
# spec file for package froxlor
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, 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 via http://bugs.opensuse.org/
#


%define apache_serverroot %(%{_sbindir}/apxs2 -q DATADIR)
%define apache_sysconfdir %(%{_sbindir}/apxs2 -q SYSCONFDIR)
Name:           froxlor
Version:        0.10.38.3
Release:        0
Summary:        Froxlor Server Management Panel a php web-based administration software
License:        GPL-2.0+
Group:          Productivity/Networking/Web/Utilities
Url:            http://www.froxlor.org/
Source0:        https://files.froxlor.org/releases/froxlor-%{version}.tar.gz
Source2:        froxlor-httpd.conf
Source3:        froxlor.cron
Source4:        froxlor.logrotate
Source5:        leap15.xml
Patch0:         froxlor-suse-config.diff
PreReq:         permissions
BuildRequires:  apache2-devel
BuildRequires:  bind
BuildRequires:  fdupes
# Hard requirements
Requires:       apache2
Requires:       apache2-mod_php7
Requires:       cron
Requires:       logrotate
Requires:       php7-bcmath
Requires:       php7-curl
Requires:       php7-mbstring
Requires:       php7-mysql
Requires:       php7-openssl
Requires:       php7-pdo
Requires:       php7-posix
Requires:       php7-zip
Recommends:     mysql
Recommends:     pdns
Recommends:     proftpd-mysql
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
A Server Management Panel is a php web-based administration software.
Developed by experienced server administrators and based on the system control panel SysCP
with main focus on simplicity and usability.

Froxlor can help you set up and manage a lot of system-services, like web-, mail- and ftpserver
and it also brings some nice features such as a complete support-ticket system and an implementation
of the Application Packaging Standard.

%prep
%setup -q -n %{name}
%patch0 -p1

%build

%install
idir=%{buildroot}/srv/www/%{name}
mkdir -p $idir
cp -aRf * $idir
touch $idir/lib/userdata.inc.php
rm -f $idir/COPYING
# apache config
mkdir -p %{buildroot}%{apache_sysconfdir}/conf.d/
cp %{SOURCE2} %{buildroot}%{apache_sysconfdir}/conf.d/froxlor.conf
# bind
mkdir -p %{buildroot}%{_sysconfdir}/named.d/
touch %{buildroot}%{_sysconfdir}/named.d/froxlor_bind.conf
# cron
mkdir -p %{buildroot}%{_sysconfdir}/cron.d/
cp %{S:3} %{buildroot}%{_sysconfdir}/cron.d/froxlor
# logrotate
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
cp %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/froxlor
# openSUSE config template
cp %{S:5} $idir/lib/configfiles/

%fdupes %{buildroot}%{_datadir}/%{name}
%fdupes %{buildroot}/srv/www/%{name}

%post
%set_permissions /etc/cron.d

%verifyscript
%verify_permissions -e /etc/cron.d

%files
%defattr(-,root,root)
%attr(0755, wwwrun, root) %dir /srv/www/%{name}/lib
/srv/www/%{name}/
%config %{apache_sysconfdir}/conf.d/*
%doc COPYING
%ghost %config(noreplace) /srv/www/%{name}/lib/userdata.inc.php
%config %{_sysconfdir}/named.d/froxlor_bind.conf
%dir %{_sysconfdir}/cron.d/
%config %{_sysconfdir}/cron.d/froxlor
%config %{_sysconfdir}/logrotate.d/froxlor

%changelog
openSUSE Build Service is sponsored by