-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue: 2368612 Improve systemd support
This changes are done to be aligned with last Fedora requirements. Signed-off-by: Igor Ivanov <[email protected]>
- Loading branch information
1 parent
1086516
commit 2879148
Showing
5 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ BuildRequires: systemd-rpm-macros | |
BuildRequires: pkgconfig(libnl-3.0) | ||
BuildRequires: pkgconfig(libnl-route-3.0) | ||
%endif | ||
BuildRequires: make | ||
|
||
%description | ||
libvma is a LD_PRELOAD-able library that boosts performance of TCP and | ||
|
@@ -82,24 +83,34 @@ cp -f src/vma/.libs/%{name}.so %{name}-debug.so | |
%endif | ||
|
||
%configure --docdir=%{_pkgdocdir} \ | ||
%{?configure_options} | ||
%{?configure_options} | ||
%{make_build} | ||
|
||
%install | ||
%{make_install} | ||
%{make_build} DESTDIR=${RPM_BUILD_ROOT} install | ||
|
||
find $RPM_BUILD_ROOT%{_libdir} -name '*.la' -delete | ||
%if "%{use_systemd}" == "1" | ||
install -D -m 644 contrib/scripts/vma.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/vma.service | ||
%endif | ||
|
||
%if %{use_rel} > 0 | ||
install -m 755 ./%{name}-debug.so $RPM_BUILD_ROOT/%{_libdir}/%{name}-debug.so | ||
%endif | ||
|
||
%post | ||
%if 0%{?fedora} || 0%{?rhel} > 7 | ||
# https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets | ||
%else | ||
%{run_ldconfig} | ||
|
||
%endif | ||
if [ $1 = 1 ]; then | ||
if type systemctl >/dev/null 2>&1; then | ||
systemctl --no-reload enable vma.service >/dev/null 2>&1 || true | ||
%if 0%{?suse_version} | ||
%service_add_post vma.service | ||
%else | ||
%systemd_post vma.service | ||
%endif | ||
elif [ -e /sbin/chkconfig ]; then | ||
/sbin/chkconfig --add vma | ||
elif [ -e /usr/sbin/update-rc.d ]; then | ||
|
@@ -112,8 +123,11 @@ fi | |
%preun | ||
if [ $1 = 0 ]; then | ||
if type systemctl >/dev/null 2>&1; then | ||
systemctl --no-reload disable vma.service >/dev/null 2>&1 || true | ||
systemctl stop vma.service || true | ||
%if 0%{?suse_version} | ||
%service_del_preun vma.service | ||
%else | ||
%systemd_preun vma.service | ||
%endif | ||
elif [ -e /sbin/chkconfig ]; then | ||
%{_sysconfdir}/init.d/vma stop | ||
/sbin/chkconfig --del vma | ||
|
@@ -127,9 +141,17 @@ if [ $1 = 0 ]; then | |
fi | ||
|
||
%postun | ||
%if 0%{?fedora} || 0%{?rhel} > 7 | ||
# https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets | ||
%else | ||
%{run_ldconfig} | ||
%endif | ||
if type systemctl >/dev/null 2>&1; then | ||
systemctl --system daemon-reload >/dev/null 2>&1 || true | ||
%if 0%{?suse_version} | ||
%service_del_postun vma.service | ||
%else | ||
%systemd_postun_with_restart vma.service | ||
%endif | ||
fi | ||
|
||
%files | ||
|
@@ -142,7 +164,6 @@ fi | |
%{_sbindir}/vmad | ||
%if "%{use_systemd}" == "1" | ||
%{_prefix}/lib/systemd/system/vma.service | ||
%{_sbindir}/vma | ||
%else | ||
%{_sysconfdir}/init.d/vma | ||
%endif | ||
|
@@ -164,6 +185,9 @@ fi | |
%{_mandir}/man8/vma_stats.* | ||
|
||
%changelog | ||
* Mon Nov 23 2020 Igor Ivanov <[email protected]> 9.2.1-1 | ||
- Improve systemd support | ||
|
||
* Fri Apr 17 2020 Igor Ivanov <[email protected]> 9.0.2-1 | ||
- Align with Fedora guidelines | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters