Blob Blame History Raw
# Generated by rust2rpm
# XXX: https://github.com/stratis-storage/stratisd/issues/1496
%bcond_with check

# Not interested in packaging lib
# stratisd is supposed to be daemon used through dbus
%global __cargo_is_lib() false

Name:           stratisd
Version:        1.0.4
Release:        1%{?dist}
Summary:        Daemon that manages block devices to create filesystems

License:        MPLv2.0
URL:            https://github.com/stratis-storage/stratisd
Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

ExclusiveArch:  %{rust_arches}

BuildRequires:  rust-packaging
BuildRequires:  (crate(byteorder/default) >= 1.0.0 with crate(byteorder/default) < 2.0.0)
BuildRequires:  (crate(chrono/default) >= 0.4.0 with crate(chrono/default) < 0.5.0)
BuildRequires:  (crate(clap/default) >= 2.0.0 with crate(clap/default) < 3.0.0)
BuildRequires:  (crate(crc/default) >= 1.0.0 with crate(crc/default) < 2.0.0)
BuildRequires:  (crate(dbus/default) >= 0.6.4 with crate(dbus/default) < 0.7.0)
BuildRequires:  (crate(devicemapper/default) >= 0.27.0 with crate(devicemapper/default) < 0.28.0)
BuildRequires:  (crate(env_logger/default) >= 0.5.0 with crate(env_logger/default) < 0.6.0)
BuildRequires:  (crate(lazy_static/default) >= 1.0.0 with crate(lazy_static/default) < 2.0.0)
BuildRequires:  (crate(libc/default) >= 0.2.47 with crate(libc/default) < 0.3.0)
BuildRequires:  (crate(libmount/default) >= 0.1.10 with crate(libmount/default) < 0.2.0)
BuildRequires:  (crate(libudev/default) >= 0.2.0 with crate(libudev/default) < 0.3.0)
BuildRequires:  (crate(log/default) >= 0.4.0 with crate(log/default) < 0.5.0)
BuildRequires:  (crate(nix/default) >= 0.13.0 with crate(nix/default) < 0.14.0)
BuildRequires:  (crate(rand/default) >= 0.4.0 with crate(rand/default) < 0.5.0)
BuildRequires:  (crate(serde/default) >= 1.0.0 with crate(serde/default) < 2.0.0)
BuildRequires:  (crate(serde_derive/default) >= 1.0.0 with crate(serde_derive/default) < 2.0.0)
BuildRequires:  (crate(serde_json/default) >= 1.0.0 with crate(serde_json/default) < 2.0.0)
BuildRequires:  (crate(tempfile/default) >= 3.0.1 with crate(tempfile/default) < 4.0.0)
BuildRequires:  (crate(timerfd/default) >= 1.0.0 with crate(timerfd/default) < 2.0.0)
BuildRequires:  (crate(uuid/default) >= 0.7.0 with crate(uuid/default) < 0.8.0)
BuildRequires:  (crate(uuid/serde) >= 0.7.0 with crate(uuid/serde) < 0.8.0)
BuildRequires:  (crate(uuid/v4) >= 0.7.0 with crate(uuid/v4) < 0.8.0)
%if %{with check}
BuildRequires:  (crate(either/default) >= 1.1.0 with crate(either/default) < 2.0.0)
BuildRequires:  (crate(error-chain/default) >= 0.12.0 with crate(error-chain/default) < 0.13.0)
BuildRequires:  (crate(loopdev/default) >= 0.2.0 with crate(loopdev/default) < 0.3.0)
BuildRequires:  (crate(matches/default) >= 0.1.8 with crate(matches/default) < 0.2.0)
BuildRequires:  (crate(proptest/default) >= 0.8.0 with crate(proptest/default) < 0.9.0)
%endif
BuildRequires:  %{_bindir}/a2x
BuildRequires:  systemd

