File zerotier-one.spec of Package zerotier-one
Name: zerotier-one
Release: 1%{?dist}
Summary: ZeroTier - Global Area Networking
Version: 1
License: Business Source License 1.1
URL: https://github.com/zerotier/ZeroTierOne
Source0: https://github.com/zerotier/ZeroTierOne/archive/ZeroTierOne-%{version}.tar.gz
BuildRequires: libjson-c-devel
BuildRequires: http-parser-devel
BuildRequires: sqlite-devel
BuildRequires: clang
BuildRequires: llvm-gold
BuildRequires: gcc-c++
BuildRequires: nodejs
BuildRequires: npm
BuildRequires: openssl-devel
BuildRequires: groff
#BuildRequires: rust
#BuildRequires: cargo
%{?systemd_requires}
BuildRequires: systemd
%description
ZeroTier is a smart programmable Ethernet switch for planet Earth.
It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.
This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connections.
This OBS build has SSO disabled, because I can't be bothered to get the Rust setup working properly.
%prep
%setup -q -n ZeroTierOne-%{version}
%build
export CARGO_NET_OFFLINE=true
make \
CXXFLAGS="-O3 -fstack-protector-all"\
CFLAGS="-O3 -fstack-protector-all"\
ZT_USE_MINIUPNPC=1\
ZT_ENABLE_CLUSTER=1\
ZT_ENABLE_NETWORK_CONTROLLER=1\
ZT_SSO_SUPPORTED=0\
%{?_smp_mflags}\
one \
manpages
%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
cp debian/zerotier-one.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
%check
make \
CXXFLAGS="-O3 -fstack-protector-all"\
CFLAGS="-O3 -fstack-protector-all"\
ZT_USE_MINIUPNPC=1\
ZT_ENABLE_CLUSTER=1\
ZT_ENABLE_NETWORK_CONTROLLER=1\
ZT_SSO_SUPPORTED=0\
%{?_smp_mflags}\
selftest
./zerotier-selftest
%pre
%service_add_pre zerotier-one.service
%post
%service_add_post zerotier-one.service
%preun
%systemd_preun zerotier-one.service
%postun
%systemd_postun_with_restart zerotier-one.service
%files
%{_mandir}/man1/*
%{_mandir}/man8/*
%{_sbindir}/*
%{_unitdir}/%{name}.service
# compatibility symlinks to binaries
%dir %{_sharedstatedir}/%{name}
%{_sharedstatedir}/%{name}/*
%doc AUTHORS.md README.md
%license LICENSE.txt
%changelog