File ATutor.spec of Package ATutor
#
# spec file for package ATutor
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define apache_libexecdir %(%{apxs} -q LIBEXECDIR)
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)
%define ATutor_dir /srv/www/ATutor
%define ATutor_src_dir ATutor
%if 0%{?suse_version}
%define apxs %{_sbindir}/apxs2
%else
%define apxs %{_sbindir}/apxs
%endif
Name: ATutor
Version: 2.2.4
Release: 0
Summary: Open Source Web-based Learning Content Management System (LCMS)
License: GPL-2.0-or-later
Group: Productivity/Publishing/Other
URL: https://www.atutor.ca/atutor/
Source0: https://github.com/atutor/%{name}/releases/download/atutor_2_2_4/%{name}-%{version}.tar.gz
Source1: %{name}.conf.default
Source2: %{name}.conf.vhost
Source3: %{name}.conf.nonsuse
Requires: curl
Requires: mysql
Requires: php >= 4.3.0
Requires: php5-mysql
BuildArch: noarch
%if 0%{?suse_version}
BuildRequires: apache2-devel
BuildRequires: fastjar
BuildRequires: fdupes
Requires: apache2
Requires: apache2-mod_php5
%endif
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: httpd-devel
Requires: httpd
Requires: httpd-mod_php5
%endif
%if 0%{?mandriva_version}
BuildRequires: apache-devel
Requires: apache-base
Requires: apache-conf
Requires: apache-mod_php
%endif
%description
ATutor is an Open Source Web-based Learning Content Management System (LCMS) designed with accessibility and adaptability in mind. Administrators can install or update ATutor in minutes, develop custom themes to give ATutor a new look, and easily extend its functionality with feature modules. Educators can quickly assemble, package, and redistribute Web-based instructional content, easily import prepackaged content, and conduct their courses online. Students learn in an adaptive learning environment. Try the demo to experience ATutor's adaptability, and its flexibility for course designers.
%prep
%setup -q -n %{ATutor_src_dir}
%build
%install
%if 0%{?suse_version}
mkdir -p %{buildroot}/%{apache_sysconfdir}/conf.d
cp -avL %{SOURCE1} %{buildroot}/%{apache_sysconfdir}/conf.d/ATutor.conf
mkdir -p %{buildroot}/%{apache_sysconfdir}/vhosts.d/conf.d
cp -avL %{SOURCE2} %{buildroot}/%{apache_sysconfdir}/vhosts.d/conf.d/ATutor.conf
%else
mkdir -p %{buildroot}/%{apache_sysconfdir}/../conf.d
cp -avL %{SOURCE3} %{buildroot}/%{apache_sysconfdir}/../conf.d/ATutor.conf
%endif
mkdir -p %{buildroot}/%{ATutor_dir}
cp -avL * %{buildroot}/%{ATutor_dir}/
find %{buildroot} -name "*~" -exec rm {} \;
find %{buildroot} -name "*\.bak" -exec rm {} \;
find %{buildroot} -name ".editorconfig" -exec rm {} \;
find %{buildroot} -name ".gitignore" -exec rm {} \;
find %{buildroot} -name ".gitkeep" -exec rm {} \;
find %{buildroot} -name ".travis.yml" -exec rm {} \;
%if 0%{?suse_version}
%fdupes %{buildroot}%{ATutor_dir}
%endif
%files
%if 0%{?suse_version}
%dir %{apache_sysconfdir}/conf.d
%config (noreplace) %{apache_sysconfdir}/conf.d/ATutor.conf
%dir %{apache_sysconfdir}/vhosts.d
%dir %{apache_sysconfdir}/vhosts.d/conf.d
%config (noreplace) %{apache_sysconfdir}/vhosts.d/conf.d/ATutor.conf
%else
%dir %{apache_sysconfdir}/../conf.d
%config (noreplace) %{apache_sysconfdir}/../conf.d/ATutor.conf
%endif
%dir %{ATutor_dir}
%{ATutor_dir}/*
%changelog