From 9a6f1997162d55f5469bef020d5279f03bd0ec67 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Sun, 22 Jan 2023 21:12:54 -0600 Subject: [PATCH] Initial Fedora package Signed-off-by: Michel Alexandre Salim --- .gitignore | 1 + rust-stats_alloc.spec | 71 ++++++++++++++++++++++++++++++++++++ rust2rpm.conf | 3 ++ sources | 1 + stats_alloc-add-license.diff | 51 ++++++++++++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 .gitignore create mode 100644 rust-stats_alloc.spec create mode 100644 rust2rpm.conf create mode 100644 sources create mode 100644 stats_alloc-add-license.diff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..199b2aa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/stats_alloc-0.1.10.crate diff --git a/rust-stats_alloc.spec b/rust-stats_alloc.spec new file mode 100644 index 0000000..62f8b2d --- /dev/null +++ b/rust-stats_alloc.spec @@ -0,0 +1,71 @@ +# Generated by rust2rpm 23 +%bcond_without check +%global debug_package %{nil} + +%global crate stats_alloc + +Name: rust-stats_alloc +Version: 0.1.10 +Release: %autorelease +Summary: Allocator wrapper that allows for instrumenting global allocators + +License: MIT +URL: https://crates.io/crates/stats_alloc +Source: %{crates_source} +# Add missing license text +Patch: https://github.com/neoeinstein/stats_alloc/pull/7.patch#/stats_alloc-add-license.diff + +BuildRequires: rust-packaging >= 21 + +%global _description %{expand: +Allocator wrapper that allows for instrumenting global allocators.} + +%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}/CHANGELOG.md +%doc %{crate_instdir}/README.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 +%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..1715b93 --- /dev/null +++ b/rust2rpm.conf @@ -0,0 +1,3 @@ +[DEFAULT] +unwanted-features = + nightly diff --git a/sources b/sources new file mode 100644 index 0000000..a24d42f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (stats_alloc-0.1.10.crate) = 5c51094c5632df92ac1a1ea5e02887344c691fe4da79071fb355ad6b757b0342a6ca23979cd68117d4e383bff61da70228b88b453d08327ee47454a64e6fa453 diff --git a/stats_alloc-add-license.diff b/stats_alloc-add-license.diff new file mode 100644 index 0000000..5dca84a --- /dev/null +++ b/stats_alloc-add-license.diff @@ -0,0 +1,51 @@ +From 60c1c1b295c5398401bf8f43aebd3794a543f84f Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Sun, 22 Jan 2023 14:04:40 -0600 +Subject: [PATCH] Add license text +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This project is MIT licensed; the license terms require that +redistributed sources (e.g. that carried by Linux distributions) contain +a copy of the license text. + +``` +stats_alloc on  add-license [+] +❯ cargo package --allow-dirty --no-verify + Packaging stats_alloc v0.1.10 (/home/michel/src/github/neoeinstein/stats_alloc) + +stats_alloc on  add-license [+] +❯ tar tf target/package/stats_alloc-0.1.10.crate | grep LICENSE +stats_alloc-0.1.10/LICENSE +``` + +Signed-off-by: Michel Alexandre Salim +--- + LICENSE | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + create mode 100644 LICENSE + +diff --git a/LICENSE b/LICENSE +new file mode 100644 +index 0000000..d5075a3 +--- /dev/null ++++ b/LICENSE +@@ -0,0 +1,17 @@ ++Permission is hereby granted, without written agreement and without ++license or royalty fees, to use, copy, modify, and distribute this ++software and its documentation for any purpose, provided that the ++above copyright notice and the following two paragraphs appear in ++all copies of this software. ++ ++IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR ++DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ++ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN ++IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ++DAMAGE. ++ ++THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, ++BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ++FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ++ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO ++PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.