|
| 1 | +%define _trivial .0 |
| 2 | +%define _buildid .3 |
1 | 3 | Name: smart-restart
|
2 |
| -Version: 0.1 |
| 4 | +Version: 0.2 |
3 | 5 | Release: 1%{?dist}
|
4 | 6 | Summary: Restarts services after the libs they link against have changed.
|
5 | 7 |
|
6 | 8 | License: Apache 2.0
|
7 | 9 |
|
8 |
| -%if "%{dist}" == ".amzn2023" |
9 |
| -Requires: dnf-utils |
10 |
| -Requires: dnf-plugin-post-transaction-actions |
11 |
| -%define _plugin_path dnf/plugins/post-transaction-actions.d/ |
| 10 | +%if 0%{?amzn2} |
| 11 | +%bcond_without yum |
12 | 12 | %else
|
13 |
| -%if "%{dist}" == ".amzn2" |
| 13 | +%bcond_with yum |
| 14 | +%endif |
| 15 | + |
| 16 | +%if %{with yum} |
14 | 17 | Requires: yum-utils
|
15 | 18 | Requires: yum-plugin-post-transaction-actions
|
16 | 19 | %define _plugin_path yum/post-actions/
|
| 20 | +%define pkg_manager yum |
17 | 21 | %else
|
18 |
| -%{error Distribution "%{expand:%{?dist}}" not supported} |
19 |
| -%endif |
| 22 | +Requires: dnf-utils |
| 23 | +Requires: dnf-plugin-post-transaction-actions |
| 24 | +%define _plugin_path dnf/plugins/post-transaction-actions.d/ |
| 25 | +%define pkg_manager dnf |
20 | 26 | %endif
|
21 | 27 |
|
22 |
| -Source: %{name}-%{version}-%{release}.tar.gz |
| 28 | + |
| 29 | +URL: https://github.com/amazonlinux/smart-restart/archive/v%{version}/ |
| 30 | +Source0: %{name}-v%{version}.tar.gz |
| 31 | + |
23 | 32 | %description
|
24 |
| -Hooks dnf and automatically restarts services after updates to their dependencies |
| 33 | +Hooks dnf/yum and automatically restarts services after updates to their dependencies |
25 | 34 |
|
26 | 35 | %prep
|
27 |
| -%setup -n %{name}-%{version}-%{release} |
| 36 | +%autosetup -n %{name}-v%{version} |
28 | 37 |
|
29 |
| -$install |
30 |
| -# The makefile uses DNF as the default package manager, we can override with yum using PKG_MANAGER=yum |
31 |
| -make DEST_DIR=$RPM_BUILD_ROOT DIST=%{?dist} PREFIX=%{_bindir} install |
| 38 | +%install |
| 39 | +make DEST_DIR=$RPM_BUILD_ROOT pkg_manager=%{pkg_manager} PREFIX=%{_bindir} install |
32 | 40 |
|
33 | 41 |
|
34 | 42 | %files
|
35 | 43 | %defattr(-,root,root,-)
|
36 | 44 | %{_bindir}/%{name}.sh
|
37 | 45 | %config %{_sysconfdir}/%{_plugin_path}/install.action
|
38 | 46 | %config %{_sysconfdir}/smart-restart-conf.d/default-denylist
|
39 |
| -%doc /usr/share/man/man1/smart-restart.man1 |
40 |
| - |
41 |
| -# Update man db |
42 |
| -# %post |
43 |
| -# /usr/bin/mandb |
| 47 | +%doc %{_mandir}/man1/smart-restart.man1.gz |
44 | 48 |
|
| 49 | +%changelog |
| 50 | +* Wed Mar 06 2024 Stanislav Uschakow <suschako@amazon.de> - 0.1-1.amzn2023.0.1 |
| 51 | +- Initial release of smart-restart-v0.1-1 for al2023 |
45 | 52 |
|
0 commit comments