You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.2 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. Name: shadowsocks-libev
  2. Version: 2.4.0
  3. Release: 1%{?dist}
  4. Summary: A lightweight and secure socks5 proxy
  5. Group: Applications/Internet
  6. License: GPLv3+
  7. URL: https://github.com/madeye/%{name}
  8. Source0: %{url}/archive/v%{version}.tar.gz
  9. BuildRequires: openssl-devel
  10. Requires: openssl
  11. %if 0%{?rhel} != 6
  12. Requires(post): systemd
  13. Requires(preun): systemd
  14. Requires(postun): systemd
  15. BuildRequires: systemd
  16. %endif
  17. Conflicts: python-shadowsocks python3-shadowsocks
  18. AutoReq: no
  19. %description
  20. shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes.
  21. %prep
  22. %setup -q
  23. %build
  24. %configure --enable-shared
  25. make %{?_smp_mflags}
  26. %install
  27. make install DESTDIR=%{buildroot}
  28. mkdir -p %{buildroot}/etc/shadowsocks-libev
  29. %if 0%{?rhel} == 6
  30. mkdir -p %{buildroot}%{_initddir}
  31. install -m 755 %{_builddir}/%{buildsubdir}/rpm/SOURCES/etc/init.d/shadowsocks-libev %{buildroot}%{_initddir}/shadowsocks-libev
  32. %else
  33. mkdir -p %{buildroot}%{_sysconfdir}/default
  34. mkdir -p %{buildroot}%{_unitdir}
  35. install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.default %{buildroot}%{_sysconfdir}/default/shadowsocks-libev
  36. install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.service %{buildroot}%{_unitdir}/shadowsocks-libev.service
  37. %endif
  38. install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json
  39. %post
  40. %if 0%{?rhel} == 6
  41. /sbin/chkconfig --add shadowsocks-libev
  42. %else
  43. %systemd_post shadowsocks-libev.service
  44. %endif
  45. %preun
  46. %if 0%{?rhel} == 6
  47. if [ $1 -eq 0 ]; then
  48. /sbin/service shadowsocks-libev stop
  49. /sbin/chkconfig --del shadowsocks-libev
  50. fi
  51. %else
  52. %systemd_preun shadowsocks-libev.service
  53. %endif
  54. %if 0%{?rhel} != 6
  55. %postun
  56. %systemd_postun_with_restart shadowsocks-libev.service
  57. %endif
  58. %files
  59. %{_bindir}/*
  60. %{_libdir}/*
  61. %config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json
  62. %doc %{_mandir}/*
  63. %if 0%{?rhel} == 6
  64. %{_initddir}/shadowsocks-libev
  65. %else
  66. %{_unitdir}/shadowsocks-libev.service
  67. %config(noreplace) %{_sysconfdir}/default/shadowsocks-libev
  68. %endif
  69. %package devel
  70. Summary: Development files for shadowsocks-libev
  71. License: GPLv3+
  72. %description devel
  73. Development files for shadowsocks-libev
  74. %files devel
  75. %{_includedir}/*
  76. %changelog