File wps-office.spec of Package wps-office
%global debug_package %{nil}
%global __provides_exclude_from ^/opt/.*$
%global __requires_exclude ^lib(aeo|asound|atk|Qt|xsl|av|c\\+\\+|cef|curl|et|grid|icu|html|jde|js|k|media|my|opencv|qing|paho|search|thrift|tiff|uof|v8|vbe|wp|xcb|xkb|xe|KMailLib).*$
%global _missing_build_ids_terminate_build 0
%define program_version 11.1.0.10976
Name: wps-office
Version: %{program_version}
Release: 0%{?dist}
Summary: WPS Office Suite
License: SUSE-NonFree
Group: Productivity/Office/Suite
URL: http://wps-community.org/
Source0: %{name}.rpm
Source1: %{name}.rpmlintrc
BuildRequires: bash
BuildRequires: chrpath
BuildRequires: cpio
BuildRequires: desktop-file-utils
BuildRequires: hicolor-icon-theme
BuildRequires: rpm
%if 0%{?suse_version} || 0%{?fedora} || 0%{?mageia}
BuildRequires: fdupes
%endif
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
Requires: libc++.so.1()(64bit)
ExclusiveArch: x86_64
%description
WPS Office including Writer, Presentation
and Spreadsheets, is a powerful office suite, which is able to process
word file, produce wonderful slides, and analyze data as well. It is
deeply compatible with all of the latest Microsoft Office file formats.
It can easily open and read the documents created with Microsoft Office.
This is the Linux version, and it's now an BETA package.
Welcome to our website: http://wps-community.org
%prep
%build
%install
# Extract rpm file
# -i: extract
# -d: create directory when necessary
# -m: preserve modification time
rpm2cpio %{SOURCE0} | cpio -idm -D %{buildroot}
# Use system libraries for better security and faster startup
for n in "libbz2.so*" "libc++.so*" "libc++abi.so*" "libcairo.so*" "libcrypto.so*" "libdbus-1.so*" "libjpeg.so*" "libsmime3.so" "libnss3.so*" "libnssckbi.so*" "libnssdbm3.so*" "libnssutil3.so*" "libstdc++.so*" "libodbc.so*" "libodbccr.so*" "libodbcinst.so*" "libpng16.so*" "libSDL2.so*" "libSDL2-2.0.so*" "libssl.so*" "libswscale.so*" "libswresample.so*" "libtcmalloc_minimal.so*"
do
for t in f l
do
find %{buildroot} -type $t -name $n -exec rm -f {} \;
done
done
# Fix invalid RPATH
# bad example: /build/data/rc_v11_qt5_linux_personal_20210730_branch/x64_N/wpsenv/qt/build_x64/qtbase/lib:/build/data/rc_v11_qt5_linux_personal_20210730_branch/x64_N/wpsenv/3rd/installed/x64-linux/lib
STRIP_FILE_LIST=$(find %{buildroot}/opt/ -type f -name "*.so*")" "$(find %{buildroot}/opt/kingsoft/wps-office/office*/ -maxdepth 1 -type f -name transerr -o -name et -o -name wpp -o -name wpspdf -o -name parsecloudfiletool -o -name wps -o -name promecefpluginhost)
for f in ${STRIP_FILE_LIST}
do
RPATH_DIR_LIST=$(chrpath -l ${f}|cut -d' ' -f2|cut -d'=' -f2|tr ':' '\n')
# No RPATH
[ "${RPATH_DIR_LIST}" = "no" ] && continue
RPATH_DIR=""
for p in ${RPATH_DIR_LIST}
do
[ -z "${p}" ] && continue
[[ "${p}" =~ "build/data" ]] && continue
[ -z "${RPATH_DIR}" ] && RPATH_DIR=${p} || RPATH_DIR=${RPATH_DIR}":"${p}
done
# Remove invalid RPATH
[ -z "${RPATH_DIR}" ] && chrpath --delete ${f} && continue
chrpath -r "${RPATH_DIR}" ${f}
done
# Fix world-writable
find %{buildroot} -type f -perm 757 -exec chmod 644 {} \;
%if 0%{?suse_version} || 0%{?fedora} || 0%{?mageia}
%fdupes -s %{buildroot}/opt/
%fdupes -s %{buildroot}/usr/share/icons/
%endif
%files
%dir /opt/kingsoft
/opt/kingsoft/*
/usr/bin/*
/usr/share/applications/*
%dir /usr/share/desktop-directories
/usr/share/desktop-directories/*
%dir /usr/share/fonts/wps-office
/usr/share/fonts/wps-office/*
/usr/share/icons/hicolor/*/apps/*
/usr/share/icons/hicolor/*/mimetypes/*
/usr/share/mime/packages/*.xml
%dir /usr/share/templates
/usr/share/templates/*.desktop
%dir /usr/share/templates/.source
/usr/share/templates/.source/*
%dir /etc/xdg/menus
%dir /etc/xdg/menus/applications-merged
/etc/xdg/menus/applications-merged/*
%changelog