RPM Spec File Improvements

- Fix package reference for EL7
- Update spec file to use systemd macros
- Use macros to refer to file paths
- Update syntax
This commit is contained in:
Michael L. Young
2021-09-28 19:52:52 -04:00
parent 1d48c9ce15
commit b0ede5d03e

View File

@@ -5,18 +5,30 @@ Summary: A suite of tools for bare metal provisioning of containers
Version: @VERSION@ Version: @VERSION@
Release: 1%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Group: System Environment/Clustering Source: https://github.com/hpcng/warewulf/archive/refs/tags/%{name}-%{version}.tar.gz
Source: %{name}-%{version}.tar.gz
ExclusiveOS: linux ExclusiveOS: linux
BuildRoot: %{?_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: make
BuildRequires: golang
%if 0%{?rhel}
BuildRequires: systemd
%else
BuildRequires: systemd-rpm-macros
%endif
%if 0%{?rhel} > 7
Requires: dhcp-server Requires: dhcp-server
%else
Requires: dhcp
%endif
Requires: tftp-server Requires: tftp-server
Requires: nfs-utils Requires: nfs-utils
%description %description
Warewulf is a bare metal container provisioning system. Warewulf is a bare metal container provisioning system.
%prep %prep
%setup -q %setup -q
@@ -24,31 +36,43 @@ Warewulf is a bare metal container provisioning system.
make all make all
%install %install
%{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install} %make_install DESTDIR=%{buildroot} %{?mflags_install}
#%pre %pre
groupadd -r warewulf >/dev/null 2>&1 || : getent group warewulf >/dev/null || groupadd -r warewulf
%post %post
%if %{?rhel}%{!?rhel:0} >= 7 %systemd_post warewulfd.service
groupadd -r warewulf >/dev/null 2>&1 || :
systemctl daemon-reload >/dev/null 2>&1 || :
%endif
%clean %preun
rm -rf $RPM_BUILD_ROOT %systemd_preun warewulfd.service
%postun
%systemd_postun_with_restart warewulfd.service
%files %files
%defattr(-, root, root) %attr(0755, root, warewulf) %dir %{_sysconfdir}/%{name}
%attr(0755, root, warewulf) %dir /etc/warewulf/ %config(noreplace) %{_sysconfdir}/%{name}/*
%config(noreplace) /etc/warewulf/*
/etc/bash_completion.d/warewulf %{_sysconfdir}/bash_completion.d/warewulf
/usr/bin/wwctl
/usr/lib/firewalld/services/warewulf.xml %{_bindir}/wwctl
/usr/lib/systemd/system/warewulfd.service
/var/warewulf %{_prefix}/lib/firewalld/services/warewulf.xml
/usr/share/man/man1/*
%{_unitdir}/warewulfd.service
%attr(0755, root, warewulf) %dir %{_localstatedir}/%{name}
%{_localstatedir}/%{name}/overlays/runtime/*
%{_localstatedir}/%{name}/overlays/system/*
%{_mandir}/man1/wwctl*
%changelog %changelog
* Fri Sep 24 2021 Michael L. Young <myoung@ciq.co> - 4.2.0-1
- Update spec file to use systemd macros
- Use macros to refer to system paths
- Update syntax
* Tue Jan 26 2021 14:46:24 JST Brian Clemens <bclemens@ctrliq.com> - 4.0.0 * Tue Jan 26 2021 14:46:24 JST Brian Clemens <bclemens@ctrliq.com> - 4.0.0
- Initial release - Initial release