1
0

Accepting request 931769 from home:BenniBrunner:zram

Initial submit for zram-generator

OBS-URL: https://build.opensuse.org/request/show/931769
OBS-URL: https://build.opensuse.org/package/show/Base:System/zram-generator?expand=0&rev=1
This commit is contained in:
Marcus Meissner 2021-11-19 08:25:58 +00:00 committed by Git OBS Bridge
commit 498ab899a7
9 changed files with 165 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

27
_service Normal file
View File

@ -0,0 +1,27 @@
<services>
<service mode="disabled" name="obs_scm">
<param name="url">https://github.com/systemd/zram-generator.git</param>
<param name="versionformat">@PARENT_TAG@~git@TAG_OFFSET@.%h</param>
<param name="scm">git</param>
<param name="revision">main</param>
<param name="match-tag">*</param>
<param name="versionrewrite-pattern">v(\d+\.\d+\.\d+)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="changesgenerate">enable</param>
<param name="changesauthor">bbrunner@suse.com</param>
</service>
<service mode="disabled" name="tar" />
<service mode="disabled" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="disabled" name="set_version"/>
<service name="cargo_vendor" mode="disabled">
<param name="srcdir">zram-generator</param>
<param name="compression">xz</param>
<param name="update">true</param>
</service>
<service name="cargo_audit" mode="disabled">
<param name="srcdir">zram-generator</param>
</service>
</services>

5
cargo_config Normal file
View File

@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"

3
vendor.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a6e58120abf37ba9bfb0d02fd92aaf6afcbb22636f86c2703f092f96154ffbf6
size 5378316

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a7477143d624323dd21051bc3655371598129e51acb5a4d98a5f2f5559ca2f0
size 21844

1
zram-generator-rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter(".*systemd-service-without-service.*")

19
zram-generator.changes Normal file
View File

@ -0,0 +1,19 @@
-------------------------------------------------------------------
Thu Nov 11 08:54:15 UTC 2021 - Benjamin Brunner <bbrunner@suse.com>
- Update to version 1.0.1~git25.5e0ec60:
* make: add BUILDTYPE switch
* make: add "clippy" target
* Use ?= instead of = for Makefile defaults
* Do not warn on deprecated options
* Fix the reference to the directory/device option name
* Fix clippy
* Fix clippy job
* Warn on deprecated memory-limit
* Remove deprecated values from test data, move their tests to 11-obsolete
* Obsolete zram-fraction and max-zram-size in favour of new, arbitrary-expression, zram-size
-------------------------------------------------------------------
Wed Nov 3 12:12:53 UTC 2021 - Benjamin Brunner <bbrunner@suse.com>
- Initial package for zram-generator (jsc#SLE-18818)

83
zram-generator.spec Normal file
View File

@ -0,0 +1,83 @@
#
# spec file
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global _systemd_util_dir /usr/lib/systemd
Name: zram-generator
Version: 1.0.1~git25.5e0ec60
Release: 0
Summary: Systemd unit generator for zram swap devices
License: MIT
Group: Development/Libraries/Rust
# Upstream license specification: MIT
URL: https://github.com/systemd/zram-generator
Source0: %{name}-%{version}.tar.xz
Source1: vendor.tar.xz
Source2: cargo_config
Source3: zram-generator-rpmlintrc
BuildRequires: cargo-packaging
BuildRequires: groff
BuildRequires: rubygem(ronn)
BuildRequires: pkgconfig(systemd)
%description
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 configure and activate swap and zram devices with file-systems, create a configuration file in /etc/systemd/zram.generator.conf. You can consult %{_datadir}/doc/%{name}/zram-generator.conf.example for an example and a list of available settings.
%prep
%autosetup -a1 -p1 -n %{name}-%{version}
mkdir .cargo
cp %{SOURCE2} .cargo/config
%build
export SYSTEMD_UTIL_DIR=%{_systemd_util_dir}
export LC_ALL=C.UTF-8
%{cargo_build}
%make_build SYSTEMD_SYSTEM_UNIT_DIR=%{_unitdir} SYSTEMD_SYSTEM_GENERATOR_DIR=%{_systemdgeneratordir} \
systemd-service man
%install
install -Dpm755 target/release/zram-generator -t %{buildroot}%{_systemdgeneratordir}
install -Dpm644 units/systemd-zram-setup@.service -t %{buildroot}%{_unitdir}
install -Dpm644 zram-generator.conf.example -t %{buildroot}%{_prefix}/share/doc/zram-generator/
install -Dpm644 man/zram-generator.8 -t %{buildroot}%{_prefix}/share/man/man8/
install -Dpm644 man/zram-generator.5 -t %{buildroot}%{_prefix}/share/man/man5/zram-generator.conf.5
%fdupes -s %{buildroot}%{_mandir}
%fdupes %{buildroot}%{_prefix}
%check
export SYSTEMD_UTIL_DIR=%{_systemd_util_dir}
%{cargo_test}
%files
%doc README.md
%dir %{_datadir}/doc/%{name}
%{_datadir}/doc/%{name}/zram-generator.conf.example
%dir %{_systemdgeneratordir}
%{_systemdgeneratordir}/zram-generator
%{_unitdir}/systemd-zram-setup@.service
%{_mandir}/man8/zram-generator.8*
%{_mandir}/man5/zram-generator.conf.5*
%changelog