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.

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