Do not pull in systemd during build

%_systemd_util_dir was added to macros for exactly this purpose.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-03-21 11:19:16 +01:00
parent d2520be3c5
commit 4fbeb5cf62

View File

@ -97,17 +97,16 @@ cp -a %{S:1} .
%cargo_generate_buildrequires
echo '/usr/bin/make'
echo '/usr/bin/ronn'
echo 'pkgconfig(systemd)'
echo 'systemd-rpm-macros'
%build
export SYSTEMD_UTIL_DIR=$(pkg-config --variable=systemdutildir systemd)
export SYSTEMD_UTIL_DIR=%{_systemd_util_dir}
%cargo_build
make systemd_service
LC_ALL=C.UTF-8 ronn --roff --organization="zram-generator %{version_no_tilde}" man/*.md
%install
export SYSTEMD_UTIL_DIR=$(pkg-config --variable=systemdutildir systemd)
export SYSTEMD_UTIL_DIR=%{_systemd_util_dir}
%cargo_install
mkdir -p %{buildroot}%{_systemdgeneratordir}
@ -119,7 +118,7 @@ install -Dpm0644 -t %{buildroot}%{_mandir}/man5 man/zram-generator.conf.5
%if %{with check}
%check
export SYSTEMD_UTIL_DIR=$(pkg-config --variable=systemdutildir systemd)
export SYSTEMD_UTIL_DIR=%{_systemd_util_dir}
%cargo_test
%endif