diff --git a/rust-zram-generator.spec b/rust-zram-generator.spec index 01b51c4292fbbcc16f558dabe64fff41b0f6a9c9..7cf73787b6917205aa48393e140a7d93948bf9c6 100644 --- a/rust-zram-generator.spec +++ b/rust-zram-generator.spec @@ -1,42 +1,33 @@ -%define anolis_release 1 +%define anolis_release 2 +%bcond_with manpage %global crate zram-generator -Name: rust-zram-generator +Name: rust-%{crate} Version: 1.1.2 Release: %{anolis_release}%{?dist} Summary: Systemd unit generator for zram swap devices - License: MIT -URL: https://crates.io/crates/zram-generator -Source0: https://github.com/systemd/zram-generator/archive/refs/tags/v1.1.2.tar.gz -Source1: zram-generator.conf - -BuildRequires: rust-packaging > 21 +URL: https://crates.io/crates/%{crate} +Source0: https://github.com/systemd/%{crate}/archive/refs/tags/v%{version}.tar.gz +Source1: %{crate}-%{version}-vendor.tar.gz +Source2: zram-generator.conf -# The following build dependencies are the software required for the check. -BuildRequires: rust-ctor+default-devel rust-ctor-devel rust-nix-devel -BuildRequires: rust-fs_extra-devel rust-fs_extra+default-devel rust-nix+default-devel -BuildRequires: rust-tempfile+default-devel +BuildRequires: make automake autoconf systemd-rpm-macros +BuildRequires: rust cargo rust-packaging > 21 +%if %{with manpage} +BuildRequires: /usr/bin/ronn +%endif %description -This is a systemd unit generator that enables swap on zram. -(With zram, there is no physical swap device. Part of the available RAM -is used to store compressed pages, essentially trading CPU cycles for memory.) - -%package devel -Summary: %{summary} -BuildArch: noarch - -%description devel -%{description} -This package contains library source intended for building other packages which -use the "%{crate}" crate. +This generator provides a simple and fast mechanism to configure +swap on /dev/zram* devices. The main use case is create swap devices, +but devices with a file system can be created too. %package -n zram-generator Summary: Systemd unit generator for zram swap devices - + %description -n zram-generator -%{description} +This package provides systemd unit generator for zram swap devices. %package -n zram-generator-defaults Summary: Default configuration for zram-generator @@ -45,71 +36,69 @@ Obsoletes: zram < 0.4-2 BuildArch: noarch %description -n zram-generator-defaults -%{summary}. - -%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. +This package provides default configuration for zram-generator. %prep -%autosetup -n zram-generator-%{version} -p1 -cp -a %{SOURCE1} ./ +%autosetup -n %{crate}-%{version} +%setup -q -D -T -a 1 -n %{crate}-%{version} +cp -pva %{SOURCE2} . %cargo_prep -%generate_buildrequires -%cargo_generate_buildrequires -echo '/usr/bin/make' -echo '/usr/bin/ronn' -echo 'systemd-rpm-macros' +mkdir -p .cargo +cat > .cargo/config < - 1.1.2-2 +- Refactor the specfile and remove devel sub-package +- Disable manpage generation by default + * Wed Apr 20 2022 happy_orange - 1.1.2-1 - Init package from upstream diff --git a/zram-generator-1.1.2-vendor.tar.gz b/zram-generator-1.1.2-vendor.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e5b707217d55b2bbff956fe927e65e535ddc6ba0 Binary files /dev/null and b/zram-generator-1.1.2-vendor.tar.gz differ