File ZeroTierOne.spec of Package ZeroTierOne
#
# spec file for package ZeroTierOne
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: ZeroTierOne
Version: 1.16.0
Release: 0
Summary: A Smart Ethernet Switch for Earth
License: MPL-2.0
URL: https://github.com/zerotier/ZeroTierOne
Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: vendor.tar.xz
Source2: cargo_config
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: golang-github-cpuguy83-go-md2man
BuildRequires: http-parser-devel
BuildRequires: nodejs
BuildRequires: cargo-packaging
BuildRequires: npm
BuildRequires: pkgconfig
BuildRequires: systemd
BuildRequires: pkgconfig(json-c)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(protobuf)
BuildRequires: pkgconfig(miniupnpc)
%{?systemd_requires}
%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.
%prep
%autosetup -a1
mkdir -p .cargo
cp %{SOURCE2} .cargo/config
%build
pushd rustybits
%{cargo_build}
popd
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"
%make_build \
ZT_USE_MINIUPNPC=1 \
ZT_ENABLE_CLUSTER=1 \
ZT_ENABLE_NETWORK_CONTROLLER=1 \
one \
manpages
%install
%make_install
install -D -m 0644 debian/zerotier-one.service %{buildroot}/%{_unitdir}/zerotier-one.service
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rczerotier-one
%fdupes %{buildroot}/%{_prefix}
%check
export CXXFLAGS="%{optflags}"
export CFLAGS="%{optflags}"
%make_build \
ZT_USE_MINIUPNPC=1 \
ZT_ENABLE_CLUSTER=1 \
ZT_ENABLE_NETWORK_CONTROLLER=1 \
selftest
./zerotier-selftest
%pre
%service_add_pre zerotier-one.service
%post
%service_add_post zerotier-one.service
%preun
%service_del_preun zerotier-one.service
%postun
%service_del_postun zerotier-one.service
%files
%license LICENSE.txt LICENSE-MPL.txt
%doc RELEASE-NOTES.md README.md
%{_sbindir}/*
%{_localstatedir}/lib/zerotier-one/
%{_unitdir}/zerotier-one.service
%{_sbindir}/rczerotier-one
%{_mandir}/man1/*.1%{?ext_man}
%{_mandir}/man8/*.8%{?ext_man}
%changelog