zerotier-one.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. Name: zerotier-one
  2. Version: 1.5.0
  3. Release: 1%{?dist}
  4. Summary: ZeroTier One 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. ZeroTier One 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. #rm -rf *
  36. #ln -s %{getenv:PWD} %{name}-%{version}
  37. #tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
  38. #rm -f %{name}-%{version}
  39. #cp -a %{getenv:PWD}/* .
  40. %build
  41. #%if 0%{?rhel} <= 7
  42. #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
  43. #%else
  44. #make CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
  45. #%endif
  46. %pre
  47. %if 0%{?rhel} >= 7
  48. /usr/bin/getent passwd zerotier-one || /usr/sbin/useradd -r -d /var/lib/zerotier-one -s /sbin/nologin zerotier-one
  49. %endif
  50. %if 0%{?fedora} >= 21
  51. /usr/bin/getent passwd zerotier-one || /usr/sbin/useradd -r -d /var/lib/zerotier-one -s /sbin/nologin zerotier-one
  52. %endif
  53. %install
  54. rm -rf $RPM_BUILD_ROOT
  55. pushd %{getenv:PWD}
  56. make install DESTDIR=$RPM_BUILD_ROOT
  57. popd
  58. %if 0%{?rhel} >= 7
  59. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  60. cp %{getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
  61. %endif
  62. %if 0%{?fedora} >= 21
  63. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  64. cp ${getenv:PWD}/debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
  65. %endif
  66. %if 0%{?rhel} <= 6
  67. mkdir -p $RPM_BUILD_ROOT/etc/init.d
  68. cp %{getenv:PWD}/ext/installfiles/linux/zerotier-one.init.rhel6 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
  69. chmod 0755 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
  70. %endif
  71. %files
  72. %{_sbindir}/*
  73. %{_mandir}/*
  74. %{_localstatedir}/*
  75. %if 0%{?rhel} >= 7
  76. %{_unitdir}/%{name}.service
  77. %endif
  78. %if 0%{?fedora} >= 21
  79. %{_unitdir}/%{name}.service
  80. %endif
  81. %if 0%{?rhel} <= 6
  82. /etc/init.d/zerotier-one
  83. %endif
  84. %post
  85. %if 0%{?rhel} >= 7
  86. %systemd_post zerotier-one.service
  87. %endif
  88. %if 0%{?fedora} >= 21
  89. %systemd_post zerotier-one.service
  90. %endif
  91. %if 0%{?rhel} <= 6
  92. case "$1" in
  93. 1)
  94. chkconfig --add zerotier-one
  95. ;;
  96. 2)
  97. chkconfig --del zerotier-one
  98. chkconfig --add zerotier-one
  99. ;;
  100. esac
  101. %endif
  102. %preun
  103. %if 0%{?rhel} >= 7
  104. %systemd_preun zerotier-one.service
  105. %endif
  106. %if 0%{?fedora} >= 21
  107. %systemd_preun zerotier-one.service
  108. %endif
  109. %if 0%{?rhel} <= 6
  110. case "$1" in
  111. 0)
  112. service zerotier-one stop
  113. chkconfig --del zerotier-one
  114. ;;
  115. 1)
  116. # This is an upgrade.
  117. :
  118. ;;
  119. esac
  120. %endif
  121. %postun
  122. %if 0%{?rhel} >= 7
  123. %systemd_postun_with_restart zerotier-one.service
  124. %endif
  125. %if 0%{?fedora} >= 21
  126. %systemd_postun_with_restart zerotier-one.service
  127. %endif
  128. %changelog
  129. * Mon Oct 05 2020 Adam Ierymenko <[email protected]> - 1.6.0-beta1
  130. - see https://github.com/zerotier/ZeroTierOne for release notes
  131. * Fri Aug 23 2019 Adam Ierymenko <[email protected]> - 1.4.4-0.1
  132. - see https://github.com/zerotier/ZeroTierOne for release notes
  133. * Mon Aug 04 2019 Adam Ierymenko <[email protected]> - 1.4.2-0.1
  134. - see https://github.com/zerotier/ZeroTierOne for release notes
  135. * Mon Jul 29 2019 Adam Ierymenko <[email protected]> - 1.4.0-0.1
  136. - see https://github.com/zerotier/ZeroTierOne for release notes
  137. * Tue May 08 2018 Adam Ierymenko <[email protected]> - 1.2.10-0.1
  138. - see https://github.com/zerotier/ZeroTierOne for release notes
  139. * Thu May 03 2018 Adam Ierymenko <[email protected]> - 1.2.8-0.1
  140. - see https://github.com/zerotier/ZeroTierOne for release notes
  141. * Mon Apr 24 2017 Adam Ierymenko <[email protected]> - 1.2.2-0.1
  142. - see https://github.com/zerotier/ZeroTierOne for release notes
  143. * Fri Mar 17 2017 Adam Ierymenko <[email protected]> - 1.2.2-0.1
  144. - see https://github.com/zerotier/ZeroTierOne for release notes
  145. * Tue Mar 14 2017 Adam Ierymenko <[email protected]> - 1.2.0-0.1
  146. - see https://github.com/zerotier/ZeroTierOne for release notes
  147. * Tue Jul 12 2016 Adam Ierymenko <[email protected]> - 1.1.10-0.1
  148. - see https://github.com/zerotier/ZeroTierOne for release notes
  149. * Fri Jul 08 2016 Adam Ierymenko <[email protected]> - 1.1.8-0.1
  150. - see https://github.com/zerotier/ZeroTierOne for release notes
  151. * Sat Jun 25 2016 Adam Ierymenko <[email protected]> - 1.1.6-0.1
  152. - now builds on CentOS 6 as well as newer distros, and some cleanup
  153. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.3
  154. - include systemd unit file
  155. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.2
  156. - add libnatpmp as (build)dependency
  157. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.1
  158. - initial package