zerotier-one.spec 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. Name: zerotier-one
  2. Version: 1.8.10
  3. Release: 1%{?dist}
  4. Summary: ZeroTier network virtualization service
  5. License: ZeroTier BSL 1.1
  6. URL: https://www.zerotier.com
  7. %if 0%{?rhel} >= 7
  8. BuildRequires: systemd
  9. %endif
  10. %if 0%{?fedora} >= 21
  11. BuildRequires: systemd
  12. %endif
  13. Requires: iproute libstdc++ openssl
  14. AutoReqProv: no
  15. %if 0%{?rhel} >= 7
  16. Requires: systemd
  17. Requires(pre): /usr/sbin/useradd, /usr/bin/getent
  18. %endif
  19. %if 0%{?rhel} <= 6
  20. Requires: chkconfig
  21. %endif
  22. %if 0%{?fedora} >= 21
  23. Requires: systemd
  24. Requires(pre): /usr/sbin/useradd, /usr/bin/getent
  25. %endif
  26. %description
  27. ZeroTier is a software defined networking layer for Earth.
  28. It can be used for on-premise network virtualization, as a peer to peer VPN
  29. for mobile teams, for hybrid or multi-data-center cloud deployments, or just
  30. about anywhere else secure software defined virtual networking is useful.
  31. This is our OS-level client service. It allows Mac, Linux, Windows,
  32. FreeBSD, and soon other types of clients to join ZeroTier virtual networks
  33. like conventional VPNs or VLANs. It can run on native systems, VMs, or
  34. containers (Docker, OpenVZ, etc.).
  35. %prep
  36. %if 0%{?rhel} >= 7
  37. rm -rf *
  38. ln -s %{getenv:PWD} %{name}-%{version}
  39. tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
  40. rm -f %{name}-%{version}
  41. cp -a %{getenv:PWD}/* .
  42. %endif
  43. %build
  44. #%if 0%{?rhel} <= 7
  45. #make CFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" CXXFLAGS="`echo %{optflags} | sed s/stack-protector-strong/stack-protector/`" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
  46. #%else
  47. %if 0%{?rhel} >= 7
  48. make ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one
  49. %endif
  50. %pre
  51. %if 0%{?rhel} >= 7
  52. /usr/bin/getent passwd zerotier-one || /usr/sbin/useradd -r -d /var/lib/zerotier-one -s /sbin/nologin zerotier-one
  53. %endif
  54. %if 0%{?fedora} >= 21
  55. /usr/bin/getent passwd zerotier-one || /usr/sbin/useradd -r -d /var/lib/zerotier-one -s /sbin/nologin zerotier-one
  56. %endif
  57. %install
  58. rm -rf $RPM_BUILD_ROOT
  59. %if 0%{?rhel} < 7
  60. pushd %{getenv:PWD}
  61. %endif
  62. make install DESTDIR=$RPM_BUILD_ROOT
  63. %if 0%{?rhel} < 7
  64. popd
  65. %endif
  66. %if 0%{?rhel} >= 7
  67. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  68. cp %{getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
  69. %endif
  70. %if 0%{?fedora} >= 21
  71. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  72. cp ${getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
  73. %endif
  74. %if 0%{?rhel} <= 6
  75. mkdir -p $RPM_BUILD_ROOT/etc/init.d
  76. cp %{getenv:PWD}/ext/installfiles/linux/zerotier-one.init.rhel6 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
  77. chmod 0755 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
  78. %endif
  79. %files
  80. %{_sbindir}/*
  81. %{_mandir}/*
  82. %{_localstatedir}/*
  83. %if 0%{?rhel} >= 7
  84. %{_unitdir}/%{name}.service
  85. %endif
  86. %if 0%{?fedora} >= 21
  87. %{_unitdir}/%{name}.service
  88. %endif
  89. %if 0%{?rhel} <= 6
  90. /etc/init.d/zerotier-one
  91. %endif
  92. %post
  93. %if 0%{?rhel} >= 7
  94. %systemd_post zerotier-one.service
  95. %endif
  96. %if 0%{?fedora} >= 21
  97. %systemd_post zerotier-one.service
  98. %endif
  99. %if 0%{?rhel} <= 6
  100. case "$1" in
  101. 1)
  102. chkconfig --add zerotier-one
  103. ;;
  104. 2)
  105. chkconfig --del zerotier-one
  106. chkconfig --add zerotier-one
  107. ;;
  108. esac
  109. if [ -x /usr/bin/checkmodule -a -x /usr/bin/semodule_package -a -x /usr/sbin/semodule ]; then
  110. rm -f /var/lib/zerotier-one/zerotier-one.mod
  111. /usr/bin/checkmodule -M -m -o /var/lib/zerotier-one/zerotier-one.mod /var/lib/zerotier-one/zerotier-one.te
  112. if [ -f /var/lib/zerotier-one/zerotier-one.pp ]; then
  113. rm -f /var/lib/zerotier-one/zerotier-one.pp
  114. /usr/bin/semodule_package -o /var/lib/zerotier-one/zerotier-one.pp -m /var/lib/zerotier-one/zerotier-one.mod
  115. /usr/sbin/semodule -u /var/lib/zerotier-one/zerotier-one.pp
  116. else
  117. /usr/bin/semodule_package -o /var/lib/zerotier-one/zerotier-one.pp -m /var/lib/zerotier-one/zerotier-one.mod
  118. /usr/sbin/semodule -i /var/lib/zerotier-one/zerotier-one.pp
  119. fi
  120. fi
  121. %endif
  122. %preun
  123. %if 0%{?rhel} >= 7
  124. %systemd_preun zerotier-one.service
  125. %endif
  126. %if 0%{?fedora} >= 21
  127. %systemd_preun zerotier-one.service
  128. %endif
  129. %if 0%{?rhel} <= 6
  130. case "$1" in
  131. 0)
  132. service zerotier-one stop
  133. chkconfig --del zerotier-one
  134. ;;
  135. 1)
  136. # This is an upgrade.
  137. :
  138. ;;
  139. esac
  140. %endif
  141. %postun
  142. %if 0%{?rhel} >= 7
  143. %systemd_postun_with_restart zerotier-one.service
  144. %endif
  145. %if 0%{?fedora} >= 21
  146. %systemd_postun_with_restart zerotier-one.service
  147. %endif
  148. %changelog
  149. * Tue May 10 2022 Adam Ierymenko <[email protected]> - 1.8.10
  150. - see https://github.com/zerotier/ZeroTierOne for release notes
  151. * Fri Apr 25 2022 Adam Ierymenko <[email protected]> - 1.8.9
  152. - see https://github.com/zerotier/ZeroTierOne for release notes
  153. * Fri Apr 11 2022 Adam Ierymenko <[email protected]> - 1.8.8
  154. - see https://github.com/zerotier/ZeroTierOne for release notes
  155. * Fri Mar 21 2022 Adam Ierymenko <[email protected]> - 1.8.7
  156. - see https://github.com/zerotier/ZeroTierOne for release notes
  157. * Fri Mar 07 2022 Adam Ierymenko <[email protected]> - 1.8.6
  158. - see https://github.com/zerotier/ZeroTierOne for release notes
  159. * Fri Dec 17 2021 Adam Ierymenko <[email protected]> - 1.8.5
  160. - see https://github.com/zerotier/ZeroTierOne for release notes
  161. * Tue Nov 23 2021 Adam Ierymenko <[email protected]> - 1.8.4
  162. - see https://github.com/zerotier/ZeroTierOne for release notes
  163. * Mon Nov 15 2021 Adam Ierymenko <[email protected]> - 1.8.3
  164. - see https://github.com/zerotier/ZeroTierOne for release notes
  165. * Mon Nov 08 2021 Adam Ierymenko <[email protected]> - 1.8.2
  166. - see https://github.com/zerotier/ZeroTierOne for release notes
  167. * Wed Oct 20 2021 Adam Ierymenko <[email protected]> - 1.8.1
  168. - see https://github.com/zerotier/ZeroTierOne for release notes
  169. * Tue Sep 15 2021 Adam Ierymenko <[email protected]> - 1.8.0
  170. - see https://github.com/zerotier/ZeroTierOne for release notes
  171. * Tue Apr 13 2021 Adam Ierymenko <[email protected]> - 1.6.5
  172. - see https://github.com/zerotier/ZeroTierOne for release notes
  173. * Mon Feb 15 2021 Adam Ierymenko <[email protected]> - 1.6.4
  174. - see https://github.com/zerotier/ZeroTierOne for release notes
  175. * Mon Nov 30 2020 Adam Ierymenko <[email protected]> - 1.6.2-0.1
  176. - see https://github.com/zerotier/ZeroTierOne for release notes
  177. * Tue Nov 24 2020 Adam Ierymenko <[email protected]> - 1.6.1-0.1
  178. - see https://github.com/zerotier/ZeroTierOne for release notes
  179. * Thu Nov 19 2020 Adam Ierymenko <[email protected]> - 1.6.0-0.1
  180. - see https://github.com/zerotier/ZeroTierOne for release notes
  181. * Mon Oct 05 2020 Adam Ierymenko <[email protected]> - 1.6.0-beta1
  182. - see https://github.com/zerotier/ZeroTierOne for release notes
  183. * Fri Aug 23 2019 Adam Ierymenko <[email protected]> - 1.4.4-0.1
  184. - see https://github.com/zerotier/ZeroTierOne for release notes
  185. * Mon Jul 29 2019 Adam Ierymenko <[email protected]> - 1.4.0-0.1
  186. - see https://github.com/zerotier/ZeroTierOne for release notes
  187. * Tue May 08 2018 Adam Ierymenko <[email protected]> - 1.2.10-0.1
  188. - see https://github.com/zerotier/ZeroTierOne for release notes
  189. * Thu May 03 2018 Adam Ierymenko <[email protected]> - 1.2.8-0.1
  190. - see https://github.com/zerotier/ZeroTierOne for release notes
  191. * Mon Apr 24 2017 Adam Ierymenko <[email protected]> - 1.2.2-0.1
  192. - see https://github.com/zerotier/ZeroTierOne for release notes
  193. * Fri Mar 17 2017 Adam Ierymenko <[email protected]> - 1.2.2-0.1
  194. - see https://github.com/zerotier/ZeroTierOne for release notes
  195. * Tue Mar 14 2017 Adam Ierymenko <[email protected]> - 1.2.0-0.1
  196. - see https://github.com/zerotier/ZeroTierOne for release notes
  197. * Tue Jul 12 2016 Adam Ierymenko <[email protected]> - 1.1.10-0.1
  198. - see https://github.com/zerotier/ZeroTierOne for release notes
  199. * Fri Jul 08 2016 Adam Ierymenko <[email protected]> - 1.1.8-0.1
  200. - see https://github.com/zerotier/ZeroTierOne for release notes
  201. * Sat Jun 25 2016 Adam Ierymenko <[email protected]> - 1.1.6-0.1
  202. - now builds on CentOS 6 as well as newer distros, and some cleanup
  203. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.3
  204. - include systemd unit file
  205. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.2
  206. - add libnatpmp as (build)dependency
  207. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.1
  208. - initial package