libreschool-pxeserver/libreschool-pxeserver.spec

141 lines
4.3 KiB
RPMSpec
Raw Normal View History

2020-03-23 14:49:50 +00:00
Summary: LibreSchool PXE server
Name: libreschool-pxeserver
2020-05-02 20:48:14 +00:00
Version: 1.1.5
2020-03-23 14:49:50 +00:00
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
2020-03-29 16:21:43 +00:00
Requires: libreschool-client-manager
2020-03-23 14:49:50 +00:00
Requires: nethserver-tftp
Requires: ipxe-bootimgs
Requires: httpd, php, sudo, php-xml, php-mcrypt
2020-03-29 16:21:43 +00:00
Requires: nfs-utils
2020-03-23 14:49:50 +00:00
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: nethserver-devtools
BuildRequires: systemd
%description
LibreSchool PXE server
%prep
%setup
%build
2020-03-29 16:21:43 +00:00
perl createlinks
2020-03-23 14:49:50 +00:00
%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
2020-03-29 16:21:43 +00:00
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
2020-03-23 14:49:50 +00:00
/sbin/e-smith/db configuration setprop dnsmasq \
tftp-status enabled \
dhcp-boot undionly.kpxe
2020-03-29 16:21:43 +00:00
/etc/e-smith/events/actions/initialize-default-databases
/sbin/e-smith/expand-template /etc/exports
2020-03-23 14:49:50 +00:00
/sbin/e-smith/expand-template /etc/dnsmasq.conf
/sbin/e-smith/signal-event nethserver-dnsmasq-save
2020-03-29 16:21:43 +00:00
[ -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
2020-03-23 14:49:50 +00:00
[ -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 || :
2020-03-29 16:21:43 +00:00
/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
2020-03-23 14:49:50 +00:00
/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
2020-03-29 16:21:43 +00:00
/sbin/e-smith/expand-template /etc/exports
/usr/sbin/exportfs -ra
2020-03-23 14:49:50 +00:00
/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
2020-05-02 20:48:14 +00:00
* 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
2020-04-25 19:09:28 +00:00
* 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
2020-04-24 07:42:53 +00:00
* Fri Apr 24 2020 Paolo Asperti <paolo@asperti.com> - 1.1.2-1.ns7
- Added Ubuntu 20.04
2020-04-03 19:45:30 +00:00
* Fri Apr 3 2020 Paolo Asperti <paolo@asperti.com> - 1.1.1-1.ns7
- Fixed boot.php script
2020-03-29 16:21:43 +00:00
* 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
2020-03-23 14:49:50 +00:00
- First release for NethServer 7