File zoom.spec of Package zoom

%global __provides_exclude_from ^/opt/.*$
%global __requires_exclude_from ^/opt/.*$
%define rpm_version %(rpm -qp %{_sourcedir}/%{name}.rpm 2>/dev/null | sed "s|%{name}-\\(.\\+\\)-.*|\\1|")

Name:           zoom
Version:        %{rpm_version}
Release:        0%{?dist}
Summary:        Cloud Meetings
License:        SUSE-NonFree
Group:          Productivity/Networking/Other
URL:            https://www.zoom.us/
Source0:        %{name}.rpm
BuildRequires:  rpm
BuildRequires:  cpio
BuildRequires:  chrpath
BuildRequires:  fdupes

%description
Zoom Cloud Meetings
Zoom brings people together to connect and get more done in a frictionless, secure video environment. Our easy, reliable, and innovative video-first solutions provide video meetings and chat, with additional options for webinars and phone service.

Zoom is the leading unified communications platform and helps individuals, schools, healthcare professionals and enterprises stay connected. Visit blog.zoom.us and follow @zoom_us.

By installing this app, you agree to our Terms of Service (https://zoom.us/terms) and Privacy Statement (https://zoom.us/privacy).

%prep
# No prep needed

%build
# No build needed

%install
# Extract the source RPM
rpm2cpio %{SOURCE0} | cpio -idm -D %{buildroot}

# Clean up build-id directory if present
if [ -d "%{buildroot}/usr/lib/.build-id" ]; then
    rm -rf %{buildroot}/usr/lib/.build-id
fi

# Fix chrome sandbox permissions (security requirement)
if [ -e "%{buildroot}/opt/%{name}/cef/chrome-sandbox" ]; then
    chown root:root %{buildroot}/opt/%{name}/cef/chrome-sandbox
    chmod 4755 %{buildroot}/opt/%{name}/cef/chrome-sandbox
fi

# Remove rpath from shared libraries
find %{buildroot}/opt -name "*.so*" -exec chrpath --delete '{}' \; 2>/dev/null || true

# Remove rpath from main binaries
for binary in aomhost zoom zopen ZoomLauncher ZoomWebviewHost; do
    if [ -f "%{buildroot}/opt/zoom/$binary" ]; then
        chrpath --delete %{buildroot}/opt/zoom/$binary 2>/dev/null || true
    fi
done

# Remove executable bit from non-executable files
find %{buildroot}/opt/zoom/ -type f -executable \( -name "*.pcm" -o -name "*.wav" -o -name "*.txt" -o -name "*.xml" -o -name "*.qm" -o -name "*.qml" -o -name "*.js" \) -exec chmod -x '{}' \; 2>/dev/null || true

# Remove executable bit from JSON files if they exist
if [ -d "%{buildroot}/opt/zoom/json" ]; then
    find %{buildroot}/opt/zoom/json -name "*.json" -exec chmod -x '{}' \; 2>/dev/null || true
fi

# Remove executable bit from getbssid.sh (script without shebang)
if [ -f "%{buildroot}/opt/zoom/getbssid.sh" ]; then
    chmod -x %{buildroot}/opt/zoom/getbssid.sh
fi

# Remove duplicate files
%fdupes %{buildroot}/

%files
%dir /opt/%{name}
/opt/%{name}/*
%{_bindir}/*
%{_datadir}/applications/*
%dir %{_datadir}/doc/%{name}
%{_datadir}/mime/packages/*
%{_datadir}/pixmaps/*

%changelog
openSUSE Build Service is sponsored by