zerotier-one.spec 7.6 KB

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