%{?systemd_requires}
Requires:       xfsprogs
Requires:       device-mapper-persistent-data

%description
%{summary}.

%prep
%autosetup -p1
%cargo_prep

%build
%cargo_build
%cargo_build -n
a2x -f manpage docs/stratisd.txt

%install
%cargo_install
# Daemon should be really private
mkdir -p %{buildroot}%{_libexecdir}
mv %{buildroot}%{_bindir}/stratisd %{buildroot}%{_libexecdir}/stratisd

%cargo_install -n
# Init version should be in sbin
mkdir -p %{buildroot}%{_sbindir}
mv %{buildroot}%{_bindir}/stratisd %{buildroot}%{_sbindir}/stratisd-init

%{__install} -Dpm0644 -t %{buildroot}%{_datadir}/dbus-1/system.d stratisd.conf
%{__install} -Dpm0644 -t %{buildroot}%{_mandir}/man8 docs/stratisd.8
%{__install} -Dpm0644 -t %{buildroot}%{_unitdir} stratisd.service

%if %{with check}
%check
%cargo_test -- -- --skip real_ --skip loop_ --skip travis_
%endif

%post
%systemd_post stratisd.service

%preun
%systemd_preun stratisd.service

%postun
%systemd_postun_with_restart stratisd.service

%files
%license LICENSE
%doc README.md
%{_libexecdir}/stratisd
%{_sbindir}/stratisd-init
%dir %{_datadir}/dbus-1
%{_datadir}/dbus-1/system.d/stratisd.conf
%{_mandir}/man8/stratisd.8*
%{_unitdir}/stratisd.service

%changelog
* Tue May 07 08:16:24 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.4-1
- Update to 1.0.4

* Wed Mar 06 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.3-1
- Update to 1.0.3

* Wed Dec 12 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.2-1
- Update to 1.0.2

* Fri Nov 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.1-1
- Update to 1.0.1

* Thu Sep 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.0-1
- Update to 1.0.0

* Wed Sep 19 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.0-4
- Add missing systemd scriptlets

* Wed Sep 19 2018 Tony Asleson <tasleson@redhat.com> - 0.9.0-3
- Add systemd unit file
- Remove systemd activation file

* Tue Sep 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.0-2
- Rebuild to workaround pungi bug

* Sat Sep 01 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.0-1
- Update to 0.9.0

* Fri Aug 3 2018 Andy Grover <agrover@redhat.com> - 0.5.5-2
- Disable a failing but noncritical test

* Fri Aug 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.5-1
- Update to 0.5.5

* Thu Jul 19 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.4-3
- Upgrade dependencies

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Jul 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.4-1
- Update to 0.5.4

* Fri Jun 22 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.3-2
- Add -init version of daemon
- Own dbus-1 directory

* Mon Jun 4 2018 Andy Grover <agrover@redhat.com> - 0.5.3-1
- Update to 0.5.3

* Fri May 4 2018 Andy Grover <agrover@redhat.com> - 0.5.2-2
- Add 0002-Prefix-commands-with-entire-path.patch

* Tue May 1 2018 Andy Grover <agrover@redhat.com> - 0.5.2-1
- Update to 0.5.2

* Tue Apr 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.1-1
- Update to 0.5.1

* Tue Mar 13 2018 Andy Grover <agrover@redhat.com> - 0.5.0-2
- Add stratisd manpage

* Thu Mar 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.0-1
- Update to 0.5.0

* Thu Feb 15 2018 Andy Grover <agrover@redhat.com> - 0.1.5-2
- Require packages that contain binaries that we exec: xfsprogs and
  device-mapper-persistent-data

* Sun Feb 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.5-1
- Update to 0.1.5

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.4-3
- Rebuild for rust-packaging v5

* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.4-2
- Move binary under %%{_libexecdir}
- Add dbus service (so it is activatable)
- Fix rand's version bump

* Sun Jan 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.4-1
- Initial package