From d91e2e0490a62f1e3331f129ffb1265a8372facd Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 2 Jan 2024 11:12:53 +0800 Subject: [PATCH] add inkscape --- inkscape/package.sh | 103 ++++++++++++++++++++++++++++++++++++++++++++ neovim/package.sh | 2 +- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100755 inkscape/package.sh diff --git a/inkscape/package.sh b/inkscape/package.sh new file mode 100755 index 0000000..464bfab --- /dev/null +++ b/inkscape/package.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +app_name="inkscape" +tmp_dir="/tmp/${app_name}_tmp" +version="1.3.2" +release="v${version}" +deb_arch="amd64" + + +deb_url="https://media.inkscape.org/dl/resources/file/Inkscape-091e20e-x86_64.AppImage" + +# 创建临时目录, 用于下载官方包 +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" +mkdir -p "./unpack/usr/bin" +mkdir -p "./unpack/usr/share/applications" + +echo "下载官方原包..." +wget $deb_url -O "${tmp_dir}/${app_name}" + + +echo "解包完成, 复制到待打包目录..." +mv "${tmp_dir}/${app_name}" "./unpack/usr/bin/" + +chmod +x ./unpack/usr/bin/inkscape + +rm -rf $tmp_dir + +echo """ +[Desktop Entry] +Name=${app_name} +Exec=${app_name} +Icon=${app_name} +Terminal=false +StartupWMClass=${app_name} +Type=Application +Categories=Graphics; +""" > ./unpack/usr/share/applications/inkscape.desktop + +echo "复制完成, 计算文件md5..." + +cd ./unpack + +find usr/ -type f | xargs md5sum > DEBIAN/md5sums + +IFS=$'\t' read -ra size <<< "$(du -d 0)" + +echo """ +Package: ${app_name}-stable +Version: ${version} +Section: graphics +Installed-Size: ${size[0]} +Architecture: ${deb_arch} +Maintainer: Yutent +Priority: optional +Provides: ${app_name} +Breaks: ${app_name} +Replaces: ${app_name} +Homepage: https://inkscape.org/ +Description: A powerful, free design tool. + Inkscape is an illustration editor which has everything needed to + create professional-quality computer art. You can use it to make + diagrams and illustrations, technical drawings, web graphics, clip art, + icons and logos. A collection of hands-on tutorials show you how to + combine lines, shapes and text of different types and styles to build + up a picture. + . + A selection of powerful vector graphics editing tools comes as + standard. There is excellent support for paths, gradients, layers, + alpha transparency and text flow control. An extensive library of + filters allow you to apply realistic effects and extensions allow you + to work with bitmaps, barcodes and printing marks, amongst other things. + . + Most of the common vector formats are supported, including PDF, Adobe + Illustrator and AutoCAD files, and it has unrivalled support for the + SVG web graphics standard. + +""" > DEBIAN/control + +echo '计算文件md5完成, 打包中...' + +cd .. +sudo chown -R root:root unpack + +dpkg-deb -b ./unpack "./${app_name}-${deb_arch}_${version}.deb" + +sudo rm -rf ./unpack +echo "打包完成 :)" diff --git a/neovim/package.sh b/neovim/package.sh index 5d870db..910efd7 100755 --- a/neovim/package.sh +++ b/neovim/package.sh @@ -55,7 +55,7 @@ Breaks: neovim-runtime (<= 0.7.2-7) Replaces: neovim-runtime (<= 0.7.2-7) Maintainer: Yutent Priority: optional -Section: devel +Section: devlop Installed-Size: ${size[0]} Homepage: https://github.com/neovim/neovim Description: heavily refactored vim fork