%global __os_install_post %{nil} Name: weixin-ukylin Version: 2.1.4 Release: 3%{?dist} Summary: UKylin WeChat Group: Applications/Internet License: see /opt/weixin/etc/LICENSE URL: https://archive.ubuntukylin.com/software/pool/partner/weixin_%{version}_amd64.deb BuildRequires: bsdtar curl Requires: bubblewrap xdg-utils gtk3 libnotify nss libXScrnSaver libXtst at-spi2-core libsecret alsa-lib libdrm libxshmfence mesa-libgbm %description Electron WeChat released by Ubuntu Kylin. %prep mkdir -p %{_sourcedir} # Download deb file echo "73c69c5b029ad55bc4ad40656ae033188cd9cc4a553c903b4efac3eb5a0ec54c %{_sourcedir}/weixin.deb" > %{_sourcedir}/weixin.sha256sum if ! sha256sum -c --status %{_sourcedir}/weixin.sha256sum &>/dev/null; then curl %{url} --output %{_sourcedir}/weixin.deb sha256sum -c --status %{_sourcedir}/weixin.sha256sum fi %build mkdir -p %{_builddir} rm -rf %{_builddir}/* # Extract deb file bsdtar xf %{_sourcedir}/weixin.deb -C %{_builddir} cd %{_builddir} bsdtar xf data.tar.xz rm -rf control.tar.xz data.tar.xz debian-binary # Move license files to weixin dir mv etc opt/weixin/ # Create bwrap mount point mkdir etc touch etc/.kyact touch etc/LICENSE # Create launch scripts, using bwrap to mount license files cat <<'EOF' > opt/weixin/weixin.sh #!/bin/bash wechat_pid=$(ps hf -opid -C weixin | awk '{ print $1; exit }') if test $wechat_pid; then kill $wechat_pid fi bwrap --dev-bind / / \ --bind /opt/weixin/etc/lsb-release-ukui /etc/lsb-release \ --bind /opt/weixin/etc/LICENSE /etc/LICENSE \ --bind /opt/weixin/etc/.kyact /etc/.kyact \ /opt/weixin/weixin --no-sandbox "$@" EOF chmod +x opt/weixin/weixin.sh # Change desktop entry exec file sed -i "s|Exec=/opt/weixin/weixin|Exec=/opt/weixin/weixin.sh|g" usr/share/applications/weixin.desktop %install mkdir -p %{buildroot} cd %{buildroot} cp -a %{_builddir}/* %{buildroot} %post # Add suid permission required in deb postin file chmod 4755 /opt/weixin/chrome-sandbox if [ $1 -eq 1 ] ; then # install # Create bwrap mount point ln -s os-release /etc/lsb-release 2>/dev/null || true fi %postun if [ $1 -eq 0 ] ; then # uninstall cd /etc # Remove lsb-release file if test -L lsb-release && test "$(readlink lsb-release)" = "os-release"; then rm -f lsb-release fi fi %files "/etc/.kyact" "/etc/LICENSE" %dir "/opt/weixin/" "/opt/weixin/weixin.sh" %dir "/opt/weixin/etc" "/opt/weixin/etc/.kyact" %license "/opt/weixin/etc/LICENSE" "/opt/weixin/etc/lsb-release-ukui" "/opt/weixin/LICENSE.electron.txt" "/opt/weixin/LICENSES.chromium.html" "/opt/weixin/chrome-sandbox" "/opt/weixin/chrome_100_percent.pak" "/opt/weixin/chrome_200_percent.pak" "/opt/weixin/chrome_crashpad_handler" "/opt/weixin/icudtl.dat" "/opt/weixin/libEGL.so" "/opt/weixin/libGLESv2.so" "/opt/weixin/libffmpeg.so" "/opt/weixin/libvk_swiftshader.so" "/opt/weixin/libvulkan.so.1" %dir "/opt/weixin/locales/" "/opt/weixin/locales/am.pak" "/opt/weixin/locales/ar.pak" "/opt/weixin/locales/bg.pak" "/opt/weixin/locales/bn.pak" "/opt/weixin/locales/ca.pak" "/opt/weixin/locales/cs.pak" "/opt/weixin/locales/da.pak" "/opt/weixin/locales/de.pak" "/opt/weixin/locales/el.pak" "/opt/weixin/locales/en-GB.pak" "/opt/weixin/locales/en-US.pak" "/opt/weixin/locales/es-419.pak" "/opt/weixin/locales/es.pak" "/opt/weixin/locales/et.pak" "/opt/weixin/locales/fa.pak" "/opt/weixin/locales/fi.pak" "/opt/weixin/locales/fil.pak" "/opt/weixin/locales/fr.pak" "/opt/weixin/locales/gu.pak" "/opt/weixin/locales/he.pak" "/opt/weixin/locales/hi.pak" "/opt/weixin/locales/hr.pak" "/opt/weixin/locales/hu.pak" "/opt/weixin/locales/id.pak" "/opt/weixin/locales/it.pak" "/opt/weixin/locales/ja.pak" "/opt/weixin/locales/kn.pak" "/opt/weixin/locales/ko.pak" "/opt/weixin/locales/lt.pak" "/opt/weixin/locales/lv.pak" "/opt/weixin/locales/ml.pak" "/opt/weixin/locales/mr.pak" "/opt/weixin/locales/ms.pak" "/opt/weixin/locales/nb.pak" "/opt/weixin/locales/nl.pak" "/opt/weixin/locales/pl.pak" "/opt/weixin/locales/pt-BR.pak" "/opt/weixin/locales/pt-PT.pak" "/opt/weixin/locales/ro.pak" "/opt/weixin/locales/ru.pak" "/opt/weixin/locales/sk.pak" "/opt/weixin/locales/sl.pak" "/opt/weixin/locales/sr.pak" "/opt/weixin/locales/sv.pak" "/opt/weixin/locales/sw.pak" "/opt/weixin/locales/ta.pak" "/opt/weixin/locales/te.pak" "/opt/weixin/locales/th.pak" "/opt/weixin/locales/tr.pak" "/opt/weixin/locales/uk.pak" "/opt/weixin/locales/vi.pak" "/opt/weixin/locales/zh-CN.pak" "/opt/weixin/locales/zh-TW.pak" %dir "/opt/weixin/resources/" %dir "/opt/weixin/resources/app/" "/opt/weixin/resources/app/package.json" %dir "/opt/weixin/resources/app/packages/" %dir "/opt/weixin/resources/app/packages/alita/" %dir "/opt/weixin/resources/app/packages/alita/libs/" "/opt/weixin/resources/app/packages/alita/libs/alita.node" "/opt/weixin/resources/app/packages/alita/libs/alita_log.node" %dir "/opt/weixin/resources/app/packages/alita/libs/lib/" "/opt/weixin/resources/app/packages/alita/libs/lib/libowl.so" "/opt/weixin/resources/app/packages/alita/libs/lib/libprivate_protobuf.so" "/opt/weixin/resources/app/packages/alita/libs/lib/libwechat_alita.so" %dir "/opt/weixin/resources/app/packages/main/" %dir "/opt/weixin/resources/app/packages/main/dist/" %dir "/opt/weixin/resources/app/packages/main/dist/bin/" %dir "/opt/weixin/resources/app/packages/main/dist/bin/scrot/" "/opt/weixin/resources/app/packages/main/dist/bin/scrot/libImlib2.so.1" "/opt/weixin/resources/app/packages/main/dist/bin/scrot/libImlib2.so.1.5.1" "/opt/weixin/resources/app/packages/main/dist/bin/scrot/libgiblib.so.1" "/opt/weixin/resources/app/packages/main/dist/bin/scrot/libgiblib.so.1.0.6" "/opt/weixin/resources/app/packages/main/dist/bin/scrot/scrot" "/opt/weixin/resources/app/packages/main/dist/index.js" %dir "/opt/weixin/resources/app/packages/preload/" %dir "/opt/weixin/resources/app/packages/preload/dist/" "/opt/weixin/resources/app/packages/preload/dist/home.js" "/opt/weixin/resources/app/packages/preload/dist/login.js" %dir "/opt/weixin/resources/app/packages/renderer/" %dir "/opt/weixin/resources/app/packages/renderer/dist/" "/opt/weixin/resources/app/packages/renderer/dist/index.html" %dir "/opt/weixin/resources/app/packages/renderer/dist/static/" %dir "/opt/weixin/resources/app/packages/renderer/dist/static/css/" "/opt/weixin/resources/app/packages/renderer/dist/static/css/chunk-vendors.c18666a6.css" "/opt/weixin/resources/app/packages/renderer/dist/static/css/index.318606e4.css" %dir "/opt/weixin/resources/app/packages/renderer/dist/static/img/" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Ai.5a970552.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Bin.e879bcf0.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Cdr.0cdac3c2.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Dwg.4c7b6413.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Excel.13ea4925.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Exe.2f8c1f7e.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Ink.631ac578.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Keynote.b9146764.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Movie.cd9a2308.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Music.586a7400.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Number.be7e2806.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/PDF.51c362dd.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/PPT.0f1df0f9.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Pages.f4ee47ec.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Ps.a28bc11a.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Word.951100b4.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Wps.5494df97.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/Zip.390dc144.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/arrow.172543fd.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/arrow.765ec020.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/avatar_default.1f742bda.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/bubble-corner.d7f82ebd.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/checkbox_checked.00cf278c.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/checkbox_radio_default.6a4ae295.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/close.eec542e3.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/contact-active.86983f33.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/contact-default.cc563d1b.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/conversation-active.eb159b47.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/conversation-default.89c1456a.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/dele-item.5b86d4c0.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/folder.47a4841d.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_arrow@2x.abad7844.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_arrow_selected@2x.1555f180.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_cancel@2x.006d542a.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_curve@2x.66951ad5.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_curve_selected@2x.6a3899af.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_done@2x.3efc038e.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_ellipse@2x.9cbf2c3b.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_ellipse_selected@2x.9a012bac.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_mosaic@2x.b3dbeb46.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_mosaic_selected@2x.b73e9fe9.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_rectangle@2x.0cd92f77.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_rectangle_selected@2x.a04c7f01.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_save@2x.799e7a77.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_text@2x.969edb8b.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_text_selected@2x.51b7e3bf.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_undo@2x.166da167.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/ico_undo_disabled@2x.be3b7e2f.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__brower.0f39523e.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__close-window-active.f848bda3.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__close-window-hl.65a9dd5e.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__close-window.58f659ac.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__copylink.1fa3f736.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__file-download.b85db9f9.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__info__gray.248e3a26.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__loading.adebcfe1.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__offline.46e49116.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__play.95c39912.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__refresh.ea63f13b.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__success.5639608b.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon__voice.8d4a0636.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon_capture.a50d41be.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon_capture_drop.558990b3.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon_maximize.3fae52a2.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon_minimize.be7fe2a2.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon_panel_empty.5f6f370a.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icon_share.5811afdf.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/icons_restore.524d0697.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/loading-mask.74e56507.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/more.6f25ae3b.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/more.a5c495ec.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/mute.0cdb1201.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/panel_arrow.41e2447e.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/qrcode-img-mask.229b65e0.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/radio-checked.f8ea8252.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/star.c92aef09.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/sticker.d115f404.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/txt.71271ffd.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/unknow.93669b6a.svg" "/opt/weixin/resources/app/packages/renderer/dist/static/img/wechat_logo.8ce659cf.svg" %dir "/opt/weixin/resources/app/packages/renderer/dist/static/js/" "/opt/weixin/resources/app/packages/renderer/dist/static/js/chunk-vendors.dc350700.js" "/opt/weixin/resources/app/packages/renderer/dist/static/js/index.b0165702.js" "/opt/weixin/resources.pak" "/opt/weixin/snapshot_blob.bin" %dir "/opt/weixin/swiftshader/" "/opt/weixin/swiftshader/libEGL.so" "/opt/weixin/swiftshader/libGLESv2.so" "/opt/weixin/v8_context_snapshot.bin" "/opt/weixin/vk_swiftshader_icd.json" "/opt/weixin/weixin" "/usr/lib/libactivation.so" %dir "/usr/share/applications/" "/usr/share/applications/weixin.desktop" %dir "/usr/share/doc/weixin/" %doc "/usr/share/doc/weixin/changelog.gz" %dir "/usr/share/icons/hicolor/" %dir "/usr/share/icons/hicolor/128x128/" %dir "/usr/share/icons/hicolor/128x128/apps/" "/usr/share/icons/hicolor/128x128/apps/weixin.png" %dir "/usr/share/icons/hicolor/16x16/" %dir "/usr/share/icons/hicolor/16x16/apps/" "/usr/share/icons/hicolor/16x16/apps/weixin.png" %dir "/usr/share/icons/hicolor/256x256/" %dir "/usr/share/icons/hicolor/256x256/apps/" "/usr/share/icons/hicolor/256x256/apps/weixin.png" %dir "/usr/share/icons/hicolor/32x32/" %dir "/usr/share/icons/hicolor/32x32/apps/" "/usr/share/icons/hicolor/32x32/apps/weixin.png" %dir "/usr/share/icons/hicolor/48x48/" %dir "/usr/share/icons/hicolor/48x48/apps/" "/usr/share/icons/hicolor/48x48/apps/weixin.png" %dir "/usr/share/icons/hicolor/64x64/" %dir "/usr/share/icons/hicolor/64x64/apps/" "/usr/share/icons/hicolor/64x64/apps/weixin.png" %changelog * Thu Feb 09 2023 Ruize Tang <1466040111@qq.com> - Fix upgrade/reinstall scriptlets execution order bug * Thu Feb 09 2023 Ruize Tang <1466040111@qq.com> - Use bubblewrap to mount license files * Tue Feb 07 2023 Ruize Tang <1466040111@qq.com> - Init