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.

155 lines
4.1 KiB

8 years ago
9 years ago
8 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
8 years ago
9 years ago
9 years ago
9 years ago
8 years ago
9 years ago
9 years ago
9 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. AutoReq: no
  10. Conflicts: python-shadowsocks python3-shadowsocks
  11. BuildRequires: make gcc pcre-devel asciidoc xmlto
  12. Requires: pcre
  13. %if 0%{?suse_version}
  14. Requires: libopenssl1_0_0
  15. BuildRequires: libopenssl-devel
  16. %else
  17. Requires: openssl
  18. BuildRequires: openssl-devel
  19. %endif
  20. %if 0%{?fedora} >= 15 || 0%{?rhel} >=7 || 0%{?suse_version} >= 1210
  21. %global use_systemd 1
  22. %else
  23. %global use_systemd 0
  24. %endif
  25. %if 0%{?use_systemd}
  26. %{?systemd_requires}
  27. %if 0%{?suse_version}
  28. BuildRequires: systemd-rpm-macros
  29. %else
  30. BuildRequires: systemd
  31. %endif
  32. %endif
  33. %if 0%{?use_system_lib}
  34. BuildRequires: libev-devel libsodium-devel >= 1.0.4 udns-devel
  35. Requires: libev libsodium >= 1.0.4 udns
  36. %endif
  37. %description
  38. shadowsocks-libev is a lightweight secured scoks5 proxy for embedded devices and low end boxes.
  39. %prep
  40. %setup -q
  41. %build
  42. %if 0%{?use_system_lib}
  43. %configure --enable-shared --enable-system-shared-lib
  44. %else
  45. %configure --enable-shared
  46. %endif
  47. make %{?_smp_mflags}
  48. %install
  49. make install DESTDIR=%{buildroot}
  50. mkdir -p %{buildroot}/etc/shadowsocks-libev
  51. %if ! 0%{?use_systemd}
  52. mkdir -p %{buildroot}%{_initddir}
  53. install -m 755 %{_builddir}/%{buildsubdir}/rpm/SOURCES/etc/init.d/shadowsocks-libev %{buildroot}%{_initddir}/shadowsocks-libev
  54. %else
  55. mkdir -p %{buildroot}%{_sysconfdir}/default
  56. mkdir -p %{buildroot}%{_unitdir}
  57. install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.default %{buildroot}%{_sysconfdir}/default/shadowsocks-libev
  58. install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev.service %{buildroot}%{_unitdir}/shadowsocks-libev.service
  59. install -m 644 %{_builddir}/%{buildsubdir}/debian/shadowsocks-libev-*.service %{buildroot}%{_unitdir}/
  60. %endif
  61. install -m 644 %{_builddir}/%{buildsubdir}/debian/config.json %{buildroot}%{_sysconfdir}/shadowsocks-libev/config.json
  62. mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/
  63. install -m 644 %{_builddir}/%{buildsubdir}/completions/bash/* %{buildroot}%{_datadir}/bash-completion/completions/
  64. %pre
  65. %if 0%{?use_systemd} && 0%{?suse_version}
  66. %service_add_pre shadowsocks-libev.service
  67. %endif
  68. %post
  69. %if ! 0%{?use_systemd}
  70. /sbin/chkconfig --add shadowsocks-libev > /dev/null 2>&1 || :
  71. %else
  72. %if 0%{?suse_version}
  73. %service_add_post shadowsocks-libev.service
  74. %else
  75. %systemd_post shadowsocks-libev.service
  76. %endif
  77. %endif
  78. %preun
  79. %if ! 0%{?use_systemd}
  80. if [ $1 -eq 0 ]; then
  81. /sbin/service shadowsocks-libev stop > /dev/null 2>&1 || :
  82. /sbin/chkconfig --del shadowsocks-libev > /dev/null 2>&1 || :
  83. fi
  84. %else
  85. %if 0%{?suse_version}
  86. %service_del_preun shadowsocks-libev.service
  87. %else
  88. %systemd_preun shadowsocks-libev.service
  89. %endif
  90. %endif
  91. %postun
  92. %if 0%{?use_systemd}
  93. %if 0%{?suse_version}
  94. %service_del_postun shadowsocks-libev.service
  95. %else
  96. %systemd_postun_with_restart shadowsocks-libev.service
  97. %endif
  98. %endif
  99. %files
  100. /usr/share/doc/shadowsocks-libev/shadowsocks-libev.html
  101. /usr/share/doc/shadowsocks-libev/ss-local.html
  102. /usr/share/doc/shadowsocks-libev/ss-manager.html
  103. /usr/share/doc/shadowsocks-libev/ss-nat.html
  104. /usr/share/doc/shadowsocks-libev/ss-redir.html
  105. /usr/share/doc/shadowsocks-libev/ss-server.html
  106. /usr/share/doc/shadowsocks-libev/ss-tunnel.html
  107. %{_bindir}/*
  108. %{_libdir}/*.so.*
  109. %config(noreplace) %{_sysconfdir}/shadowsocks-libev/config.json
  110. %{_datadir}/bash-completion/completions/*
  111. %doc %{_mandir}/*
  112. %if ! 0%{?use_systemd}
  113. %{_initddir}/shadowsocks-libev
  114. %else
  115. %{_unitdir}/shadowsocks-libev.service
  116. %{_unitdir}/shadowsocks-libev-*.service
  117. %config(noreplace) %{_sysconfdir}/default/shadowsocks-libev
  118. %endif
  119. %package devel
  120. Summary: Development files for shadowsocks-libev
  121. Group: Applications/Internet
  122. License: GPLv3+
  123. Requires: shadowsocks-libev == %{version}-%{release}
  124. %description devel
  125. Development files for shadowsocks-libev
  126. %files devel
  127. %{_includedir}/*
  128. %{_libdir}/pkgconfig/*.pc
  129. %{_libdir}/libshadowsocks-libev.la
  130. %{_libdir}/libshadowsocks-libev.so
  131. %changelog