Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package systemd unit files #2

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion rpm/util-linux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,26 @@ Obsoletes: %{name}-docs
%description doc
Man and info pages for %{name}.

%package systemd-fstrim
Summary: Systemd unit files for %{name}
Group: System
Olf0 marked this conversation as resolved.
Show resolved Hide resolved
Requires: %{name} = %{version}-%{release}
Requires(post): systemd
BuildRequires: systemd-devel

%description systemd-fstrim
Systemd unit files for fstrim
Olf0 marked this conversation as resolved.
Show resolved Hide resolved

%package systemd-uuidd
Summary: Systemd unit files for %{name}
Group: System
Requires: %{name} = %{version}-%{release}
Requires: uuidd
Requires(post): systemd
BuildRequires: systemd-devel
Olf0 marked this conversation as resolved.
Show resolved Hide resolved

%description systemd-uuidd
Systemd unit files for uuidd
Olf0 marked this conversation as resolved.
Show resolved Hide resolved

%prep
%setup -q -n %{name}-%{version}/%{name}
Expand All @@ -214,7 +234,8 @@ export SUID_CFLAGS="-fpie"
export SUID_LDFLAGS="-pie"
./autogen.sh
%configure \
--with-systemdsystemunitdir=no \
--with-systemdsystemunitdir=%{_unitdir} \
--with-systemd \
--bindir=/bin \
--sbindir=/sbin \
--disable-wall \
Expand Down Expand Up @@ -367,6 +388,7 @@ for I in /etc/blkid.tab /etc/blkid.tab.old \
fi
done


%postun -n libblkid -p /sbin/ldconfig

%post -n libfdisk -p /sbin/ldconfig
Expand All @@ -381,6 +403,18 @@ done
%post -n libsmartcols -p /sbin/ldconfig
%postun -n libsmartcols -p /sbin/ldconfig

%post systemd-fstrim
%systemd_post fstrim.timer

%preun systemd-fstrim
%systemd_preun fstrim.timer

%post systemd-uuidd
%systemd_post uuidd.service

%preun systemd-uuidd
%systemd_preun uuidd.service

%pre -n uuidd
getent group uuidd >/dev/null || groupadd -r uuidd
getent passwd uuidd >/dev/null || \
Expand Down Expand Up @@ -587,3 +621,13 @@ exit 0
%files doc -f documentation.list
%defattr(-,root,root)
%{_docdir}/%{name}-%{version}

%files systemd-fstrim
%defattr(-,root,root)
%{_unitdir}/fstrim.service
%{_unitdir}/fstrim.timer

%files systemd-uuidd
%defattr(-,root,root)
%{_unitdir}/uuidd.service
%{_unitdir}/uuidd.socket