File websiteatschool.spec of Package websiteatschool

#
# spec file for package websiteatschool
#
# Copyright (c) 2017 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_libexecdir	%(%{apxs} -q LIBEXECDIR)
%define	apache_sysconfdir	%(%{apxs} -q SYSCONFDIR)
#
%define websiteatschool_dir /srv/www/websiteatschool
#
%if 0%{?suse_version}
%define apxs    %{_sbindir}/apxs2
%else
%define apxs    %{_sbindir}/apxs
%endif
Name:           websiteatschool
Version:        1.0.0
Release:        0
Summary:        CMS to manage and maintain the website of a primary school
License:        GPL-2.0+
Group:          Productivity/Publishing/HTML/Tools
URL:            http://websiteatschool.eu/
Source0:        %{name}-%{version}.tar.bz2
Source1:        %{name}.conf.default
Source2:        %{name}.conf.vhost
Source3:        %{name}.conf.nonsuse
BuildRequires:  dos2unix
Requires:       mysql
Requires:       php >= 4.2.0
Requires:       php5-mysql
BuildArch:      noarch
%if 0%{?suse_version}
BuildRequires:  apache2-devel
BuildRequires:  fdupes
Requires:       ImageMagick
Requires:       apache2
Requires:       apache2-mod_php5
%endif
%if 0%{?fedora_version} ||  0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  httpd-devel
Requires:       ImageMagick
Requires:       httpd
Requires:       httpd-mod_php5
%endif
%if 0%{?mandriva_version}
BuildRequires:  apache-devel
Requires:       apache-base
Requires:       apache-conf
Requires:       apache-mod_php
Requires:       imagemagick
%endif
#

%description
Site@School is a Content Management System (CMS) to manage and maintain the
website of a primary school. REMARK: As this code hasn't been changed for quite
some time it might contain exploitable code!

%prep
%setup -q -c
find . -type f -exec file {} \; | grep "text"  | sed 's/:.*$//' | xargs dos2unix

%build

%install
%if 0%{?suse_version}
mkdir -p %{buildroot}/%{apache_sysconfdir}/conf.d
cp -avL %{SOURCE1} %{buildroot}/%{apache_sysconfdir}/conf.d/websiteatschool.conf
mkdir -p %{buildroot}/%{apache_sysconfdir}/vhosts.d/conf.d
cp -avL %{SOURCE2} %{buildroot}/%{apache_sysconfdir}/vhosts.d/conf.d/websiteatschool.conf
%else
mkdir -p %{buildroot}/%{apache_sysconfdir}/../conf.d
cp -avL %{SOURCE3} %{buildroot}/%{apache_sysconfdir}/../conf.d/websiteatschool.conf
%endif
mkdir -p %{buildroot}/%{websiteatschool_dir}
cp -avL * %{buildroot}/%{websiteatschool_dir}/
#
%if 0%{?suse_version}
%fdupes %{buildroot}
%endif
#
find %{buildroot}%{websiteatschool_dir} -type d | \
sed "s@%{buildroot}@%dir @" > files.websiteatschool
find %{buildroot}%{websiteatschool_dir} -type f | \
sed "s@%{buildroot}@@;" >> files.websiteatschool
cat files.websiteatschool
#

%files -f files.websiteatschool
%if 0%{?suse_version}
%dir %{apache_sysconfdir}/conf.d
%dir %{apache_sysconfdir}/vhosts.d/conf.d
%config(noreplace) %{apache_sysconfdir}/conf.d/websiteatschool.conf
%config(noreplace) %{apache_sysconfdir}/vhosts.d/conf.d/websiteatschool.conf
%else
%dir %{apache_sysconfdir}/../conf.d
%config(noreplace) %{apache_sysconfdir}/../conf.d/websiteatschool.conf
%endif
%attr(0755,root,root) %{websiteatschool_dir}/program/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl

%changelog
openSUSE Build Service is sponsored by