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 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
42 changes: 41 additions & 1 deletion rpm/util-linux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BuildRequires: texinfo
BuildRequires: pkgconfig(ext2fs) >= 1.36
BuildRequires: pkgconfig(ncurses)
BuildRequires: pkgconfig(popt)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(zlib)
BuildRequires: libutempter-devel
BuildRequires: bison
Expand Down Expand Up @@ -198,6 +199,22 @@ Obsoletes: %{name}-docs
%description doc
Man and info pages for %{name}.

%package systemd-fstrim
Summary: Systemd unit files for %{name}
Requires: %{name} = %{version}-%{release}
Requires(post): systemd

%description systemd-fstrim
Systemd unit files for fstrim.

%package systemd-uuidd
Summary: Systemd unit files for %{name}
Requires: %{name} = %{version}-%{release}
Requires: uuidd
Requires(post): systemd

%description systemd-uuidd
Systemd unit files for uuidd.

%prep
%setup -q -n %{name}-%{version}/%{name}
Expand All @@ -214,7 +231,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 @@ -381,6 +399,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 +617,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