From 5d53b4efdae030ab6f2c9c2b0cce6d4d478014e6 Mon Sep 17 00:00:00 2001 From: blinxen Date: Fri, 21 Jul 2023 09:38:52 +0200 Subject: [PATCH] Initial package (rhbz#2224327) --- .gitignore | 1 + README.md | 3 -- rust-human_format.spec | 80 ++++++++++++++++++++++++++++++++++++++++++ rust2rpm.conf | 2 ++ sources | 1 + 5 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 rust-human_format.spec create mode 100644 rust2rpm.conf create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..99cda95 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/human_format-1.0.3.crate diff --git a/README.md b/README.md deleted file mode 100644 index d133e30..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-human_format - -The rust-human_format package diff --git a/rust-human_format.spec b/rust-human_format.spec new file mode 100644 index 0000000..fa76b54 --- /dev/null +++ b/rust-human_format.spec @@ -0,0 +1,80 @@ +# Generated by rust2rpm 24 +# Deactivate tests because of missing dependency: galvanic-test (rhbz#2224175) +%bcond_with check +%global debug_package %{nil} + +%global crate human_format + +Name: rust-human_format +Version: 1.0.3 +Release: %autorelease +Summary: Converts a number to/from a human readable string + +License: MIT +URL: https://crates.io/crates/human_format +Source: %{crates_source} + +BuildRequires: rust-packaging >= 21 +BuildRequires: dos2unix + +%global _description %{expand: +Rust Port of human-format from node, formatting numbers for us, while +the machines are still at bay.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license %{crate_instdir}/LICENSE +%doc %{crate_instdir}/README.md +%doc %{crate_instdir}/changelog.md +%{crate_instdir}/ + +%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 the "default" feature of the "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +# Fix EOL encodings +for f in src/lib.rs changelog.md README.md; do + # Keep timestamp of the old file + touch -r $f $f.tstamp + dos2unix $f + touch -r $f.tstamp $f + rm $f.tstamp +done +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/rust2rpm.conf b/rust2rpm.conf new file mode 100644 index 0000000..5207d1e --- /dev/null +++ b/rust2rpm.conf @@ -0,0 +1,2 @@ +[DEFAULT] +summary = Converts a number to/from a human readable string diff --git a/sources b/sources new file mode 100644 index 0000000..59f6706 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (human_format-1.0.3.crate) = a91357f791c136db826fc4704266b20d7acbbf681cf4b4c7e43ef3ae33f22a31bbbda13feccdddeb33619ceab61ff593ae431ad2816645e8a4d6c6d7b48dde77