zerotier-one.spec 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. Name: zerotier-one
  2. Version: 1.1.6
  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. BuildRequires: json-parser-devel
  16. %endif
  17. Requires: iproute
  18. %if 0%{?rhel} >= 7
  19. Requires: systemd
  20. %endif
  21. %if 0%{?rhel} <= 6
  22. Requires: chkconfig
  23. %endif
  24. %if 0%{?fedora} >= 21
  25. Requires: lz4
  26. Requires: libnatpmp
  27. Requires: systemd
  28. Requires: json-parser
  29. %endif
  30. Provides: bundled(http-parser) = 2.7.0
  31. Provides: bundled(miniupnpc) = 2.0
  32. %if 0%{?rhel} >= 6
  33. Provides: bundled(json-parser) = 1.1.0
  34. Provides: bundled(lz4) = 1.7.1
  35. Provides: bundled(libnatpmp) = 20131126
  36. %endif
  37. %description
  38. ZeroTier is a software defined networking layer for Earth.
  39. It can be used for on-premise network virtualization, as a peer to peer VPN
  40. for mobile teams, for hybrid or multi-data-center cloud deployments, or just
  41. about anywhere else secure software defined virtual networking is useful.
  42. ZeroTier One is our OS-level client service. It allows Mac, Linux, Windows,
  43. FreeBSD, and soon other types of clients to join ZeroTier virtual networks
  44. like conventional VPNs or VLANs. It can run on native systems, VMs, or
  45. containers (Docker, OpenVZ, etc.).
  46. %prep
  47. rm -rf *
  48. ln -s %{getenv:PWD} %{name}-%{version}
  49. tar --exclude=%{name}-%{version}/.git --exclude=%{name}-%{version}/%{name}-%{version} -czf %{_sourcedir}/%{name}-%{version}.tar.gz %{name}-%{version}/*
  50. rm -f %{name}-%{version}
  51. cp -a %{getenv:PWD}/* .
  52. %build
  53. %if 0%{?rhel} <= 7
  54. 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
  55. %else
  56. make CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" ZT_USE_MINIUPNPC=1 %{?_smp_mflags} one manpages selftest
  57. %endif
  58. %install
  59. rm -rf $RPM_BUILD_ROOT
  60. make install DESTDIR=$RPM_BUILD_ROOT
  61. %if 0%{?rhel} >= 7
  62. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  63. cp debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
  64. %endif
  65. %if 0%{?fedora} >= 21
  66. mkdir -p $RPM_BUILD_ROOT%{_unitdir}
  67. cp debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
  68. %endif
  69. %if 0%{?rhel} <= 6
  70. mkdir -p $RPM_BUILD_ROOT/etc/init.d
  71. cp ext/installfiles/linux/zerotier-one.init.rhel6 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
  72. chmod 0755 $RPM_BUILD_ROOT/etc/init.d/zerotier-one
  73. %endif
  74. %files
  75. %{_sbindir}/*
  76. %{_mandir}/*
  77. %{_localstatedir}/*
  78. %if 0%{?rhel} >= 7
  79. %{_unitdir}/%{name}.service
  80. %endif
  81. %if 0%{?fedora} >= 21
  82. %{_unitdir}/%{name}.service
  83. %endif
  84. %if 0%{?rhel} <= 6
  85. /etc/init.d/zerotier-one
  86. %endif
  87. %post
  88. %if 0%{?rhel} >= 7
  89. %systemd_post zerotier-one.service
  90. %endif
  91. %if 0%{?fedora} >= 21
  92. %systemd_post zerotier-one.service
  93. %endif
  94. %if 0%{?rhel} <= 6
  95. case "$1" in
  96. 1)
  97. chkconfig --add zerotier-one
  98. ;;
  99. 2)
  100. chkconfig --del newservice
  101. chkconfig --add newservice
  102. ;;
  103. esac
  104. %endif
  105. %preun
  106. %if 0%{?rhel} >= 7
  107. %systemd_preun zerotier-one.service
  108. %endif
  109. %if 0%{?fedora} >= 21
  110. %systemd_preun zerotier-one.service
  111. %endif
  112. %if 0%{?rhel} <= 6
  113. case "$1" in
  114. 0)
  115. service zerotier-one stop
  116. chkconfig --del zerotier-one
  117. ;;
  118. 1)
  119. # This is an upgrade.
  120. :
  121. ;;
  122. esac
  123. %endif
  124. %postun
  125. %if 0%{?rhel} >= 7
  126. %systemd_postun_with_restart zerotier-one.service
  127. %endif
  128. %if 0%{?fedora} >= 21
  129. %systemd_postun_with_restart zerotier-one.service
  130. %endif
  131. %changelog
  132. * Sat Jun 25 2016 Adam Ierymenko <[email protected]> - 1.1.6-0.1
  133. - now builds on CentOS 6 as well as newer distros, and some cleanup
  134. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.3
  135. - include systemd unit file
  136. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.2
  137. - add libnatpmp as (build)dependency
  138. * Wed Jun 08 2016 François Kooman <[email protected]> - 1.1.5-0.1
  139. - initial package