From a02c5f0082b03f9e6a6ea3dd109443f144d2021ea2075f8af02e5b8ad63fe8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 28 Aug 2024 11:05:12 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main zram-generator revision 198e0ca180cfb6925099ad92577dafc5 --- .gitattributes | 23 ++++ _service | 26 ++++ _servicedata | 4 + cargo_config | 5 + vendor.tar.xz | 3 + zram-generator-1.1.2.tar.xz | 3 + zram-generator-rpmlintrc | 1 + zram-generator.8 | 89 +++++++++++++ zram-generator.changes | 70 ++++++++++ zram-generator.conf.5 | 248 ++++++++++++++++++++++++++++++++++++ zram-generator.obsinfo | 4 + zram-generator.spec | 81 ++++++++++++ 12 files changed, 557 insertions(+) create mode 100644 .gitattributes create mode 100644 _service create mode 100644 _servicedata create mode 100644 cargo_config create mode 100644 vendor.tar.xz create mode 100644 zram-generator-1.1.2.tar.xz create mode 100644 zram-generator-rpmlintrc create mode 100644 zram-generator.8 create mode 100644 zram-generator.changes create mode 100644 zram-generator.conf.5 create mode 100644 zram-generator.obsinfo create mode 100644 zram-generator.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/_service b/_service new file mode 100644 index 0000000..6defa4c --- /dev/null +++ b/_service @@ -0,0 +1,26 @@ + + + https://github.com/systemd/zram-generator.git + @PARENT_TAG@ + git + v1.1.2 + v(\d+\.\d+\.\d+) + \1 + enable + bbrunner@suse.com + + + + *.tar + xz + + + + zram-generator + xz + true + + + zram-generator + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..c0c36dd --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/systemd/zram-generator.git + 1bf6b08d8bd15624280482b1c125902f90c706aa \ No newline at end of file diff --git a/cargo_config b/cargo_config new file mode 100644 index 0000000..6fb4ff4 --- /dev/null +++ b/cargo_config @@ -0,0 +1,5 @@ +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" \ No newline at end of file diff --git a/vendor.tar.xz b/vendor.tar.xz new file mode 100644 index 0000000..2d74120 --- /dev/null +++ b/vendor.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2c1d65d5b941ab5fdc998510230f3880f559cfcc504492b3197fdeb449e9b81 +size 5903992 diff --git a/zram-generator-1.1.2.tar.xz b/zram-generator-1.1.2.tar.xz new file mode 100644 index 0000000..633598b --- /dev/null +++ b/zram-generator-1.1.2.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b70e581b72d4f4a52530891df736df0a9cb2e5d23b05cfae25c99fb658e2cc06 +size 22664 diff --git a/zram-generator-rpmlintrc b/zram-generator-rpmlintrc new file mode 100644 index 0000000..97e8994 --- /dev/null +++ b/zram-generator-rpmlintrc @@ -0,0 +1 @@ +addFilter(".*systemd-service-without-service.*") diff --git a/zram-generator.8 b/zram-generator.8 new file mode 100644 index 0000000..e4f0f59 --- /dev/null +++ b/zram-generator.8 @@ -0,0 +1,89 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "ZRAM\-GENERATOR" "8" "November 2021" "zram-generator developers" "" +. +.SH "NAME" +\fBzram\-generator\fR \- Systemd unit generator for zram swap devices +. +.SH "SYNOPSIS" +\fB/usr/lib/systemd/system\-generators/zram\-generator\fR \fBTARGET_DIR\fR [\fI2RGET_DIR\fR \fI3RGET_DIR\fR] +. +.br +\fB/usr/lib/systemd/system\-generators/zram\-generator\fR \-\-setup\-device \fBDEVICE\fR +. +.br +\fB/usr/lib/systemd/system\-generators/zram\-generator\fR \-\-reset\-device \fBDEVICE\fR +. +.SH "DESCRIPTION" +\fBzram\-generator\fR is a generator that creates systemd units to format and use compressed RAM devices, either as swap or a file system\. +. +.P +The generator will be invoked by systemd early at boot\. The generator will then: +. +.IP "1." 4 +read configuration files from \fI{/etc,/lib}/systemd/zram\-generator\.conf[\.d]\fR (see zram\-generator\.conf(5) for details); +. +.IP "2." 4 +generate systemd\.swap(5) and/or systemd\.mount(5) units into \fBTARGET_DIR\fR and connect them to \fBswap\.target\fR or \fBlocal\-fs\.target\fR as appropriate; +. +.IP "3." 4 +ensure the \fBzram\fR module is loaded and create the requested devices\. +. +.IP "" 0 +. +.P +The generator does nothing if run inside a container (as determined by \fIsystemd\-detect\-virt(8) \-\-container\fR)\. +. +.P +The generator also understands the kernel command\-line option \fBsystemd\.zram\fR\. See zram\-generator\.conf(5) for details\. +. +.P +Setting the \fBZRAM_GENERATOR_ROOT\fR environment variable makes the generator run in test mode, in which case containerisation is ignored and step \fB3\fR is skipped\. +. +.br +For the ramifications of \fBZRAM_GENERATOR_ROOT\fR on config handling, see zram\-generator\.conf(5)\. +. +.P +Generated \fIdev\-zramN\.swap\fR units depend on \fBsystemd\-zram\-setup@zramN\.service\fR, which will: +. +.IP "1." 4 +read configuration files from \fI{/etc,/lib}/systemd/zram\-generator\.conf[\.d]\fR (see zram\-generator\.conf(5) for details); +. +.IP "2." 4 +set the desired compression algorithm, if any; if the current kernel doesn\'t understand the specified algorithm, a warning is issued, but execution continues; +. +.IP "3." 4 +set the desired blockdev size and format it as swap with \fIsystemd\-makefs(8)\fR\. +. +.IP "" 0 +. +.P +Generated \fIpath\-to\-mount\-point\.mount\fR units depend on \fBsystemd\-zram\-setup@zramN\.service\fR\. The effect is similar to what happens for swap units, but of course they are formatted with a file system\. +. +.P +When the unit is stopped, the zram device is reset, freeing memory and allowing the device to be reused\. +. +.P +\fBzram\-generator\fR implements systemd\.generator(7)\. +. +.SS "Applying config changes" +This generator is invoked in early boot, and the devices it configures will be created very early too, so the easiest way to apply config changes is to simply reboot the machine\. +. +.P +Nevertheless, sometimes it may be useful to add new devices or apply config changes at runtime\. Applying new configuration means restarting the units, and that in turn means recreating the zram devices\. This means that \fIfile systems are temporarily unmounted and their contents lost\fR, and \fIpages are moved out of the compressed swap device\fR into other memory\. If this is acceptable, \fBsystemctl restart systemd\-zram\-setup@zramN\fR or \fBsystemctl restart systemd\-zram\-setup@*\fR may be used to recreate a specific device or all configured devices\. (If the device didn\'t exist, \fBrestart\fR will create it\.) If the way the device is used (e\.g\. the mount point or file system type) is changed, \fBsystemctl daemon\-reload\fR needs to be called first to recreate systemd units\. If a device or mount point is removed from configuration, the unit should be stopped before calling \fBdaemon\-reload\fR\. Otherwise, systemd will not know how to stop the unit properly\. +. +.SH "REPORTING BUGS" +\fIhttps://github\.com/systemd/zram\-generator/issues\fR +. +.SH "SEE ALSO" +zram\-generator\.conf(5), systemd\.generator(7), systemd\.swap(5) +. +.P +\fIhttps://github\.com/systemd/zram\-generator\fR +. +.P +Linux documentation of zram: \fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR +. +.br +and the zram sysfs ABI: \fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR diff --git a/zram-generator.changes b/zram-generator.changes new file mode 100644 index 0000000..a7ba043 --- /dev/null +++ b/zram-generator.changes @@ -0,0 +1,70 @@ +------------------------------------------------------------------- +Wed Jun 29 07:44:43 UTC 2022 - Benjamin Brunner + +- Fixed typo in description (bsc#1200961) +- Updated vendor.tar.xz + +------------------------------------------------------------------- +Mon May 2 07:54:51 UTC 2022 - Ferdinand Thiessen + +- Update to version 1.1.2: + * Stable release version +- Updated vendor.tar.xz + +------------------------------------------------------------------- +Wed Mar 02 14:18:21 UTC 2022 - bbrunner@suse.com + +- Update to version 1.1.1~git6.6923dc2: + * Suggest /var/compressed instead of /var/tmp in README + * Update install from source instruction +- Updated vendor.tar.xz + +------------------------------------------------------------------- +Fri Jan 7 01:26:50 UTC 2022 - William Brown + +Updated vendor.tar.xz to +- not create uninitialized values in smallvec-crate + (bsc#1194113, CVE-2018-25023) +- fix a possible data race and memory corruption when using a closed + `oneshot` channel in tokio-crate (bsc#1194119, CVE-2021-45710) + +------------------------------------------------------------------- +Fri Jan 07 01:25:47 UTC 2022 - bbrunner@suse.com + +- Update to version 1.1.1~git5.8612dbb: + * Update install from source instruction + * Document workaround for making zram mounts user-writable (c.f. #146) + * Issue warning if /s/b/z0/backing_dev doesn't exist and wb-dev= set + * Skip test if unshare fails + * Accept NOMAN in Makefile, disabling build: and install: manpage processing + * Version 1.1.1 + * Bump minimum rust-ini to 0.15, first one with ordered keys + * Don't CLONE_NEWUSER when already root. Privatise all mounts first + * Add Aqs around README mails + * Update my author mail + +------------------------------------------------------------------- +Fri Nov 26 15:16:23 UTC 2021 - Benjamin Brunner + +- Temporary pre-generate man-pages, to avoid dependency on + rubygem-ronn, which is no longer maintained + +------------------------------------------------------------------- +Thu Nov 11 08:54:15 UTC 2021 - Benjamin Brunner + +- 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 + +- Initial package for zram-generator (jsc#SLE-18818) diff --git a/zram-generator.conf.5 b/zram-generator.conf.5 new file mode 100644 index 0000000..42a4f49 --- /dev/null +++ b/zram-generator.conf.5 @@ -0,0 +1,248 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "ZRAM\-GENERATOR\.CONF" "5" "November 2021" "zram-generator developers" "" +. +.SH "NAME" +\fBzram\-generator\.conf\fR \- Systemd unit generator for zram swap devices (configuration) +. +.SH "SYNOPSIS" +\fB/usr/lib/systemd/zram\-generator\.conf\fR +. +.br +\fB/usr/local/lib/systemd/zram\-generator\.conf\fR +. +.br +\fB/etc/systemd/zram\-generator\.conf\fR +. +.br +\fB/run/systemd/zram\-generator\.conf\fR +. +.P +\fB/usr/lib/systemd/zram\-generator\.conf\.d/*\.conf\fR +. +.br +\fB/usr/local/lib/systemd/zram\-generator\.conf\.d/*\.conf\fR +. +.br +\fB/etc/systemd/zram\-generator\.conf\.d/*\.conf\fR +. +.br +\fB/run/systemd/zram\-generator\.conf\.d/*\.conf\fR +. +.SH "DESCRIPTION" +These files configure devices created by zram\-generator(8)\. See systemd\.syntax(5) for a general description of the syntax\. +. +.SH "CONFIGURATION DIRECTORIES AND PRECEDENCE" +The default configuration doesn\'t specify any devices\. Consult \fI/usr/share/zram\-generator/zram\-generator\.conf\.example\fR for an example configuration file\. +. +.P +When packages need to customize the configuration, they can install configuration snippets in \fI/usr/lib/systemd/zram\-generator\.conf\.d/\fR\. Files in \fI/etc/\fR are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages\. The main configuration file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration file\. Files in the \fI*\.conf\.d/\fR configuration subdirectories are sorted by their filename in lexicographic order, regardless of which of the subdirectories they reside in\. When multiple files specify the same option, for options which accept just a single value, the entry in the file with the lexicographically latest name takes precedence\. It is recommended to prefix all filenames in those subdirectories with a two\-digit number and a dash, to simplify the ordering of the files\. +. +.P +To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to \fI/dev/null\fR in the configuration directory in \fI/etc/\fR, with the same filename as the vendor configuration file\. +. +.P +The generator understands the following option on the kernel command\-line: \fBsystemd\.zram[=0|1]\fR\. When specified with a true argument (or no argument), the \fBzram0\fR device will be created\. Default options apply, but may be overridden by configuration on disk if present\. When specified with a false argument, no zram devices will be created by the generator\. This option thus has higher priority than the configuration files\. +. +.SH "OPTIONS" +Each device is configured independently in its \fB[zramN]\fR section, where N is a nonnegative integer\. Other sections are ignored\. +. +.P +Devices with the final size of \fI0\fR will be discarded\. +. +.IP "\(bu" 4 +\fBhost\-memory\-limit\fR= +. +.IP +Sets the upper limit on the total usable RAM (as defined by \fIMemTotal\fR in \fB/proc/meminfo\fR, confer proc(5)) above which the device will \fInot\fR be created\. +. +.IP +This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\. +. +.IP +Defaults to \fInone\fR\. +. +.IP "\(bu" 4 +\fBzram\-size\fR= +. +.IP +Sets the size of the zram device as a function of \fIMemTotal\fR, available as the \fBram\fR variable\. +. +.IP +Arithmetic operators (^%/*\-+), e, π, SI suffixes, log(), int(), ceil(), floor(), round(), abs(), min(), max(), and trigonometric functions are supported\. +. +.IP +Defaults to \fImin(ram / 2, 4096)\fR\. +. +.IP "\(bu" 4 +\fBcompression\-algorithm\fR= +. +.IP +Specifies the algorithm used to compress the zram device\. +. +.IP +This takes a literal string, representing the algorithm to use\. +. +.br +Consult \fI/sys/block/zram0/comp_algorithm\fR for a list of currently loaded compression algorithms, but note that additional ones may be loaded on demand\. +. +.IP +If unset, none will be configured and the kernel\'s default will be used\. +. +.IP "\(bu" 4 +\fBswap\-priority\fR= +. +.IP +Controls the relative swap priority, a value between \-1 and 32767\. Higher numbers indicate higher priority\. +. +.IP +If unset, 100 is used\. +. +.IP "\(bu" 4 +\fBmount\-point\fR= +. +.IP +Format the device with a file system (not as swap) and mount this file system over the specified directory\. When neither this option nor \fBfs\-type\fR= is specified, the device will be formatted as swap\. +. +.IP +Note that the device is temporary: contents will be destroyed automatically after the file system is unmounted (to release the backing memory)\. +. +.IP "\(bu" 4 +\fBfs\-type\fR= +. +.IP +Specifies how the device shall be formatted\. The default is \fIext2\fR if \fBmount\-point\fR is specified, and \fIswap\fR otherwise\. (Effectively, the device will be formatted as swap, if neither \fBfs\-type\fR= nor \fBmount\-point\fR= are specified\.) +. +.IP +Note that the device is temporary: contents will be destroyed automatically after the file system is unmounted (to release the backing memory)\. +. +.IP +Also see systemd\-makefs(8)\. +. +.IP "\(bu" 4 +\fBoptions\fR= +. +.IP +Sets mount or swapon options\. Availability depends on \fBfs\-type\fR\. +. +.IP +Defaults to \fIdiscard\fR\. +. +.IP "" 0 +. +.SH "ENVIRONMENT VARIABLES" +Setting \fBZRAM_GENERATOR_ROOT\fR during parsing will cause \fI/proc/meminfo\fR to be read from \fI$ZRAM_GENERATOR_ROOT/proc/meminfo\fR instead, and \fI{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram\-generator\.conf\fR to be read from \fI$ZRAM_GENERATOR_ROOT/{/usr/lib,/usr/local/lib,/etc,/run}/systemd/zram\-generator\.conf\fR\. +. +.SH "EXAMPLES" +The default configuration will yield the following: +. +.IP "" 4 +. +.nf + + zram device size + ^ + │ + 4G>│ ooooooooooooo + │ o + │ o + │ o + 2G>│ o + │ o + │ o +512M>│ o + 0───────────────────────> total usable RAM + ^ ^ ^ + 1G 4G 8G +. +.fi +. +.IP "" 0 +. +.P +A piecewise\-linear size 1:1 for the first 4G, then 1:2 above, up to a max of 32G: +. +.br +\~\~\fBzram\-size = min(min(ram, 4096) + max(ram \- 4096, 0) / 2, 32 * 1024)\fR +. +.IP "" 4 +. +.nf + + zram device size + ^ + 32G>| oooooooooooooo + | o + 30G>| o + | + /=/ + | + 8G>│ o + │ o + │ o + │ o + │ o + 4G>│ o + │ o + │ o + 1G>│ o + 0───────────────────────────────────||──────────────────────> total usable RAM + ^ ^ ^ ^ ^ ^ ^ + 1G 4G 8G 12G 56G 60G 64G +. +.fi +. +.IP "" 0 +. +.SH "OBSOLETE OPTIONS" +. +.IP "\(bu" 4 +\fBmemory\-limit\fR= +. +.IP +Compatibility alias for \fBhost\-memory\-limit\fR\. +. +.IP "\(bu" 4 +\fBzram\-fraction\fR= +. +.IP +Defines the scaling factor of the zram device\'s size with relation to the total usable RAM\. +. +.IP +This takes a nonnegative floating\-point number representing that factor\. +. +.IP +Defaulted to \fI0\.5\fR\. Setting this or \fBmax\-zram\-size\fR overrides \fBzram\-size\fR\. +. +.IP "\(bu" 4 +\fBmax\-zram\-size\fR= +. +.IP +Sets the limit on the zram device\'s size obtained by \fBzram\-fraction\fR\. +. +.IP +This takes a nonnegative number, representing that limit in megabytes, or the literal string \fInone\fR, which can be used to override a limit set earlier\. +. +.IP +Defaulted to \fI4096\fR\. Setting this or \fBzram\-fraction\fR overrides \fBzram\-size\fR\. +. +.IP "" 0 +. +.SH "REPORTING BUGS" +\fIhttps://github\.com/systemd/zram\-generator/issues\fR +. +.SH "SEE ALSO" +zram\-generator(8), systemd\.syntax(5), proc(5) +. +.P +\fIhttps://github\.com/systemd/zram\-generator\fR +. +.P +Linux documentation of zram: \fIhttps://kernel\.org/doc/html/latest/admin\-guide/blockdev/zram\.html\fR +. +.br +and the zram sysfs ABI: \fIhttps://kernel\.org/doc/Documentation/ABI/testing/sysfs\-block\-zram\fR +. +.P +\fBfasteval\fR documentation for the entire \fBzram\-size\fR arithmetic DSL: \fIhttps://docs\.rs/fasteval/0\.2\.4/fasteval/#the\-fasteval\-expression\-mini\-language\fR diff --git a/zram-generator.obsinfo b/zram-generator.obsinfo new file mode 100644 index 0000000..b00977f --- /dev/null +++ b/zram-generator.obsinfo @@ -0,0 +1,4 @@ +name: zram-generator +version: 1.1.2 +mtime: 1648455525 +commit: 1bf6b08d8bd15624280482b1c125902f90c706aa diff --git a/zram-generator.spec b/zram-generator.spec new file mode 100644 index 0000000..879bfa2 --- /dev/null +++ b/zram-generator.spec @@ -0,0 +1,81 @@ +# +# spec file for package zram-generator +# +# Copyright (c) 2022 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.1.2 +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 + +# pregenerated man-pages to avoid dependency on ronn +Source4: zram-generator.conf.5 +Source5: zram-generator.8 + +BuildRequires: cargo-packaging +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 +cp %{SOURCE4} man/ +cp %{SOURCE5} man/ + +%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 + +%install +%make_install SYSTEMD_SYSTEM_UNIT_DIR=%{_unitdir} SYSTEMD_SYSTEM_GENERATOR_DIR=%{_systemdgeneratordir} NOBUILD=1 + +%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