rust-zram-generator/rust-zram-generator.spec

148 lines
4.1 KiB
RPMSpec

# Generated by rust2rpm 15
# * https://github.com/systemd/zram-generator/issues/36
%bcond_with check
%global crate zram-generator
Name: rust-%{crate}
Version: 0.2.0~beta.1
Release: 3%{?dist}
Summary: Systemd unit generator for zram swap devices
# Upstream license specification: MIT
License: MIT
URL: https://crates.io/crates/zram-generator
Source: %{crates_source}
Source1: zram-generator.conf
ExclusiveArch: %{rust_arches}
%if %{__cargo_skip_build}
BuildArch: noarch
%endif
BuildRequires: rust-packaging
BuildRequires: systemd-rpm-macros
%global _description %{expand:
This is a systemd unit generator that enables swap on zram.
(With zram, there is no physical swap device. Part of the avaialable RAM
is used to store compressed pages, essentially trading CPU cycles for memory.)
To activate, install %{crate}-defaults subpackage.}
%description %{_description}
%if ! %{__cargo_skip_build}
%package -n %{crate}
Summary: %{summary}
# MIT
# MIT or ASL 2.0
License: MIT
# for zramctl
Recommends: util-linux
%description -n %{crate} %{_description}
%files -n %{crate}
%license LICENSE
%doc zram-generator.conf.example
%doc README.md TODO
%{_systemdgeneratordir}/zram-generator
%{_unitdir}/swap-create@.service
%package -n %{crate}-defaults
Summary: Default configuration for %{crate}
Requires: %{crate} = %{version}-%{release}
BuildArch: noarch
%description -n %{crate}-defaults
%{summary}.
%files -n %{crate}-defaults
%{_prefix}/lib/systemd/zram-generator.conf
%endif
%package devel
Summary: %{SUMMARY}
BuildArch: noarch
%description devel %{_description}
This package contains library source intended for building other packages
which use "%{crate}" crate.
%files devel
%license LICENSE
%doc README.md TODO
%{cargo_registry}/%{crate}-%{version_no_tilde}/
%package -n %{name}+default-devel
Summary: %{SUMMARY}
BuildArch: noarch
%description -n %{name}+default-devel %{_description}
This package contains library source intended for building other packages
which use "default" feature of "%{crate}" crate.
%files -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
cp -a %{S:1} .
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%install
%cargo_install
mkdir -p %{buildroot}%{_systemdgeneratordir}
mv -v %{buildroot}%{_bindir}/zram-generator %{buildroot}%{_systemdgeneratordir}/
install -Dpm0644 -t %{buildroot}%{_unitdir} units/swap-create@.service
install -Dpm0644 -t %{buildroot}%{_prefix}/lib/systemd zram-generator.conf
%if %{with check}
%check
%cargo_test
%endif
%changelog
* Thu Jun 18 11:30:43 CEST 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.2.0~beta.1-3
- Create a subpackage with default configuration
* Thu Jun 18 10:14:43 CEST 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.2.0~beta.1-2
- Install swap-create unit file
* Thu Jun 18 09:27:37 CEST 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.2.0~beta.1-1
- Update to 0.2.0-beta.1
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Oct 7 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.2-1
- Update to latest version
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jul 22 21:30:22 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.1-4
- Regenerate
* Sat Mar 09 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.1-3
- Adapt to new packaging
* Fri Mar 1 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.1-2
- Add crude patch to fix build (#1676154)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Aug 16 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.1-1
- Initial package