diff --git a/0001-set-cargo-vendor-cache-for-local-build.patch b/0001-set-cargo-vendor-cache-for-local-build.patch new file mode 100644 index 0000000..1becf64 --- /dev/null +++ b/0001-set-cargo-vendor-cache-for-local-build.patch @@ -0,0 +1,25 @@ +From 2a03d6375707d5184ebacb3b17e08395bb88dd61 Mon Sep 17 00:00:00 2001 +From: desert-sailor +Date: Sun, 2 Jul 2023 08:56:49 +0800 +Subject: [PATCH] set cargo vendor cache for local build + +--- + .cargo/config.toml | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/.cargo/config.toml b/.cargo/config.toml +index bff29e6..a4b6e34 100644 +--- a/.cargo/config.toml ++++ b/.cargo/config.toml +@@ -1,2 +1,8 @@ + [build] + rustflags = ["--cfg", "tokio_unstable"] ++ ++[source.crates-io] ++replace-with = "vendored-sources" ++ ++[source.vendored-sources] ++directory = "vendor" +-- +2.33.0 + diff --git a/cargo-vendor-cache b/cargo-vendor-cache new file mode 100644 index 0000000..1f0c8b1 Binary files /dev/null and b/cargo-vendor-cache differ diff --git a/mitmproxy_wireguard-0.1.23.tar.gz b/mitmproxy_wireguard-0.1.23.tar.gz new file mode 100644 index 0000000..a574877 Binary files /dev/null and b/mitmproxy_wireguard-0.1.23.tar.gz differ diff --git a/python-mitmproxy-wireguard.spec b/python-mitmproxy-wireguard.spec new file mode 100644 index 0000000..6b61c83 --- /dev/null +++ b/python-mitmproxy-wireguard.spec @@ -0,0 +1,54 @@ +%global _empty_manifest_terminate_build 0 +%global pypi_name mitmproxy-wireguard +%global source_name mitmproxy_wireguard + +Name: python-%{pypi_name} +Version: 0.1.23 +Release: 1 +Summary: WireGuard interface for mitmproxy. + +License: MIT +URL: https://github.com/decathorpe/mitmproxy_wireguard +Source0: %{url}/archive/%{version}/%{source_name}-%{version}.tar.gz +Source1: cargo-vendor-cache +Patch1: 0001-set-cargo-vendor-cache-for-local-build.patch + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-setuptools-rust +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-hatchling +BuildRequires: python3-maturin +BuildRequires: rust-packaging + +%description +WireGuard interface for mitmproxy. + + +%package -n python3-%{pypi_name} +Summary: %{summary} + +%description -n python3-%{pypi_name} +WireGuard interface for mitmproxy. + + +%prep +%autosetup -p1 -n %{source_name}-%{version} +tar xzvf %{SOURCE1} -C . + +%build +%pyproject_build + +%install +%pyproject_install + +%files -n python3-%{pypi_name} +%doc README.md +%license LICENSE +%{python3_sitearch}/mitmproxy_wireguard +%{python3_sitearch}/mitmproxy_wireguard*.dist-info/ + +%changelog +* Tue Jun 27 2023 Dongxing Wang - 0.1.23-1 +- Initial package