Skip to content

Commit

Permalink
spec file - replace systemd macros with explicit commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bkelly16 committed Jan 15, 2025
1 parent df1362c commit 05bd59e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packaging/el8/main.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ License: ::package_licence::
URL: ::package_url::
Source0: %{name}-%{version}.tar.gz
BuildArch: ::package_architecture_el::
BuildRequires: systemd-rpm-macros
Requires: ::package_dependencies_el::

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Expand All @@ -29,10 +30,18 @@ Conflicts: %{name}-1.7
make DESTDIR=%{buildroot} TOOLS_VERSION="%{version}-::package_build_version::" install

%post
%{?systemd_post zfs-scrub.timer}
if [ $1 == 0 ];then
systemctl daemon-reload
systemctl enable zfs-scrub.timer
systemctl start zfs-scrub.timer
fi

%preun
%{?systemd_preun zfs-scrub.timer}
if [ $1 == 0 ];then
systemctl stop zfs-scrub.timer
systemctl disable zfs-scrub.timer
fi


%postun
if [ $1 == 0 ];then
Expand All @@ -54,7 +63,7 @@ if [ $1 == 0 ];then
rm -rf "$OLD_TOOLS_DIR"
fi
fi
%{?systemd_postun_with_restart zfs-scrub.timer}
systemctl daemon-reload

%files
%dir /opt/45drives/tools
Expand Down

0 comments on commit 05bd59e

Please sign in to comment.