90 lines
2.7 KiB
RPMSpec
90 lines
2.7 KiB
RPMSpec
Summary: LibreSchool PXE server
|
|
Name: libreschool-pxeserver
|
|
Version: 1.0.0
|
|
Release: 1.ns7
|
|
License: GPL
|
|
BuildArch: noarch
|
|
BuildRoot: %{_tmppath}/%{name}-root
|
|
Source0: %{name}-%{version}.tar.gz
|
|
Source1: COPYING
|
|
URL: %{url_prefix}/%{name}
|
|
Requires: libreschool-release
|
|
Requires: nethserver-tftp
|
|
Requires: ipxe-bootimgs
|
|
Requires: httpd, php, sudo, php-xml, php-mcrypt
|
|
Requires(post): systemd
|
|
Requires(preun): systemd
|
|
Requires(postun): systemd
|
|
BuildRequires: nethserver-devtools
|
|
BuildRequires: systemd
|
|
|
|
%description
|
|
LibreSchool PXE server
|
|
|
|
%prep
|
|
%setup
|
|
|
|
%build
|
|
|
|
%install
|
|
rm -rf $RPM_BUILD_ROOT
|
|
(cd root ; find . -depth -not -name '*.orig' -print | cpio -dump $RPM_BUILD_ROOT)
|
|
%{genfilelist} $RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist
|
|
echo "%doc COPYING" >> %{name}-%{version}-%{release}-filelist
|
|
mkdir -p %{buildroot}%{_localstatedir}/log/pxeserver-httpd
|
|
mkdir -p %{buildroot}%{_localstatedir}/cache/pxeserver-httpd
|
|
|
|
%files -f %{name}-%{version}-%{release}-filelist
|
|
%attr(0755,srvmgr,srvmgr) %dir %{_localstatedir}/cache/pxeserver-httpd
|
|
%attr(0755,srvmgr,srvmgr) %dir %{_localstatedir}/log/pxeserver-httpd
|
|
%defattr(-,root,root)
|
|
|
|
%pre
|
|
if [ "$1" = 2 ]; then
|
|
#upgrade
|
|
/usr/bin/systemctl stop pxeserver-httpd >/dev/null 2>&1 || :
|
|
fi
|
|
|
|
%post
|
|
/etc/e-smith/events/actions/initialize-default-databases
|
|
/sbin/e-smith/db configuration setprop dnsmasq \
|
|
tftp-status enabled \
|
|
dhcp-boot undionly.kpxe
|
|
/sbin/e-smith/expand-template /etc/dnsmasq.conf
|
|
/sbin/e-smith/signal-event nethserver-dnsmasq-save
|
|
[ -e /var/lib/tftpboot/undionly.kpxe ] && [ ! -L /var/lib/tftpboot/undionly.kpxe ] && rm /var/lib/tftpboot/undionly.kpxe
|
|
ln -s /usr/share/ipxe/undionly.kpxe /var/lib/tftpboot/undionly.kpxe
|
|
[ -e /usr/sbin/pxeserver-httpd ] && [ ! -L /usr/sbin/pxeserver-httpd ] && rm /usr/sbin/pxeserver-httpd
|
|
[ ! -L /usr/sbin/pxeserver-httpd ] && ln -s httpd /usr/sbin/pxeserver-httpd
|
|
[ ! -d /etc/httpd/pxeserver-httpd ] && mkdir /etc/httpd/pxeserver-httpd
|
|
/sbin/e-smith/expand-template /etc/httpd/pxeserver-httpd/httpd.conf
|
|
/sbin/e-smith/signal-event runlevel-adjust
|
|
/usr/bin/systemctl --no-block start pxeserver-httpd >/dev/null 2>&1 || :
|
|
/sbin/e-smith/signal-event firewall-adjust
|
|
|
|
%preun
|
|
#if [ "$1" = 1 ]; then
|
|
# #upgrade
|
|
#fi
|
|
if [ "$1" = 0 ]; then
|
|
#uninstallation
|
|
/usr/bin/systemctl stop pxeserver-httpd >/dev/null 2>&1 || :
|
|
fi
|
|
|
|
%postun
|
|
#if [ "$1" = 1 ]; then
|
|
# #upgrade
|
|
#fi
|
|
if [ "$1" = 0 ]; then
|
|
#uninstallation
|
|
/sbin/e-smith/expand-template /etc/dnsmasq.conf
|
|
rm /var/lib/tftpboot/undionly.kpxe
|
|
/sbin/e-smith/db configuration delete pxeserver-httpd
|
|
/sbin/e-smith/signal-event runlevel-adjust
|
|
/sbin/e-smith/signal-event firewall-adjust
|
|
fi
|
|
|
|
%changelog
|
|
* Tue Mar 24 2020 Paolo Asperti <paolo@asperti.com> - 1.0-1.ns7
|
|
- First release for NethServer 7
|