zerotier-one.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. Name: zerotier-one
  2. Version: 1.1.14
  3. Release: 0.1%{?dist}
  4. Summary: ZeroTier One network virtualization service
  5. License: GPLv3
  6. URL: https://www.zerotier.com
  7. Source0: %{name}-%{version}.tar.gz
  8. %if 0%{?rhel} >= 7
  9. BuildRequires: systemd
  10. %endif
  11. %if 0%{?fedora} >= 21
  12. BuildRequires: lz4-devel
  13. BuildRequires: libnatpmp-devel
  14. BuildRequires: systemd
  15. %endif
  16. Requires: iproute
  17. %if 0%{?rhel} >= 7
  18. Requires: systemd
  19. %endif
  20. %if 0%{?rhel} <= 6
  21. Requires: chkconfig
  22. %endif
  23. %if 0%{?fedora} >= 21
  24. Requires: lz4
  25. Requires: libnatpmp
  26. Requires: systemd
  27. %endif
  28. Provides: bundled(http-parser) = 2.7.0
  29. Provides: bundled(miniupnpc) = 2.0
  30. %if 0%{?rhel} >= 6
  31. Provides: bundled(lz4) = 1.7.1
  32. Provides: bundled(libnatpmp) = 20131126
  33. %endif
  34. %description
  35. ZeroTier is a software defined networking layer for Earth.
  36. It can be used for on-premise network virtualization, as a peer to peer VPN
  37. for mobile teams, for hybrid or multi-data-center cloud deployments, or just
  38. about anywhere else secure software defined virtual networking is useful.
  39. ZeroTier One is our OS-level client service. It allows Mac, Linux, Windows,
  40. FreeBSD, and soon other types of clients to join ZeroTier virtual networks
  41. like conventional VPNs or VLANs. It can run on native systems, VMs, or
  42. containers (Docker, OpenVZ, etc.).
  43. %prep
  44. rm -rf *
  45. ln -s %{getenv:PWD} %{name}-%{version}
  46. tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
  47. rm -f %{name}-%{version}
  48. cp -a %{getenv:PWD}/* .
  49. %build
  50. %if 0%{?rhel} <= 7
  51. 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
  52. %else
  53. make CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
  54. %endif
  55. %install
  56. rm -rf $RPM_BUILD_ROOT
  57. make install DESTDIR=$RPM_BUILD_ROOT
  58. %if 0%{?rhel} >= 7
  59. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  60. cp 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 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 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 newservice
  98. chkconfig --add newservice
  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. * Tue Jul 12 2016 Adam Ierymenko <[email protected]> - 1.1.10-0.1
  130. - see https://github.com/zerotier/ZeroTierOne for release notes
  131. * Fri Jul 08 2016 Adam Ierymenko <[email protected]> - 1.1.8-0.1
  132. - see https://github.com/zerotier/ZeroTierOne for release notes
  133. * Sat Jun 25 2016 Adam Ierymenko <[email protected]> - 1.1.6-0.1
  134. - now builds on CentOS 6 as well as newer distros, and some cleanup
  135. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.3
  136. - include systemd unit file
  137. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.2
  138. - add libnatpmp as (build)dependency
  139. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.1
  140. - initial package