diff --git a/packaging/rpm/SPECS/service-desk-config_inc_local b/packaging/rpm/SPECS/service-desk-config_inc_local new file mode 100644 index 00000000..9268f0c2 --- /dev/null +++ b/packaging/rpm/SPECS/service-desk-config_inc_local @@ -0,0 +1,36 @@ + diff --git a/packaging/rpm/SPECS/service-desk-vendor_autoload b/packaging/rpm/SPECS/service-desk-vendor_autoload new file mode 100644 index 00000000..ae89546a --- /dev/null +++ b/packaging/rpm/SPECS/service-desk-vendor_autoload @@ -0,0 +1,7 @@ + diff --git a/packaging/rpm/SPECS/service-desk.spec b/packaging/rpm/SPECS/service-desk.spec index 57abbe9b..5e09644e 100755 --- a/packaging/rpm/SPECS/service-desk.spec +++ b/packaging/rpm/SPECS/service-desk.spec @@ -10,119 +10,132 @@ # Copyright (C) 2020 LTB-project #================================================= -#================================================= -# Variables -#================================================= -%define sd_name service-desk -%define sd_realname ltb-project-%{name} -%define sd_version 0.5.1 -%define sd_destdir /usr/share/%{name} -%define sd_cachedir /var/cache/%{name} +%global sd_destdir %{_datadir}/%{name} +%global sd_cachedir %{_localstatedir}/cache/%{name} + +Name: service-desk +Version: 0.5.1 +Release: 1%{?dist} +Summary: LDAP Tool Box Service Desk web interface +URL: https://github.com/ltb-project/service-desk +License: GPL-3.0-only -#================================================= -# Header -#================================================= -Summary: LDAP Tool Box Service Desk web interface -Name: %{sd_name} -Version: %{sd_version} -Release: 1%{?dist} -License: GPL BuildArch: noarch -Group: Applications/Web -URL: https://ltb-project.org +Source0: https://github.com/ltb-project/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +Source1: service-desk-apache.conf +Source2: service-desk-vendor_autoload +Source3: service-desk-config_inc_local -Source: %{sd_realname}-%{sd_version}.tar.gz -Source1: service-desk-apache.conf -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +%{?fedora:BuildRequires: phpunit9} +Requires(pre): httpd +Requires: coreutils +Requires: php(language) >= 5.6 +Requires: php-ldap +Requires: php-Smarty +Requires: php-ltb-project-ldap +Requires: php-phpmailer6 + +Provides: bundled(js-bootstrap) = 3.4.1 +Provides: bundled(js-datatables) = 1.10.16 +Provides: bundled(js-jquery) = 1.10.2 +Provides: bundled(fontawesome-fonts) = 4.7.0 -Requires(pre,preun): coreutils -Requires: php, php-ldap %description -Service Desk is a PHP application that allows administrators to check, unlock and reset user passwords in an LDAP directory. +Service Desk is a PHP application that allows administrators to check, unlock +and reset user passwords in an LDAP directory. Service Desk is provided by LDAP Tool Box project: https://ltb-project.org -#================================================= -# Source preparation -#================================================= + %prep -%setup -n %{sd_realname}-%{sd_version} +%setup -q -#================================================= -# Installation -#================================================= -%install -rm -rf %{buildroot} +%install # Create directories mkdir -p %{buildroot}/%{sd_destdir} -mkdir -p %{buildroot}/%{sd_cachedir}/cache mkdir -p %{buildroot}/%{sd_destdir}/conf mkdir -p %{buildroot}/%{sd_destdir}/htdocs mkdir -p %{buildroot}/%{sd_destdir}/lang mkdir -p %{buildroot}/%{sd_destdir}/lib mkdir -p %{buildroot}/%{sd_destdir}/templates -mkdir -p %{buildroot}/%{sd_cachedir}/templates_c mkdir -p %{buildroot}/%{sd_destdir}/vendor -mkdir -p %{buildroot}/etc/httpd/conf.d +mkdir -p %{buildroot}/%{sd_cachedir}/cache +mkdir -p %{buildroot}/%{sd_cachedir}/templates_c # Copy files ## Program -install -m 644 conf/* %{buildroot}/%{sd_destdir}/conf -install -m 644 htdocs/*.php %{buildroot}/%{sd_destdir}/htdocs -cp -a htdocs/css %{buildroot}/%{sd_destdir}/htdocs -cp -a htdocs/images %{buildroot}/%{sd_destdir}/htdocs -cp -a htdocs/vendor %{buildroot}/%{sd_destdir}/htdocs -install -m 644 lang/* %{buildroot}/%{sd_destdir}/lang -install -m 644 lib/* %{buildroot}/%{sd_destdir}/lib -install -m 644 templates/* %{buildroot}/%{sd_destdir}/templates -cp -a vendor/* %{buildroot}/%{sd_destdir}/vendor +install -p -m 644 htdocs/*.php %{buildroot}/%{sd_destdir}/htdocs +cp -a htdocs/css %{buildroot}/%{sd_destdir}/htdocs +cp -a htdocs/images %{buildroot}/%{sd_destdir}/htdocs +cp -a htdocs/vendor %{buildroot}/%{sd_destdir}/htdocs +install -p -m 644 lang/* %{buildroot}/%{sd_destdir}/lang +install -p -m 644 lib/* %{buildroot}/%{sd_destdir}/lib +install -p -m 644 templates/* %{buildroot}/%{sd_destdir}/templates + +install -p -m 0644 %{SOURCE2} \ + %{buildroot}%{_datadir}/%{name}/vendor/autoload.php + ## Apache configuration -install -m 644 %{SOURCE1} %{buildroot}/etc/httpd/conf.d/service-desk.conf +mkdir -p %{buildroot}/%{_sysconfdir}/httpd/conf.d +install -m 644 %{SOURCE1} \ + %{buildroot}/%{_sysconfdir}/httpd/conf.d/service-desk.conf # Adapt Smarty paths -sed -i 's:/usr/share/php/smarty3:/usr/share/php/Smarty:' %{buildroot}%{sd_destdir}/conf/config.inc.php -sed -i 's:^#$smarty_cache_dir.*:$smarty_cache_dir = "'%{sd_cachedir}/cache'";:' %{buildroot}%{sd_destdir}/conf/config.inc.php -sed -i 's:^#$smarty_compile_dir.*:$smarty_compile_dir = "'%{sd_cachedir}/templates_c'";:' %{buildroot}%{sd_destdir}/conf/config.inc.php +sed -i \ + -e 's:/usr/share/php/smarty3:/usr/share/php/Smarty:' \ + -e 's:^#$smarty_cache_dir.*:$smarty_cache_dir = "'%{sd_cachedir}/cache'";:' \ + -e 's:^#$smarty_compile_dir.*:$smarty_compile_dir = "'%{sd_cachedir}/templates_c'";:' \ + conf/config.inc.php -%post -#================================================= -# Post Installation -#================================================= +# Move conf file to %%_sysconfdir +mkdir -p %{buildroot}/%{_sysconfdir}/%{name} +install -p -m 644 conf/config.inc.php \ + %{buildroot}/%{_sysconfdir}/%{name}/ +ln -s %{_sysconfdir}/%{name}/config.inc.php \ + %{buildroot}%{sd_destdir}/conf/config.inc.php +install -p -m 644 %{SOURCE3} \ + %{buildroot}/%{_sysconfdir}/%{name}/config.inc.local.php -# Change owner -/bin/chown apache:apache %{sd_cachedir}/cache -/bin/chown apache:apache %{sd_cachedir}/templates_c -#================================================= -# Cleaning -#================================================= -%clean -rm -rf %{buildroot} +%check +%{?fedora:phpunit9 --verbose --testdox --do-not-cache-result tests} + + +%post +if [ -f "%{sd_destdir}/conf/config.inc.php" ]; then + mv %{sd_destdir}/conf/config.inc.php %{_sysconfdir}/%{name}/config.inc.php +fi +# Move configuration override too +if [ -f "%{sd_destdir}/conf/config.inc.local.php" ]; then + mv %{sd_destdir}/conf/config.inc.local.php \ + %{_sysconfdir}/%{name}/config.inc.local.php +fi + -#================================================= -# Files -#================================================= %files -%defattr(-, root, root, 0755) -%config(noreplace) %{sd_destdir}/conf/config.inc.php -%config(noreplace) /etc/httpd/conf.d/service-desk.conf +%license LICENSE +%doc AUTHORS README.md +%config(noreplace) %{_sysconfdir}/%{name}/config.inc.php +%config(noreplace) %{_sysconfdir}/%{name}/config.inc.local.php +%config(noreplace) %{_sysconfdir}/httpd/conf.d/service-desk.conf %{sd_destdir} -%{sd_cachedir} +%dir %{sd_cachedir} +%attr(-,apache,apache) %{sd_cachedir}/cache +%attr(-,apache,apache) %{sd_cachedir}/templates_c + -#================================================= -# Changelog -#================================================= %changelog -* Wed May 17 2023 - Clement Oudot - 0.5.1-1 +* Wed May 17 2023 Clement Oudot - 0.5.1-1 - gh#92: Message override broken in 0.5 - gh#94: Missing replacement for lang value (issue #92) - gh#95: Some documentation improvements - gh#96: Add source IP in audit - gh#98: Add IP in audit - gh#99: Provide result codes for lock/unlock account actions -* Mon Apr 24 2023 - Clement Oudot - 0.5-1 + +* Mon Apr 24 2023 Clement Oudot - 0.5-1 - gh#45: Do not enable lockout feature if no ppolicy associated to account or ppolicy has pwdLockout value to FALSE - gh#47: Don't lock account until a valid ppolicy with pwdLockout=TRUE is associated (#45) - gh#49: Timestamp value displayer @@ -152,7 +165,8 @@ rm -rf %{buildroot} - gh#88: Force line break - gh#89: Address displayer - gh#90: Prehook feature -* Mon May 17 2021 - Clement Oudot - 0.4-1 + +* Mon May 17 2021 Clement Oudot - 0.4-1 - gh#19: Display expiration date - gh#20: fix(undefined) - gh#22: Configure cache dir and template cache dir @@ -167,16 +181,20 @@ rm -rf %{buildroot} - gh#40: Dashboard will expire passwords - gh#42: Dashboard idle accounts - gh#44: Multi tenancy -* Mon Jun 29 2020 - Clement Oudot - 0.3-1 + +* Mon Jun 29 2020 Clement Oudot - 0.3-1 - Bug #15: Handle the case where pwdAccountLockedTime is set but pwdLockoutDuration is not set or is equal to 0 - Feature #16: Possibility to lock an account - Feature #17: Allow the Smarty path to be set in conf.inc.local.php -* Tue May 19 2020 - Clement Oudot - 0.2-2 + +* Tue May 19 2020 Clement Oudot - 0.2-2 - Bug #13: Syntax error in resetpassword.php -* Fri May 15 2020 - Clement Oudot - 0.2-1 + +* Fri May 15 2020 Clement Oudot - 0.2-1 - Bug #5: Password is marked as expired if policy do not set pwdMaxAge - Bug #7: The pwdReset radio button is not checked by default - Feature #9: PostHook - Feature #10: Viewer for quota attributes -* Mon Mar 30 2020 - Clement Oudot - 0.1-1 + +* Mon Mar 30 2020 Clement Oudot - 0.1-1 - First release