# Description: WPS Office for Linux # URL: https://www.wps.cn/product/wpslinux# # Maintainer: Petar Petrov, slackalaxy at gmail dot com # Depends on: brotli cups double-conversion gnutls graphite2 gtk3 icu keyutils krb5 libidn2 libsdl2 nss openssl11 qrencode qt5 unixodbc wayland name=wps-office version=12.1.2.22571.AK _preread=480057 _elogind=255.5 release=1 source=(https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2023/22570/wps-office_${version}.preread.sw_${_preread}_amd64.deb https://github.com/elogind/elogind/archive/refs/tags/v${_elogind}.tar.gz en_GB.tar.xz $name.sh $name.desktop) build() { ar -x $SRC/${name}_${version}.preread.sw_${_preread}_amd64.deb tar xvf data.tar.xz mkdir -p $PKG/usr/lib/$name cp -a $SRC/opt/kingsoft/$name/office6 $PKG/usr/lib/$name # Use this single wrapper, since et, wpp, etc... do not start, # and the wps default wrapper has trouble with absolute paths, # meaning that "Open with" menu in your file browser won't work. install -D -m 755 $SRC/$name.sh $PKG/usr/bin/$name # British English dictionaries cp -a $SRC/en_GB $PKG/usr/lib/wps-office/office6/dicts/spellcheck/ # Do not use WPS file icons, however leave them just in case mkdir -p $PKG/usr/share/applications cp -a $SRC/$name.desktop $PKG/usr/share/applications cp -a $SRC/usr/share/{icons,mime} $PKG/usr/share # writer mimetype icons wri=( doc dot wps wpt wpss wpso ) for w in ${wri[@]}; do sed -i "s:wps-office-$w:x-office-document:g" $PKG/usr/share/mime/packages/custom-wps-office.xml done # spreadsheet mimetype icons spr=( xls xlt et ett ets eto ) for s in ${spr[@]}; do sed -i "s:wps-office-$s:x-office-spreadsheet:g" $PKG/usr/share/mime/packages/custom-wps-office.xml done # presentations mimetype icons pre=( ppt pot dps dpt dpss dpso ) for p in ${pre[@]}; do sed -i "s:wps-office-$p:x-office-presentation:g" $PKG/usr/share/mime/packages/custom-wps-office.xml done # create file for revdep mkdir -p $PKG/etc/revdep.d cd $PKG/usr/lib/$name/office6 # https://stackoverflow.com/questions/539583/how-do-i-recursively-list-all-directories-at-a-location-breadth-first find . -type d | perl -lne 'print tr:/::, " $_"' | sort -n | cut -d' ' -f2 > $PKG/etc/revdep.d/$name sed -i "s:\.:/usr/lib/wps-office/office6:g" $PKG/etc/revdep.d/$name # trick it to think we have systemd, this is needed for changing themes cd $SRC/elogind-${_elogind} mkdir build cd build meson \ --buildtype release \ --prefix /usr \ --libdir /usr/lib/wps-office/elogind \ -D udevrulesdir="/lib/udev/rules.d" \ -D man=disabled \ -D html=disabled \ -D bashcompletiondir="/usr/share/bash-completion/completions" \ -D nobody-group=nogroup \ -D pam=disabled \ -D pamlibdir="/lib/security" \ -D pamconfdir="/etc/pam.d" \ -D acl=disabled \ -D smack=false \ -D utmp=false \ -D default-hierarchy=legacy \ -D cgroup-controller=elogind \ -D halt-path=/sbin/halt \ -D poweroff-path=/sbin/poweroff \ -D reboot-path=/sbin/reboot \ -D default-kill-user-processes=false .. ninja mkdir -p $PKG/usr/lib/wps-office/elogind/ cp -a libelogind.so libelogind.so.0 libelogind.so.0.38.0 $PKG/usr/lib/wps-office/elogind/ cd $PKG/usr/lib/wps-office/office6 ln -s ../elogind/libelogind.so libsystemd.so.0 ln -s /usr/lib/libmysqlclient.so libmysqlclient.so.18 find $PKG/ -name "*README*" -delete rm -rf $PKG/usr/lib/wps-office/office6/libpeony-wpsprint-menu-plugin.so rm -rf $PKG/usr/lib/wps-office/office6/libbz2.so rm -rf $PKG/usr/lib/wps-office/office6/{libstdc++.so,libstdc++.so*} rm -rf $PKG/usr/lib/wps-office/office6/{libjpeg.so,libjpeg.so*} }