libreschool-startpage/libreschool-startpage.spec

76 lines
1.9 KiB
RPMSpec

Summary: Manage a start page for all clients
Name: libreschool-startpage
Version: 1.0.0
Release: 1
URL: https://git.libreschool.org/LibreSchool/libreschool-startpage
License: GPLv3+
Packager: Paolo Asperti <paolo@asperti.com>
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: nethserver-devtools > 1.0.1
BuildRequires: hunspell-en
Requires: httpd, sudo,
Requires: nethserver-base
Requires: python-jinja2
Requires: net-tools
Source0: %{name}-%{version}.tar.gz
Source1: createlinks.pl
BuildArch: noarch
%description
Manage a start page for all clients.
%prep
%setup -n %{name}-%{version}-%{release}
%build
%{makedocs}
perl createlinks.pl
%install
rm -Rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump %{buildroot})
rm -f %{name}-%{version}-%{release}-filelist
%{genfilelist} %{buildroot} > %{name}-%{version}-%{release}-filelist
%post
/etc/e-smith/events/actions/initialize-default-databases
if [ "$1" = 1 ]; then
#installation
/sbin/e-smith/db startpage set configuration configuration status enabled template default outfile /var/www/html/index.html
/sbin/e-smith/db startpage set link1 link enable yes imagelink "startpage/libreschool_logo.svg" link "https://community.libreschool.org/" title "Libreschool Community"
/sbin/e-smith/expand-template /etc/httpd/conf.d/startpage.conf
service httpd restart
/sbin/e-smith/signal-event startpage-refresh
fi
if [ "$1" = 2 ]; then
#upgrade
/sbin/e-smith/expand-template /etc/httpd/conf.d/startpage.conf
service httpd restart
/sbin/e-smith/signal-event startpage-refresh
fi
%postun
#if [ "$1" = 1 ]; then
#upgrade
#fi
if [ "$1" = 0 ]; then
#uninstallation
/sbin/e-smith/db configuration delete startpage
fi
%clean
rm -rf %{buildroot}
%files -f %{name}-%{version}-%{release}-filelist
%defattr(0644,root,root,755)
%doc README.md COPYING
%changelog
* Sun Mar 1 2020 Paolo Asperti <paolo@asperti.com> - 1.0.0-1
- initial release from old startpage package