Package not found: home:dgarcia:SLFO:Main/openvpn

File zerotier-one.spec of Package zerotier-one

#
# spec file for package zerotier-one
#
# Copyright (c) 2025 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/
#


%global toolchain     clang

%ifarch %{arm}
%global debug_package %{nil}
%endif

%define original_name ZeroTierOne


Name:           zerotier-one
Version:        1.14.2
Release:        1%{?dist}
Summary:        Smart Ethernet Switch and Virtual Private/Public Network for Earth
License:        BSL and Boost and ASL and ASL 2.0 and MIT
URL:            https://www.zerotier.com/
Source0:        https://github.com/zerotier/%{original_name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        vendor-%{version}.tar.xz
Source2:        zerotier-one-sysusers


BuildRequires:  cargo
BuildRequires:  coreutils
BuildRequires:  util-linux
BuildRequires:  pkgconfig(openssl)

%if 0%{?mageia}
BuildRequires:  (lib64clang-devel or libclang-devel)
%else
BuildRequires:  cmake(Clang)

%if 0%{?sle_version} <= 150600 && 0%{?is_opensuse}
BuildRequires:  clang15-devel
%else
BuildRequires:  cmake(Clang)

%endif
%endif

%if 0%{?mageia}
BuildRequires:  passwd
%else
BuildRequires:  shadow
%endif

%if 0%{?sle} && 0%{?is_opensuse} || 0%{?suse} && 0%{?is_opensuse} || 0%{?fedora}
BuildRequires:  pkgconfig(systemd)
BuildRequires:  systemd-rpm-macros
%else
BuildRequires:  systemd
%endif


Requires:       coreutils
Requires:       openssl
Requires:       util-linux

%if 0%{?mageia}
Requires:       passwd
%else
Requires:       shadow
%endif

%{?systemd_requires}

%if 0%{?fedora}
%{?sysusers_requires_compat}
%endif


Provides:       bundled(http-parser)
Provides:       bundled(json) = 3.10.2
Provides:       bundled(salsa2012)

%description
ZeroTier is a smart programmable VPN (Virtual Private/Public Network) that acts
as an 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.

The goals and design principles of ZeroTier are inspired by among other things
the original Google BeyondCorp paper and the Jericho Forum with its notion of
"deperimeterization."

%prep
%autosetup -p1 -n %{original_name}-%{version}

pushd rustybits
tar -xf %{SOURCE1}
popd

%build
%make_build \
 ZT_USE_MINIUPNPC="1" \
 STRIP="%{_bindir}/true" \
 one

%install
%make_install

install -Dm644 "%{_builddir}/%{original_name}-%{version}/debian/%{name}.service" -t %{buildroot}/%{_unitdir}/
install -Dm644  %{SOURCE2}                                                         "%{buildroot}/%{_sysusersdir}/%{name}.conf"

%pre
%systemd_pre           "%{name}.service"

%if 0%{?fedora}
%sysusers_create_compat %{SOURCE2}
%else
%sysusers_create        %{SOURCE2}
%endif

%post
# Activate & start ZeroTier One service after installation
echo -e \
"*** Activating & starting ZeroTier One service . . ."
%systemd_post   "%{name}.service"
systemctl start "%{name}.service" >/dev/null 2>&1 || :

# Mention about public key location after installation
echo -e \
"*** Your ZeroTier public identity key of your device is stored here: \n \
*[ /%{_sharedstatedir}/%{name}/identity.public ]*"

# Request Network ID from ZeroTier One VPN dashboard
echo -e \
"*** Copy Network ID of your custom network from the ZeroTier VPN dashboard then use the command & paste it: \n \
*[ zerotier-cli join <NETWORK ID> ]* . . ."

%preun
%systemd_preun "%{name}.service"

%postun
%systemd_postun_with_restart "%{name}.service"

%files
%doc     AUTHORS.md README.md RELEASE-NOTES.md OFFICIAL-RELEASE-STEPS.md

%license COPYING

     %{_mandir}/man1/zerotier-{cli,idtool}.1.gz
    "%{_mandir}/man8/%{name}.8.gz"

     %{_sbindir}/zerotier-{cli,idtool,one}

%dir %{_sharedstatedir}/%{name}/
     %{_sharedstatedir}/%{name}/zerotier-{cli,idtool,one,one.te}

    "%{_sysusersdir}/%{name}.conf"

    "%{_unitdir}/%{name}.service"

%changelog
openSUSE Build Service is sponsored by