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.

109 lines
2.8 KiB

8 years ago
10 years ago
8 years ago
10 years ago
9 years ago
10 years ago
10 years ago
10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
8 years ago
9 years ago
10 years ago
8 years ago
10 years ago
10 years ago
10 years ago
  1. Name: shadowsocks-libev
  2. Version: VERSION
  3. Release: 1%{?dist}
  4. Summary: A lightweight and secure socks5 proxy
  5. Group: Applications/Internet
  6. License: GPLv3+
  7. URL: https://github.com/shadowsocks/%{name}
  8. Source0: %{url}/archive/v%{version}.tar.gz
  9. BuildRequires: make automake gcc openssl-devel pcre-devel asciidoc xmlto
  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. install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev-*.service %{buildroot}%{_unitdir}/
  38. %endif
  39. install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json
  40. %post
  41. %if 0%{?rhel} == 6
  42. /sbin/chkconfig --add shadowsocks-libev
  43. %else
  44. %systemd_post shadowsocks-libev.service
  45. %endif
  46. %preun
  47. %if 0%{?rhel} == 6
  48. if [ $1 -eq 0 ]; then
  49. /sbin/service shadowsocks-libev stop
  50. /sbin/chkconfig --del shadowsocks-libev
  51. fi
  52. %else
  53. %systemd_preun shadowsocks-libev.service
  54. %endif
  55. %if 0%{?rhel} != 6
  56. %postun
  57. %systemd_postun_with_restart shadowsocks-libev.service
  58. %endif
  59. %files
  60. /usr/share/doc/shadowsocks-libev/shadowsocks-libev.html
  61. /usr/share/doc/shadowsocks-libev/ss-local.html
  62. /usr/share/doc/shadowsocks-libev/ss-manager.html
  63. /usr/share/doc/shadowsocks-libev/ss-nat.html
  64. /usr/share/doc/shadowsocks-libev/ss-redir.html
  65. /usr/share/doc/shadowsocks-libev/ss-server.html
  66. /usr/share/doc/shadowsocks-libev/ss-tunnel.html
  67. %{_bindir}/*
  68. %{_libdir}/*
  69. %config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json
  70. %doc %{_mandir}/*
  71. %if 0%{?rhel} == 6
  72. %{_initddir}/shadowsocks-libev
  73. %else
  74. %{_unitdir}/shadowsocks-libev.service
  75. %{_unitdir}/shadowsocks-libev-*.service
  76. %config(noreplace) %{_sysconfdir}/default/shadowsocks-libev
  77. %endif
  78. %package devel
  79. Summary: Development files for shadowsocks-libev
  80. Group: Applications/Internet
  81. License: GPLv3+
  82. %description devel
  83. Development files for shadowsocks-libev
  84. %files devel
  85. %{_includedir}/*
  86. %changelog