summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packaging/LICENSE-MIT25
-rw-r--r--packaging/rust-difflib.manifest5
-rw-r--r--packaging/rust-difflib.spec65
3 files changed, 95 insertions, 0 deletions
diff --git a/packaging/LICENSE-MIT b/packaging/LICENSE-MIT
new file mode 100644
index 0000000..39df3da
--- /dev/null
+++ b/packaging/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2019 Alan Somers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/packaging/rust-difflib.manifest b/packaging/rust-difflib.manifest
new file mode 100644
index 0000000..017d22d
--- /dev/null
+++ b/packaging/rust-difflib.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/rust-difflib.spec b/packaging/rust-difflib.spec
new file mode 100644
index 0000000..5d8da26
--- /dev/null
+++ b/packaging/rust-difflib.spec
@@ -0,0 +1,65 @@
+# Generated by rust2rpm 23
+%global _rpm_strip_disable 1
+%global debug_package %{nil}
+
+%global crate difflib
+%global real_crate_name difflib
+%global rustc_edition 2015
+
+Name: rust-difflib
+Version: 0.4.0
+Release: 1
+Summary: Port of Python's difflib library to Rust
+
+License: MIT
+URL: https://crates.io/crates/difflib
+Source: %{crate}-%{version}.tar.gz
+Source1: %{name}.manifest
+Source2: LICENSE-MIT
+
+# ==========================================================
+# BuildRequires
+# specifies build-time dependencies for the package
+# ==========================================================
+BuildRequires: rust
+
+
+
+%description
+Port of Python's difflib library to Rust.
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+cp %{SOURCE2} .
+
+# ==========================================================
+# build section
+# crate-type : dylib, proc-macro, cdylib, bin, etc.
+# ==========================================================
+%build
+%{rustc_std_build} --crate-type=dylib \
+ --crate-name=%{real_crate_name} \
+ %{?rustc_edition:--edition=%{rustc_edition}} \
+ ./src/lib.rs
+
+# ==========================================================
+# install section
+# ==========================================================
+%install
+install -d -m 0755 %{buildroot}%{_rust_dylibdir}
+install -m 0644 lib%{real_crate_name}.so %{buildroot}/%{_rust_dylibdir}/lib%{real_crate_name}.so
+
+%clean
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+# ==========================================================
+# files section
+# ==========================================================
+%files
+%manifest %{name}.manifest
+%license LICENSE-MIT
+%{_rust_dylibdir}/lib%{real_crate_name}.so