Files
yms-daemon/packaging/rpm/yms-daemon.spec
T

83 lines
2.5 KiB
RPMSpec

%global debug_package %{nil}
%global __strip /bin/true
%global _binary_payload w9.gzdio
%{!?package_version:%global package_version 0.1.0}
%{!?package_release:%global package_release 1}
Name: yms-daemon
Version: %{package_version}
Release: %{package_release}
Summary: YMS update daemon
License: Proprietary
Requires: systemd
Source0: ymsd
Source1: yms-daemon.toml
Source2: yms-daemon.service
Source3: yms-backend@.service
Source4: yms-daemon-tmpfiles.conf
Source5: ymsctl
%description
Transactional update daemon and native backend systemd units for YMS installations.
%prep
%build
%install
install -d -m 0755 %{buildroot}/usr/bin
install -m 0755 %{SOURCE0} %{buildroot}/usr/bin/ymsd
install -m 0755 %{SOURCE5} %{buildroot}/usr/bin/ymsctl
install -d -m 0755 %{buildroot}/etc/yms-daemon
install -m 0640 %{SOURCE1} %{buildroot}/etc/yms-daemon/yms-daemon.toml
install -d -m 0755 %{buildroot}/etc/systemd/system
install -m 0644 %{SOURCE2} %{buildroot}/etc/systemd/system/yms-daemon.service
install -m 0644 %{SOURCE3} %{buildroot}/etc/systemd/system/yms-backend@.service
install -d -m 0755 %{buildroot}/etc/tmpfiles.d
install -m 0644 %{SOURCE4} %{buildroot}/etc/tmpfiles.d/yms-daemon.conf
install -d -m 0755 %{buildroot}/home/yms/dump
%post
tmpfiles_path="$(command -v systemd-tmpfiles 2>/dev/null || :)"
if [ -n "$tmpfiles_path" ]; then
"$tmpfiles_path" --create /etc/tmpfiles.d/yms-daemon.conf >/dev/null 2>&1 || :
fi
systemctl_path="$(command -v systemctl 2>/dev/null || :)"
if [ -n "$systemctl_path" ]; then
"$systemctl_path" daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ "$1" -eq 0 ]; then
systemctl_path="$(command -v systemctl 2>/dev/null || :)"
if [ -n "$systemctl_path" ]; then
"$systemctl_path" disable --now yms-daemon.service >/dev/null 2>&1 || :
fi
fi
%postun
systemctl_path="$(command -v systemctl 2>/dev/null || :)"
if [ -n "$systemctl_path" ]; then
"$systemctl_path" daemon-reload >/dev/null 2>&1 || :
fi
%files
%dir %attr(0755,root,root) /etc/yms-daemon
%config(noreplace) %attr(0640,root,root) /etc/yms-daemon/yms-daemon.toml
%attr(0644,root,root) /etc/systemd/system/yms-daemon.service
%attr(0644,root,root) /etc/systemd/system/yms-backend@.service
%attr(0644,root,root) /etc/tmpfiles.d/yms-daemon.conf
%attr(0755,root,root) /usr/bin/ymsd
%attr(0755,root,root) /usr/bin/ymsctl
%dir %attr(0755,root,root) /home/yms/dump
%changelog
* Sun Aug 16 2026 YMS Engineering
- Add the initial native backend update daemon package.