File cloudflare_warp.spec of Package cloudflare_warp

#
# spec file for package cloudflare_warp
#
# 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/
#

Name:           cloudflare_warp
Version:        2025.8.779.0
Release:        1
Summary:        Cloudflare Warp Client
URL:            https://1.1.1.1
License:        Redistributable, no modification permitted
# This is the correct direct link for the "download_files" service
Source0:        https://pkg.cloudflareclient.com/pool/trixie/main/c/cloudflare-warp/cloudflare-warp_%{VERSION}_amd64.deb

# Fixed BuildRequires for openSUSE
BuildRequires:  desktop-file-utils
BuildRequires:  binutils
BuildRequires:  coreutils
BuildRequires:  gzip
BuildRequires:  pkg-config

# Fixed Requires for openSUSE (not pkgconfig())
Requires:       dbus-1
Requires:       liblz4-1
Requires:       libzstd1
Requires:       liblzma5
Requires:       nftables
Requires:       libnftables1
Requires:       iproute2
Requires:       dirmngr
Requires:       ca-certificates
Requires:       libpcap1
Requires:       libnss3-tools
Requires:       gnupg2

ExclusiveArch:  x86_64
Provides:       warp-cli
Provides:       warp-diag
Provides:       warp-svc
Conflicts:      cloudflare-warp


%{?systemd_requires}

%description
The Cloudflare WARP client allows individuals to have a faster, more secure,
and more private experience online.

The WARP application uses BoringTun to encrypt traffic from your device and
send it directly to Cloudflare's edge, ensuring that no one in between is
snooping on what you're doing. Combined with the power of 1.1.1.1 (the
world's fastest public DNS resolver),
private and fast.

%prep
ar x %{SOURCE0}

tar -xzOf control.tar.gz ./md5sums \
        | awk '{print $1, "'"%{_builddir}"'/build/" $2}' \
        > "%{_builddir}/md5sums"

 if [[ -d "%{_builddir}/build/" ]]; then
        rm -rf "%{_builddir}/build/"
   fi

   mkdir -p "%{_builddir}/build/" \
        && tar --extract \
               --gzip \
               --file=data.tar.gz \
               -C "%{_builddir}/build/"

%check
# Verify the integrity of the extracted files
md5sum -c %{_builddir}/md5sums

%build
# Nothing to build

%install
mkdir -p %{buildroot}/etc/
mkdir -p %{buildroot}/usr/
cp -R -v %{_builddir}/build/etc/ %{buildroot}/
cp -R -v %{_builddir}/build/usr/ %{buildroot}/
cp -R -v %{_builddir}/build/{bin,lib} %{buildroot}/usr/

sed -i 's%ExecStart=/bin/warp-svc%ExecStart=/usr/bin/warp-svc%' %{buildroot}/usr/lib/systemd/system/warp-svc.service
sed -i 's%ExecStart=/bin/warp-taskbar%ExecStart=/usr/bin/warp-taskbar%' %{buildroot}/usr/lib/systemd/user/warp-taskbar.service

%{__strip} %{buildroot}/usr/bin/warp-cli
%{__strip} %{buildroot}/usr/bin/warp-dex
%{__strip} %{buildroot}/usr/bin/warp-diag
%{__strip} %{buildroot}/usr/bin/warp-svc
%{__strip} %{buildroot}/usr/bin/warp-taskbar

%pre
%service_add_pre warp-svc.service

%post
%service_add_post warp-svc.service

%preun
%service_del_preun warp-svc.service

%postun
%service_del_postun warp-svc.service

%files
%defattr(-,root,root)
%dir %attr(0755, root, root) "/usr/share/"
%dir %attr(0755, root, root) "/usr/bin/"
%{_bindir}/warp-cli
%{_bindir}/warp-dex
%{_bindir}/warp-diag
%{_bindir}/warp-svc
%{_bindir}/warp-taskbar
/etc/xdg/autostart/com.cloudflare.WarpTaskbar.desktop
/usr/lib/systemd/system/warp-svc.service
/usr/lib/systemd/user/warp-taskbar.service
%{_datadir}/applications/com.cloudflare.WarpTaskbar.desktop
%ghost %dir /usr/share/warp/
%dir /usr/share/warp/images/
%dir /usr/share/icons/hicolor
%dir /usr/share/icons/hicolor/scalable
%dir /usr/share/icons/hicolor/scalable/apps
%dir /usr/share/doc/cloudflare-warp
%{_datadir}/icons/hicolor/scalable/apps/zero-trust-connected-exclamation.svg
%{_datadir}/icons/hicolor/scalable/apps/zero-trust-connected.svg
%{_datadir}/icons/hicolor/scalable/apps/zero-trust-disconnected.svg
%{_datadir}/icons/hicolor/scalable/apps/zero-trust-error.svg
%{_datadir}/icons/hicolor/scalable/apps/zero-trust-orange.svg
%{_datadir}/doc/cloudflare-warp/changelog.gz
%{_datadir}/doc/cloudflare-warp/changelog.Debian.gz
%{_datadir}/warp/images/Bug.dark.png
%{_datadir}/warp/images/Bug.light.png
%{_datadir}/warp/images/CFLogo.dark.png
%{_datadir}/warp/images/CFLogo.light.png
%{_datadir}/warp/images/Error.png
%{_datadir}/warp/images/Gear.dark.png
%{_datadir}/warp/images/Gear.light.png
%{_datadir}/warp/images/TeamCommitmentToPrivacy.dark.png
%{_datadir}/warp/images/TeamCommitmentToPrivacy.light.png
%{_datadir}/warp/images/TeamWhatIsWarp.dark.png
%{_datadir}/warp/images/TeamWhatIsWarp.light.png
%{_datadir}/warp/images/WarpByCloudflare.dark.png
%{_datadir}/warp/images/WarpByCloudflare.light.png
%{_datadir}/warp/images/ZeroTrust.png

%changelog
* Sun Oct 19 2025 itachi_re <xanbenson99@gmail.com>
- Initial packaging for openSUSE
openSUSE Build Service is sponsored by