#!/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 "打包完成 :)"