libreschool-pxeserver/libreschool-pxeserver.spec

141 lines
4.3 KiB
RPMSpec

Summary: LibreSchool PXE server
Name: libreschool-pxeserver
Version: 1.1.5
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: libreschool-client-manager
Requires: nethserver-tftp
Requires: ipxe-bootimgs
Requires: httpd, php, sudo, php-xml, php-mcrypt
Requires: nfs-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: nethserver-devtools
BuildRequires: systemd
%description
LibreSchool PXE server
%prep
%setup
%build
perl createlinks
%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
chkconfig nfs on
chkconfig rpcbind on
/sbin/e-smith/db configuration set nfs service \
status enabled \
TCPPorts 2049,20048 \
UDPPorts 2049,20048 \
access private
/sbin/e-smith/db configuration set rpcbind service \
status enabled \
TCPPort 111 \
UDPPort 111 \
access private
/sbin/e-smith/db configuration setprop dnsmasq \
tftp-status enabled \
dhcp-boot undionly.kpxe
/etc/e-smith/events/actions/initialize-default-databases
/sbin/e-smith/expand-template /etc/exports
/sbin/e-smith/expand-template /etc/dnsmasq.conf
/sbin/e-smith/signal-event nethserver-dnsmasq-save
[ -e /srv/iso ] && [ ! -d /srv/iso ] && rm -rf /srv/iso
[ ! -d /srv/iso ] && mkdir /srv/iso
[ -e /srv/mounts ] && [ ! -d /srv/mounts ] && rm -rf /srv/mounts
[ ! -d /srv/mounts ] && mkdir /srv/mounts
[ -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 || :
/usr/bin/systemctl --no-block start nfs >/dev/null 2>&1 || :
/usr/bin/systemctl --no-block start rpcbind >/dev/null 2>&1 || :
/usr/sbin/exportfs -ra
/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/exports
/usr/sbin/exportfs -ra
/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
* Sat May 2 2020 Paolo Asperti <paolo@asperti.com> - 1.1.5-1.ns7
- Added pop!OS 20.04
- Fixed some copypaste errors
* Tue Apr 28 2020 Paolo Asperti <paolo@asperti.com> - 1.1.4-1.ns7
- Added default image setting
* Sat Apr 25 2020 Paolo Asperti <paolo@asperti.com> - 1.1.3-1.ns7
- Added KUbuntu 20.04 (live only)
- Added LUbuntu 20.04 (live only)
- Added Ubuntu Budgie 20.04
- Added Ubuntu Mate 20.04
- Added XUbuntu 20.04
* Fri Apr 24 2020 Paolo Asperti <paolo@asperti.com> - 1.1.2-1.ns7
- Added Ubuntu 20.04
* Fri Apr 3 2020 Paolo Asperti <paolo@asperti.com> - 1.1.1-1.ns7
- Fixed boot.php script
* Wed Apr 1 2020 Paolo Asperti <paolo@asperti.com> - 1.1.0-1.ns7
- Added a lot of PXE images
- Added iso download and check script
* Tue Mar 24 2020 Paolo Asperti <paolo@asperti.com> - 1.0.0-1.ns7
- First release for NethServer 7