diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index e69de29..dc86230 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/rpm-sequoia-1.6.0.crate +/rpm-sequoia-1.6.0-vendor.tar.xz diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..88beae7 --- /dev/null +++ b/ci.fmf @@ -0,0 +1 @@ +resultsdb-testcase: separate \ No newline at end of file diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..83b2ff2 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,9 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/ci/fips-disabled-buildroot-disabled.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/ci/fips-disabled-buildroot-enabled.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/ci/fips-enabled-buildroot-disabled.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build./plans/ci/fips-enabled-buildroot-enabled.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..a47e0ba --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,23 @@ +/fips-disabled-buildroot-disabled: + plan: + import: + url: https://pkgs.devel.redhat.com/git/tests/rust-rpm-sequoia + name: /plans/ci/fips-disabled-buildroot-disabled + +/fips-disabled-buildroot-enabled: + plan: + import: + url: https://pkgs.devel.redhat.com/git/tests/rust-rpm-sequoia + name: /plans/ci/fips-disabled-buildroot-enabled + +/fips-enabled-buildroot-disabled: + plan: + import: + url: https://pkgs.devel.redhat.com/git/tests/rust-rpm-sequoia + name: /plans/ci/fips-enabled-buildroot-disabled + +/fips-enabled-buildroot-enabled: + plan: + import: + url: https://pkgs.devel.redhat.com/git/tests/rust-rpm-sequoia + name: /plans/ci/fips-enabled-buildroot-enabled diff --git a/rpm-sequoia-fix-metadata.diff b/rpm-sequoia-fix-metadata.diff new file mode 100644 index 0000000..bcfd32f --- /dev/null +++ b/rpm-sequoia-fix-metadata.diff @@ -0,0 +1,17 @@ +--- rpm-sequoia-1.6.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ rpm-sequoia-1.6.0/Cargo.toml 2024-01-25T14:12:35.470987+00:00 +@@ -73,13 +73,9 @@ + version = "0.1.4" + + [features] +-crypto-botan = ["sequoia-openpgp/crypto-botan"] +-crypto-botan2 = ["sequoia-openpgp/crypto-botan2"] +-crypto-cng = ["sequoia-openpgp/crypto-cng"] + crypto-nettle = ["sequoia-openpgp/crypto-nettle"] + crypto-openssl = ["sequoia-openpgp/crypto-openssl"] +-crypto-rust = ["sequoia-openpgp/crypto-rust"] +-default = ["crypto-nettle"] ++default = ["crypto-openssl"] + + [badges.maintenance] + status = "actively-developed" diff --git a/rust-rpm-sequoia.spec b/rust-rpm-sequoia.spec new file mode 100644 index 0000000..91ffcfd --- /dev/null +++ b/rust-rpm-sequoia.spec @@ -0,0 +1,117 @@ +# Generated by rust2rpm 25 +%bcond_without check + +# RHEL does not have packages for Rust dependencies +%if 0%{?rhel} +%global bundled_rust_deps 1 +%else +%global bundled_rust_deps 0 +%endif + +%global crate rpm-sequoia + +Name: rust-rpm-sequoia +Version: 1.6.0 +Release: %autorelease +Summary: Implementation of the RPM PGP interface using Sequoia + +License: LGPL-2.0-or-later +URL: https://crates.io/crates/rpm-sequoia +Source: %{crates_source} +# To create the vendor tarball: +# tar xf %%{crate}-%%{version}.crate ; pushd %%{crate}-%%{version} ; \ +# patch -p1 < ../rpm-sequoia-fix-metadata.diff ; \ +# cargo vendor --versioned-dirs && tar Jcvf ../%%{crate}-%%{version}-vendor.tar.xz vendor/ ; popd +Source1: %{crate}-%{version}-vendor.tar.xz +# Manually created patch for downstream crate metadata changes +# * default to the OpenSSL crypto backend of sequoia-openpgp +Patch: rpm-sequoia-fix-metadata.diff + +%if 0%{?bundled_rust_deps} +BuildRequires: rust-toolset +# vendored openssl-sys +BuildRequires: openssl-devel +%else +BuildRequires: cargo-rpm-macros >= 24 +%endif + +%global _description %{expand: +An implementation of the RPM PGP interface using Sequoia.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +# (MIT OR Apache-2.0) AND Unicode-DFS-2016 +# Apache-2.0 +# Apache-2.0 OR MIT +# BSL-1.0 +# LGPL-2.0-or-later +# MIT +# MIT OR Apache-2.0 +# MIT OR Apache-2.0 OR Zlib +# Unlicense OR MIT +# Zlib OR Apache-2.0 OR MIT +License: LGPL-2.0-or-later AND Apache-2.0 AND BSL-1.0 AND MIT AND Unicode-DFS-2016 AND (Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT) +# LICENSE.dependencies contains a full license breakdown + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE.txt +%license LICENSE.dependencies +%if 0%{?bundled_rust_deps} +%license cargo-vendor.txt +%endif +%doc README.md +%{_libdir}/librpm_sequoia.so.1 + +%package -n %{crate}-devel +Summary: %{summary} +Requires: %{crate}%{?_isa} = %{version}-%{release} + +%description -n %{crate}-devel %{_description} + +%files -n %{crate}-devel +%{_libdir}/librpm_sequoia.so +%{_libdir}/pkgconfig/rpm-sequoia.pc + +%prep +%autosetup -n %{crate}-%{version} -p1 %{?bundled_rust_deps:-a1} +%if 0%{?bundled_rust_deps} +%cargo_prep -v vendor +%else +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires +%endif + +%build +# build script uses environment variables to populate the pkgconfig file +export PREFIX="%{_prefix}" +export LIBDIR="%{_libdir}" +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies +%if 0%{?bundled_rust_deps} +%cargo_vendor_manifest +%endif + +%install +# install shared library +mkdir -p %{buildroot}/%{_libdir} +cp -pav target/release/librpm_sequoia.so %{buildroot}/%{_libdir}/librpm_sequoia.so.1 +# create unversioned symlink +ln -s librpm_sequoia.so.1 %{buildroot}/%{_libdir}/librpm_sequoia.so +# install pkg-config file +mkdir -p %{buildroot}/%{_libdir}/pkgconfig +cp -pav target/release/rpm-sequoia.pc %{buildroot}/%{_libdir}/pkgconfig/ + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..3bb082f --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (rpm-sequoia-1.6.0.crate) = d1e989d6ffc31acf4538c99365d4e3b52ff3d756ddcb9cbb5aa6a3ed9d5785930d928e3a081f6d5dfcc830b15ef21bb73a441b3fe232b1548522aa696f85ba51 +SHA512 (rpm-sequoia-1.6.0-vendor.tar.xz) = 63674d7b796c7b3d9a38dfb0f0485b98b9a71d12f9f9888b3b389f4d2452779ba511dae204c7021ad1d3d3beab4f809a45f4d25a0c492886558601ed84b9a4d2