From bfa00650a475198a6c869123027e9ef0d9619c57 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 3 Aug 2023 13:50:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0fcitx5-skin-plain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + fcitx5-skin-plain/package.sh | 71 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100755 fcitx5-skin-plain/package.sh diff --git a/README.md b/README.md index 0869bfd..6def5c2 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,4 @@ - `zellij` A terminal workspace with batteries included +- `fcitx5-skin-plain` fcitx5皮肤 \ No newline at end of file diff --git a/fcitx5-skin-plain/package.sh b/fcitx5-skin-plain/package.sh new file mode 100755 index 0000000..b731f0d --- /dev/null +++ b/fcitx5-skin-plain/package.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +app_name="fcitx5-skin-plain" +tmp_dir="/tmp/${app_name}_tmp" +version="1.0.0" +release="v${version}" + +deb_url="https://github.com/app-cat/fcitx5-skin-plain/archive/refs/tags/${version}.zip" + +# 创建临时目录, 用于下载官方包 +if [ -d $tmp_dir ]; then + rm -rf $tmp_dir +fi + +if [ -d "./unpack" ]; then + sudo rm -rf ./unpack +fi + +if [ -f "./${app_name}_${version}.deb" ]; then + rm "./${app_name}_${version}.deb" +fi + +mkdir $tmp_dir + +# 创建临时待打包目录 +echo "创建待打包目录..." +mkdir -p "./unpack/DEBIAN" + +echo "下载官方原包..." +wget $deb_url -O "${tmp_dir}/${app_name}.zip" + + +echo "下载完成, 解包中..." +unzip "${tmp_dir}/${app_name}.zip" -d $tmp_dir + +echo "解包完成, 复制到待打包目录..." +mv ${tmp_dir}/${app_name}-${version}/src/* "./unpack/" + +rm -rf $tmp_dir + +echo "复制完成, 计算文件md5..." + +cd ./unpack + +find usr/ -type f | xargs md5sum > DEBIAN/md5sums + +IFS=$'\t' read -ra size <<< "$(du -d 0)" + +echo """ +Package: ${app_name} +Version: ${version} +Section: devlop +Installed-Size: ${size[0]} +Architecture: all +Suggests: fcitx5 +Maintainer: Yutent +Priority: optional +Homepage: https://github.com/app-cat/fcitx5-skin-plain.git +Description: 简约风格的fcitx5皮肤主题. + 提供了\`red、blue、cyan、yellow\`4种色彩及对应的暗色主题. + +""" > DEBIAN/control + +echo '计算文件md5完成, 打包中...' + +cd .. +sudo chown -R root:root unpack + +dpkg-deb -b ./unpack "./${app_name}_${version}.deb" + +echo "打包完成 :)"