zerotier-one.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. Name: zerotier-one
  2. Version: 1.6.4
  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++
  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. %endif
  109. %preun
  110. %if 0%{?rhel} >= 7
  111. %systemd_preun zerotier-one.service
  112. %endif
  113. %if 0%{?fedora} >= 21
  114. %systemd_preun zerotier-one.service
  115. %endif
  116. %if 0%{?rhel} <= 6
  117. case "$1" in
  118. 0)
  119. service zerotier-one stop
  120. chkconfig --del zerotier-one
  121. ;;
  122. 1)
  123. # This is an upgrade.
  124. :
  125. ;;
  126. esac
  127. %endif
  128. %postun
  129. %if 0%{?rhel} >= 7
  130. %systemd_postun_with_restart zerotier-one.service
  131. %endif
  132. %if 0%{?fedora} >= 21
  133. %systemd_postun_with_restart zerotier-one.service
  134. %endif
  135. %changelog
  136. * Mon Feb 15 2021 Adam Ierymenko <[email protected]> - 1.6.4
  137. - see https://github.com/zerotier/ZeroTierOne for release notes
  138. * Mon Nov 30 2020 Adam Ierymenko <[email protected]> - 1.6.2-0.1
  139. - see https://github.com/zerotier/ZeroTierOne for release notes
  140. * Tue Nov 24 2020 Adam Ierymenko <[email protected]> - 1.6.1-0.1
  141. - see https://github.com/zerotier/ZeroTierOne for release notes
  142. * Thu Nov 19 2020 Adam Ierymenko <[email protected]> - 1.6.0-0.1
  143. - see https://github.com/zerotier/ZeroTierOne for release notes
  144. * Mon Oct 05 2020 Adam Ierymenko <[email protected]> - 1.6.0-beta1
  145. - see https://github.com/zerotier/ZeroTierOne for release notes
  146. * Fri Aug 23 2019 Adam Ierymenko <[email protected]> - 1.4.4-0.1
  147. - see https://github.com/zerotier/ZeroTierOne for release notes
  148. * Mon Jul 29 2019 Adam Ierymenko <[email protected]> - 1.4.0-0.1
  149. - see https://github.com/zerotier/ZeroTierOne for release notes
  150. * Tue May 08 2018 Adam Ierymenko <[email protected]> - 1.2.10-0.1
  151. - see https://github.com/zerotier/ZeroTierOne for release notes
  152. * Thu May 03 2018 Adam Ierymenko <[email protected]> - 1.2.8-0.1
  153. - see https://github.com/zerotier/ZeroTierOne for release notes
  154. * Mon Apr 24 2017 Adam Ierymenko <[email protected]> - 1.2.2-0.1
  155. - see https://github.com/zerotier/ZeroTierOne for release notes
  156. * Fri Mar 17 2017 Adam Ierymenko <[email protected]> - 1.2.2-0.1
  157. - see https://github.com/zerotier/ZeroTierOne for release notes
  158. * Tue Mar 14 2017 Adam Ierymenko <[email protected]> - 1.2.0-0.1
  159. - see https://github.com/zerotier/ZeroTierOne for release notes
  160. * Tue Jul 12 2016 Adam Ierymenko <[email protected]> - 1.1.10-0.1
  161. - see https://github.com/zerotier/ZeroTierOne for release notes
  162. * Fri Jul 08 2016 Adam Ierymenko <[email protected]> - 1.1.8-0.1
  163. - see https://github.com/zerotier/ZeroTierOne for release notes
  164. * Sat Jun 25 2016 Adam Ierymenko <[email protected]> - 1.1.6-0.1
  165. - now builds on CentOS 6 as well as newer distros, and some cleanup
  166. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.3
  167. - include systemd unit file
  168. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.2
  169. - add libnatpmp as (build)dependency
  170. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.1
  171. - initial package