Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:X0F:branches:network
shadowsocks-rust
shadowsocks-rust.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File shadowsocks-rust.spec of Package shadowsocks-rust
# # spec file for package shadowsocks-rust # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: shadowsocks-rust Version: 1.21.2 Release: 0 Summary: Rust port of Shadowsocks License: MIT Group: Productivity/Networking/Web/Proxy URL: https://github.com/shadowsocks/shadowsocks-rust Source0: https://github.com/shadowsocks/shadowsocks-rust/archive/v%{version}/%{name}-%{version}.tar.gz Source1: vendor.tar.gz Source2: %{name}.json Source3: %{name}-client.service Source4: %{name}-server.service Source5: %{name}-manager.service # PATCH-FIX-UPSTREAM https://github.com/AlephAlpha/build-time/pull/5 Patch0: reproducible.patch BuildRequires: cargo BuildRequires: cargo-packaging BuildRequires: clang BuildRequires: lld #BuildRequires: libtool BuildRequires: memory-constraints BuildRequires: mbedtls-devel BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(libev) BuildRequires: pkgconfig(libpcre2-posix) BuildRequires: pkgconfig(libsodium) BuildRequires: pkgconfig(openssl) #BuildRequires: rustup BuildRequires: udns-devel Requires(pre): shadow Recommends: shadowsocks-v2ray-plugin # ExcludeArch: ppc ppc64 ppc64le s390 s390x %{?systemd_ordering} %description shadowsocks-rust is a rust port of shadowsocks. shadowsocks is a lightweight secured SOCKS5 proxy for embedded devices and low-end boxes. %prep %autosetup -p1 -a1 -n %{name}-%{version} rm -fv rust-toolchain || echo "no rust-toolchain" mkdir .cargo cat >>.cargo/config.toml <<EOF [source.crates-io] registry = 'https://github.com/rust-lang/crates.io-index' replace-with = 'vendored-sources' [source.vendored-sources] directory = 'vendor' [patch.crates-io] crypto2 = { path = "vendor/crypto2" } [term] verbose = true EOF sed -i '/\#\!\[feature/d' vendor/crypto2/src/lib.rs #find . -iname "Cargo.lock" -delete # https://blogs.gnome.org/mcatanzaro/2020/05/18/patching-vendored-rust-dependencies/ #find . -iname "*cargo-checksum*" -exec sed -i -e 's|{"files"\:{.*},"package"|{"files"\:\{\},"package"|' "{}" \; # ugly workaround for retarded rust/cargo not being able to disable options: just cut them out of the config sed -i -e '/local-http-native-tls/d' \ -e '/tcmalloc-vendored/d' \ -e '/snmalloc/d' \ -e '/mimalloc/d' \ -e '/tcmalloc/d' \ -e '/rpmalloc/d' \ Cargo.toml %build %limit_build -m 3072 %ifarch x86_64 # some dep-packages fail with full set sed -i -e ':"target-feature=+sse:"target-feature=+avx,+rdrand,+f16c,+sse:g' .cargo/config.toml #export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+sse,+sse2,+sse4.1,+sse4.2,+avx,+rdrand,+f16c" %endif export RUSTFLAGS="${RUSTFLAGS} -Clinker=clang -Clink-arg=-fuse-ld=lld -Clinker-plugin-lto -Cembed-bitcode=yes -Ccodegen-units=2 -Clto=thin" # also force stripping with '-S/-s' as cargo is so retarded that it can't figure out to do so by itself since 2018: https://github.com/rust-lang/cargo/issues/3483 export RUSTFLAGS="${RUSTFLAGS} -v -Copt-level=3 -Cpanic=unwind -Clink-arg=-Wl,-z,relro,-z,now,-S,--gc-sections,--print-gc-sections,--icf=safe,%{?jobs:--thinlto-jobs=%jobs} -Cdebuginfo=2" cargo build %{?jobs:-j%jobs} --offline --release --all-features %install %cargo_install install -d %{buildroot}%{_sysconfdir}/shadowsocks/ install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/shadowsocks/ install -d %{buildroot}%{_unitdir} install -m 0644 %{SOURCE3} %{buildroot}%{_unitdir} install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir} install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir} install -d %{buildroot}%{_sbindir} ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-client ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-server ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-manager #ln -sfv %{buildroot}%{_bindir}/sslocal ssservice #ln -sfv %{buildroot}%{_bindir}/ssserver ssservice #ln -sfv %{buildroot}%{_bindir}/ssmanager ssservice %pre %service_add_pre %{name}-client.service %service_add_pre %{name}-server.service %service_add_pre %{name}-manager.service getent group shadowsocks >/dev/null || %{_sbindir}/groupadd --system shadowsocks getent passwd shadowsocks >/dev/null || %{_sbindir}/useradd --system -c "shadowsocks User" \ -d %{_localstatedir}/shadowsocks -m -g shadowsocks -s %{_sbindir}/nologin \ shadowsocks %post %service_add_post %{name}-client.service %service_add_post %{name}-server.service %service_add_post %{name}-manager.service chown root:shadowsocks %{_sysconfdir}/shadowsocks -R chmod 640 %{_sysconfdir}/shadowsocks -R %preun %service_del_preun %{name}-client.service %service_del_preun %{name}-server.service %service_del_preun %{name}-manager.service %postun %service_del_postun %{name}-client.service %service_del_postun %{name}-server.service %service_del_postun %{name}-manager.service %files %doc README.md %license LICENSE %{_bindir}/ss* %{_sbindir}/rc%{name}-* %{_unitdir}/%{name}-*.service %dir %{_sysconfdir}/shadowsocks # %config(noreplace) %attr(660,%{name},root) %{_sysconfdir}/shadowsocks %config %{_sysconfdir}/shadowsocks/%{name}.json %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor