#global git .git2e7d7a6 #global git_build_cnt 0.1 %define build_cnt 1 Name: shadowsocks-libev Version: 3.3.0 Release: %{?git:%{git_build_cnt}%{git}%{?dist}}%{!?git:%{build_cnt}%{?dist}} Summary: A lightweight and secure socks5 proxy Group: Applications/Internet License: GPLv3+ URL: https://github.com/shadowsocks/%{name} Source0: %{?git:%{name}-%{version}%{git}.tar.xz}%{!?git:https://github.com/shadowsocks/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz} Source1: ss-server@.service Source2: ss-local@.service Source3: ss-tunnel@.service BuildRequires: pcre-devel BuildRequires: libev-devel BuildRequires: libsodium-devel >= 1.0.10 BuildRequires: mbedtls-devel >= 2.7.0 BuildRequires: c-ares-devel >= 1.10.0 BuildRequires: autoconf automake libtool gcc %{!?git:BuildRequires: asciidoc xmlto} Requires(pre): /usr/sbin/useradd Requires(postun): /usr/sbin/userdel %if 0%{?rhel} != 6 Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: systemd %endif %description shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes. %package devel Summary: Development files for shadowsocks-libev License: GPLv3+ %description devel Development files for shadowsocks-libev %prep %setup -q -n %{name}-%{version}%{?git:%{git}} ##autoreconf -fvi %build %configure --enable-shared \ %{?git:--disable-documentation} make clean make %{?_smp_mflags} V=1 %install make install DESTDIR=%{buildroot} mkdir -p %{buildroot}/etc/shadowsocks-libev %if 0%{?rhel} == 6 mkdir -p %{buildroot}%{_initddir} install -m 755 %{_builddir}/%{buildsubdir}/rpm/SOURCES/etc/init.d/shadowsocks-libev %{buildroot}%{_initddir}/shadowsocks-libev %else mkdir -p %{buildroot}%{_sysconfdir}/default mkdir -p %{buildroot}%{_unitdir} install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/ss-server@.service install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/ss-local@.service install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/ss-tunnel@.service #install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.default %{buildroot}%{_sysconfdir}/default/shadowsocks-libev #install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.service %{buildroot}%{_unitdir}/shadowsocks-libev.service %endif install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json find %{buildroot} -name *.la -delete %files %{_bindir}/ss-* %{_libdir}/libshadowsocks-libev.so.2* %config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json %{!?git:%doc %{_mandir}/*} %{!?git:%doc %{_docdir}/%{name}/*.html} %if 0%{?rhel} == 6 %{_initddir}/shadowsocks-libev %else %{_unitdir}/ss-server@.service %{_unitdir}/ss-local@.service %{_unitdir}/ss-tunnel@.service #%config(noreplace) %{_sysconfdir}/default/shadowsocks-libev %endif %files devel %{_includedir}/* %{_libdir}/pkgconfig/shadowsocks-libev.pc %{_libdir}/libshadowsocks-libev.so %pre if [ $1 == 1 ]; then echo "Adding user shadowsocks" /usr/bin/getent passwd shadowsocks > /dev/null || /usr/sbin/useradd -r -N -M -s /usr/sbin/nologin shadowsocks elif [ $1 == 2 ]; then echo "Stopping service" /usr/bin/systemctl stop ss-server@*.service ss-local@*.service ss-tunnel@*.service fi %post if [ $1 == 1 ]; then echo "Starting all services" /usr/bin/systemctl start ss-server@*.service ss-local@*.service ss-tunnel@*.service elif [ $1 == 2 ]; then echo "Reloading all services" /usr/bin/systemctl daemon-reload fi %preun if [ $1 == 0 ]; then echo "Stopping service" /usr/bin/systemctl stop ss-server@*.service ss-local@*.service ss-tunnel@*.service elif [ $1 == 1 ]; then echo "Restarting service" /usr/bin/systemctl restart ss-server@*.service ss-local@*.service ss-tunnel@*.service fi %postun if [ $1 == 0 ]; then echo "Removing user: $1" /usr/sbin/userdel -f shadowsocks > /dev/null fi %changelog * Mon Jun 17 2019 Yupeng Chang - 3.3.0-1 - Update to 3.3.0 * Mon Mar 18 2019 Yupeng Chang - 3.2.5-1 - Update to 3.2.5 * Wed Feb 27 2019 Yupeng Chang - 3.2.4-1 - Update to 3.2.4 * Fri Dec 14 2018 Yupeng Chang - 3.2.3-5 - Force delete user * Fri Dec 14 2018 Yupeng Chang - 3.2.3-4 - Add ss-tunnel@.service * Fri Dec 14 2018 Yupeng Chang - 3.2.3-3 - Fix rpm spec * Fri Dec 14 2018 Yupeng Chang - 3.2.3-2 - Update build spec, add shadowsocks user account - Add ss-server@service and ss-local@service * Wed Nov 28 2018 Yupeng Chang - 3.2.3-1 - Update to official release * Tue Nov 27 2018 Yupeng Chang - 3.2.2-1 - Update to official release * Thu Nov 22 2018 Yupeng Chang - 3.2.2-0.1 - Update to latest git * Thu Nov 08 2018 Yupeng Chang - 3.2.1-1 - Update to official release * Wed Oct 31 2018 Yupeng Chang - 3.2.1-0.7 - Rebuild for Fedora 29 * Fri Oct 19 2018 Yupeng Chang - 3.2.1-0.6 - Upgrade to latest git version * Fri Oct 19 2018 Yupeng Chang - 3.2.1-0.5 - Upgrade to latest git version * Tue Sep 18 2018 Yupeng Chang - 3.2.1-0.4 - Upgrade to latest git version * Mon Sep 10 2018 Yupeng Chang - 3.2.1-0.3 - Upgrade to latest git version * Fri Sep 07 2018 Yupeng Chang - 3.2.1-0.2 - Upgrade to latest git version * Fri Aug 31 2018 Yupeng Chang - 3.2.1-0.1 - Upgrade to latest git version * Tue May 29 2018 Yupeng Chang - 3.2.0-2 - Build with mbedtls 2.9.0 * Tue May 29 2018 Yupeng Chang - 3.2.0-1 - Update to the latest * Wed May 23 2018 Yupeng Chang - 3.1.4-0.4.git21fb6e6 - Build the latest git version * Mon May 07 2018 Yupeng Chang - 3.1.4-0.3.git8d3ce8b - Build the latest git version * Wed Apr 11 2018 Yupeng Chang - 3.1.4-0.2.gita9d5651 - Build the latest git version * Tue Apr 10 2018 Yupeng Chang - 3.1.4-0.1.gitdada99c - Build the latest git version * Thu Mar 01 2018 Yupeng Chang - 3.1.3-2 - Build against mbedtls 2.7.0 * Tue Jan 16 2018 Yupeng Chang - 3.1.3-1 - Update to latest release version * Fri Dec 29 2017 Yupeng Chang - 3.1.2-1 - Update to latest release version * Tue Nov 21 2017 Yupeng Chang - 3.1.1-1 - Update to latest release version * Sat Oct 21 2017 Yupeng Chang - 3.1.1-0.1.git54c7190 - Update to latest git version * Sat Oct 21 2017 Yupeng Chang - 3.1.0-2 - Build with libsodium 1.0.15 * Thu Sep 07 2017 Yupeng Chang - 3.0.9-0.1.gita09629d-1 - Update to latest git version * Thu Jul 27 2017 Yupeng Chang - 3.0.8-1 - Update to 3.0.8 * Thu Jun 29 2017 Yupeng Chang - 3.0.7-1 - Update to 3.0.7 * Thu Apr 27 2017 Yupeng Chang - 3.0.6-1 - Update to 3.0.6 * Tue Mar 21 2017 Yupeng Chang - 3.0.5-1 - Update to 3.0.5 * Fri Mar 17 2017 Yupeng Chang - 3.0.4-1 - Update to 3.0.4 * Wed Mar 01 2017 Yupeng Chang - 3.0.3-1 - Update to 3.0.3 * Mon Feb 13 2017 Yupeng Chang - 3.0.2-1 - Update to 3.0.2 * Wed Feb 08 2017 Yupeng Chang - 3.0.1-1 - Update to 3.0.1 * Mon Feb 06 2017 Yupeng Chang - 3.0.0-0.2.gitc5c8389-1 - Update to 3.0.0.gitc5c8389 * Mon Feb 06 2017 Yupeng Chang - 3.0.0-0.1.git726f110-1 - Update to 3.0.0.git726f110 * Tue Jan 24 2017 Yupeng Chang - 2.6.2-1 - Update to 2.6.2 * Fri Dec 30 2016 Yupeng Chang - 2.6.0-1 - Update to 2.6.0 * Sat Dec 17 2016 Yupeng Chang - 2.5.7-0.1.git6be61cc-1 - Update to latest git version 6be61cc * Sun Nov 06 2016 Yupeng Chang - 2.5.6-1 - Update tp latest release version 2.5.6 * Wed Oct 12 2016 Yupeng Chang - 2.5.5-1 - Update to latest release version 2.5.5 * Thu Sep 22 2016 Yupeng Chang - 2.5.3-1 - Update to latest release version 2.5.3 * Thu Sep 15 2016 Yupeng Chang - 2.5.2-1 - Update to latest release version 2.5.2 * Sun Sep 11 2016 Yupeng Chang - 2.5.1-1 - Update to latest release version 2.5.1 * Wed Aug 31 2016 Yupeng Chang - 2.5.0-1 - Update to latest release version 2.5.0 * Fri Aug 12 2016 Yupeng Chang - 2.4.8-0.4.git8f7241-1 - Update to latest git version 8f7241 * Sat Jul 23 2016 Yupeng Chang - 2.4.8-0.3.git119d9b-1 - Update to latest git version 119d9b * Sun Jul 17 2016 Yupeng Chang - 2.4.8-0.2.gitad17d9-1 - Update to latest git version ad17d9 - Fixing bugs when ss-server bind_address enabled * Sun Jul 03 2016 Yupeng Chang - 2.4.8-0.1.gitd4aabc-1 - Update to latest git version * Wed Jun 22 2016 Yupeng Chang - 2.4.7-1 - Update to 2.4.7