%bcond_without test %global debug_package %{nil} Name: shadowsocks-rust Version: 1.21.0 Release: 1%{?dist} Summary: A Rust port of shadowsocks License: MIT URL: https://github.com/shadowsocks/shadowsocks-rust Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: %{name}-local@.service.system Source2: %{name}-server@.service.system Source3: %{name}-local@.service.user Source4: %{name}-server@.service.user Source5: %{name}.conf.sysusers BuildRequires: gcc BuildRequires: systemd-rpm-macros %if 0%{?el8} || 0%{?el9} || 0%{?amzn} %else BuildRequires: cargo >= 1.74 BuildRequires: rust >= 1.74 %endif %description This is a port of shadowsocks. shadowsocks is a fast tunnel proxy that helps you bypass firewalls. %prep %autosetup %if 0%{?el8} || 0%{?el9} || 0%{?amzn} curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y %endif %build %if 0%{?el8} || 0%{?el9} || 0%{?amzn} source "$HOME/.cargo/env" %endif RUSTFLAGS='-C strip=symbols' cargo build --release %if %{with test} %check %if 0%{?el8} || 0%{?el9} || 0%{?amzn} source "$HOME/.cargo/env" %endif cargo test %endif %install # Binary for BIN_NAME in sslocal ssserver ssurl ssmanager ssservice; do install -D -p -m 755 target/release/${BIN_NAME} %{buildroot}%{_bindir}/${BIN_NAME} done # Systemd mkdir -p %{buildroot}%{_unitdir} install -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}-local@.service install -D -p -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}-server@.service mkdir -p %{buildroot}%{_userunitdir} install -D -p -m 644 %{SOURCE3} %{buildroot}%{_userunitdir}/%{name}-local@.service install -D -p -m 644 %{SOURCE4} %{buildroot}%{_userunitdir}/%{name}-server@.service mkdir -p %{buildroot}%{_sysusersdir} install -D -p -m 644 %{SOURCE5} %{buildroot}%{_sysusersdir}/%{name}.conf # Empty config dirs mkdir -p %{buildroot}%{_sysconfdir}/%{name}/{local,server} # Example configs install -D -p -m 644 examples/config.json %{buildroot}%{_sysconfdir}/%{name}/example/config.json5 install -D -p -m 644 examples/config_ext.json %{buildroot}%{_sysconfdir}/%{name}/example/config_ext.json5 %post %systemd_post %{name}-local@.service.system %systemd_post %{name}-server@.service.system %systemd_user_post %{name}-local@.service.user %systemd_user_post %{name}-server@.service.user # systemd-sysusers %preun %systemd_preun %{name}-local@.service.system %systemd_preun %{name}-server@.service.system %systemd_user_preun %{name}-local@.service.user %systemd_user_preun %{name}-server@.service.user %files %license LICENSE %doc README.md %{_bindir}/sslocal %{_bindir}/ssmanager %{_bindir}/ssserver %{_bindir}/ssservice %{_bindir}/ssurl %{_sysusersdir}/*.conf %{_unitdir}/*.service %{_userunitdir}/*.service %config %{_sysconfdir}/%{name}/* %changelog * Wed Feb 07 2024 Artem Polishchuk - 1.18.0-1 - chore: Update to latest release (no more manual Spec changelog updates) * Thu Feb 01 2024 Artem Polishchuk - 1.17.2-1 - chore: Update to latest release * Sun Nov 26 2023 Artem Polishchuk - 1.17.1-1 - chore: Update to 1.17.1 * Sun Oct 15 2023 Artem Polishchuk - 1.17.0-1 - chore: Update to 1.17.0 * Sat Sep 23 2023 Artem Polishchuk - 1.16.2-1 - chore: Update to 1.16.2 * Fri Sep 01 2023 Artem Polishchuk - 1.16.1-1 - chore: Update to 1.16.1 * Sat Aug 26 2023 Artem Polishchuk - 1.16.0-1 - chore: Update to 1.16.0 * Sun Jul 30 2023 Artem Polishchuk - 1.15.4-1 - build: Adapt for Fedora and minor improvements - build: Switch to native Fedora Rust toolchain * Sat Jul 16 2022 spyophobia - 1.14.3-1 - Release 1.14.3