Skip to content

Commit

Permalink
Merge pull request #2896 from ohkinozomu/pigz
Browse files Browse the repository at this point in the history
Add pigz for parallel decompression by containerd
  • Loading branch information
stmcginnis authored Mar 16, 2023
2 parents 5837a6e + e2b7cfc commit 38d4f6a
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Our sample package has the following manifest.
[package]
name = "libwoof"
version = "0.1.0"
edition = "2018"
edition = "2021"
publish = false
build = "build.rs"

Expand Down
1 change: 1 addition & 0 deletions packages/containerd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ glibc = { path = "../glibc" }
# RPM Requires
[dependencies]
runc = { path = "../runc" }
pigz = { path = "../pigz" }
1 change: 1 addition & 0 deletions packages/containerd/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Source1000: clarify.toml
BuildRequires: git
BuildRequires: %{_cross_os}glibc-devel
Requires: %{_cross_os}runc
Requires: %{_cross_os}pigz

%description
%{summary}.
Expand Down
22 changes: 22 additions & 0 deletions packages/pigz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "pigz"
version = "0.1.0"
edition = "2021"
publish = false
build = "build.rs"

[lib]
path = "pkg.rs"

[[package.metadata.build-package.external-files]]
url = "https://zlib.net/pigz/pigz-2.7.tar.gz"
sha512 = "9f9f61de4a0307fc057dc4e31a98bd8d706d9e709ecde0be02a871534fddf6a1fe1321158aa72708603aaaece43f83d2423b127f7689b6219b23aea4f989e8f5"

# RPM BuildRequires
[build-dependencies]
glibc = { path = "../glibc" }
libz = { path = "../libz" }

# RPM Requires
[dependencies]
# None
9 changes: 9 additions & 0 deletions packages/pigz/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::process::{exit, Command};

fn main() -> Result<(), std::io::Error> {
let ret = Command::new("buildsys").arg("build-package").status()?;
if !ret.success() {
exit(1);
}
Ok(())
}
35 changes: 35 additions & 0 deletions packages/pigz/pigz.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Name: %{_cross_os}pigz
Version: 2.7
Release: 1%{?dist}
Summary: pigz is a parallel implementation of gzip which utilizes multiple cores
License: Zlib AND Apache-2.0
URL: http://www.zlib.net/pigz
Source0: https://zlib.net/pigz/pigz-%{version}.tar.gz
BuildRequires: %{_cross_os}glibc-devel
BuildRequires: %{_cross_os}libz-devel

%description
%{summary}.

%prep
%autosetup -n pigz-%{version} -p1

%global set_env \
%set_cross_build_flags \\\
export CC=%{_cross_target}-gcc \\\
%{nil}

%build
%set_env
%make_build CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"

%install
install -d %{buildroot}%{_cross_bindir}
install -p -m 0755 unpigz %{buildroot}%{_cross_bindir}

%files
%license README zopfli/COPYING
%{_cross_bindir}/unpigz
%{_cross_attribution_file}

%changelog
1 change: 1 addition & 0 deletions packages/pigz/pkg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// not used
9 changes: 9 additions & 0 deletions variants/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 38d4f6a

Please sign in to comment.