deb包完成

This commit is contained in:
gfdgd_xi 2022-08-08 17:14:51 +08:00
parent a901c70045
commit fc38607766
10 changed files with 268 additions and 0 deletions

9
deb/DEBIAN/control Normal file
View File

@ -0,0 +1,9 @@
Package: spark-webapp-runtime-runner
Version: 1.1.0
Maintainer: gfdgd xi <3025613752@qq.com>、为什么您不喜欢熊出没和阿布呢
Homepage: https://gitee.com/gfdgd-xi/spark-webapp-runtime-runner/
Architecture: all
Priority: optional
Depends: spark-webapp-runtime, libdtkcore5, libdtkwidget5, libdtkgui5, curl
Description: gfdgd xi、为什么您不喜欢熊出没和阿布呢 制作的spark-webapp-runtime-runner

3
deb/DEBIAN/postinst Executable file
View File

@ -0,0 +1,3 @@
# !/bin/sh
# 向服务器返回安装数加1不显示内容且忽略错误
curl http://120.25.153.144/spark-webapp-runtime-runner/Install.php?Version=1.1.0 -s > /dev/null | true

View File

@ -0,0 +1,5 @@
{
"Version": "1.1.0",
"UpdateThings": "※1、程序全部重构语言从 Python 转 C++、GUI 从 Tkinter 转 DTK、布局大改参考了 sgb76 大佬的 Wine 运行器设计图、zty79的桌面快捷方式编辑器的参考布局\n※2、程序新增打包功能",
"Thank": "感谢 @星火应用商店 提供的 spark-webapp-runtime 运行环境\n感谢之前 @sgb76 制作的 Wine 运行器设计图以供参考,同时也参考了 @zty79 大佬的桌面快捷方式编辑器的界面布局"
}

View File

@ -0,0 +1,3 @@
#!/bin/bash
XDG_CURRENT_DESKTOP="Deepin"
$1 -platformtheme deepin "$@"

View File

@ -0,0 +1,237 @@
#!/bin/bash
if [ "${1}" == "-h" -o "$1" == "--help" ]
then
echo "Copyright (c) 2019-2021 The Spark Project"
echo "本工具可以快速打包依赖于spark-webapp-runtime在非UOS/deepin上是swrt-liteweb app应用"
echo
echo "This tool can pack web apps quickly with spark-webapp-runtime(swrt-lite on other distros instead of UOS/deepin)"
echo
echo 用法
echo web-packer 链接 标题 图标路径 软件描述 软件包名 维护者 版本号
echo 如果没有任何参数,将以交互式模式运行
echo
echo Usage:
echo web-packer url title icon_path desciption pkgname maintainer version
echo If there are no parameters, it will run in interactive mode
exit 0
fi
if [ "${1}" == "-v" -o "${1}" == "--version" ];then
echo "Copyright (c) 2019-2021 The Spark Project"
echo
echo "0.1.2"
exit 0
fi
#reset
echo "Copyright (c) 2019-2021 The Spark Project"
echo 本工具可以快速打包依赖于spark-webapp-runtime在非UOS上是swrt-liteweb app应用
echo 本工具只能打包在线网页或本地网页,离线服务器网页等高级操作参考以下链接
echo
echo https://gitee.com/deepin-community-store/spark-web-app-runtime/
cd /tmp
mkdir swrt-app-maker
cd swrt-app-maker
#工作目录应当为/tmp/swrt-maker
while [ ! $url ]
do
if [ ! $1 ]
then
echo "没有检测任何参数,以交互式模式运行"
echo "请输入你要打包的网址(需要填写协议比如https://spark-app.store的https://也是需要的)"
read url
else
echo "检测到url跳过获取"
url="$1"
echo "读取到的url为$url"
fi
if [ ! $url ]
then
echo "没有检测到网址,请重新输入!"
sleep 3
clear
else
echo "网址读取成功检测是否为http/file开头"
fi
urlstring=${url}
urlstr=${urlstring:0:4}
if [ "http" == ${urlstr} -o "file" == ${urlstr} ]
then
echo "检测到http/https/file协议继续"
echo
else
echo "没有检测到http/https/file类型协议请确认你填写了"
sleep 3
unset url
clear
fi
done
while [ ! $title ]
do
if [ ! $2 ]
then
echo "请输入你要打包的应用标题"
echo
read title
else
echo "检测到标题,跳过获取"
title="$2"
echo "读取到的标题为:$title"
fi
done
while [ ! $icon ]
do
if [ ! $3 ]
then
echo "请输入你要打包的应用图标绝对路径可以拖动图标文件到终端只支持png"
read icon
echo
else
echo "检测到图标,跳过获取"
icon="$3"
echo "读取到的图标路径为:$icon"
fi
iconpath=`echo "$icon" | sed $'s/\'//g'`
icon=$iconpath
echo "去除可能的单引号后得到:$icon"
echo
#'
done
while [ ! $des ]
do
if [ ! $4 ]
then
echo "请输入你要打包的应用描述"
read des
echo
else
echo "检测到描述,跳过获取"
des="$4"
echo "读取到的描述为:$des"
fi
done
while [ ! $pkgname ]
do
if [ ! $5 ]
then
echo "请输入你要打包的应用包名一般为web-xxxxxx比如web-baidu.com不能有中文或特殊符号或空格空格用-代替)"
read pkgname
echo
else
echo "检测到包名,跳过获取"
pkgname="$5"
echo "读取到的包名为:$pkgname"
fi
done
while [ ! $maintainer ]
do
if [ ! $6 ]
then
echo "请输入你的昵称这会出现在deb中"
read maintainer
echo
else
echo "检测到维护者名,跳过获取"
maintainer="$6"
echo "读取到的维护者为:$maintainer"
fi
done
while [ ! $version ]
do
if [ ! "$7" -a ! "$6" ]
then
echo "请输入文件版本号这不是必须的。如果你想要更新一个已有的应用那么请输入比1.0大的版本"
echo "如果不是请直接输入回车会默认填写1.0"
read version
echo
if [ ! $version ];then
version="1.0"
fi
elif [ ! $7 -a $6 ];then
echo "在参数模式,但未检测到版本号"
echo "默认版本号为1.0"
version="1.0"
else
echo "检测到版本号,跳过获取"
version="$7"
echo "读取到的版本号为:$version"
fi
done
echo "开始生成deb包"
echo "输出的control文件为"
echo ""
echo "Package: $pkgname"
echo "Version: $version"
echo "Depends: spark-webapp-runtime(>1.5)"
echo "Maintainer: $maintainer"
echo "Description: A webapp of $url packed by $maintainer using spark webapp runtime"
echo "Architecture: amd64"
echo "-----------------------开始生成-----------------------"
mkdir DEBIAN
cd DEBIAN
touch control
echo "Package: $pkgname" >> ./control
echo "Version: $version" >> ./control
echo "Depends: spark-webapp-runtime(>=1.5)" >> ./control
echo "Maintainer: $maintainer" >> ./control
echo "Description: A webapp of $url packed by $maintainer using spark webapp runtime" >> ./control
echo "Architecture: amd64" >> ./control
cd ..
echo "-----------------------开始生成desktop-----------------------"
mkdir -p usr/share/applications
cd usr/share/applications
touch $pkgname.desktop
echo [Desktop Entry] >> $pkgname.desktop
echo Name=$title >> $pkgname.desktop
echo Exec=spark-webapp-runtime -u "$url" -i "/opt/durapps/$pkgname/icon.png" -t "$title" -d "$des" $8 >> $pkgname.desktop
echo Type=Application >> $pkgname.desktop
echo Terminal=false >> $pkgname.desktop
echo StartupNotify=true >> $pkgname.desktop
echo Encoding=UTF-8 >> $pkgname.desktop
echo Comment=$title >> $pkgname.desktop
echo Icon=/opt/durapps/$pkgname/icon.png >> $pkgname.desktop
cat $pkgname.desktop
echo "-----------------------开始复制icon-----------------------"
cd ../../../
mkdir -p opt/durapps/$pkgname
cd opt/durapps/$pkgname
cp $icon ./icon.png
cd ../../
echo "-----------------------开始打包-----------------------"
cd ..
workdir=`pwd`
echo "回退到工作目录,当前目录位于$workdir"
fakeroot dpkg -b . ../
mv ../${pkgname}_${version}_amd64.deb ~/${pkgname}_${version}_amd64.deb
echo "-----------------------打包结束,软件包在您的用户目录-----------------------"
rm -rf /tmp/swrt-app-maker
xdg-open ~ &
echo 按下回车键退出
exit

View File

@ -0,0 +1 @@
/opt/apps/spark-webapp-runtime-runner/spark-webapp-runtime-runner

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=spark-webapp-runtime 运行器
Version=1.0.2
Exec=/usr/bin/spark-webapp-runtime-runner
Icon=/usr/share/icons/hicolor/256x256/apps/spark-webapp-runtime-runner.png
Type=Application
Terminal=false
StartupNotify=true
Encoding=UTF-8
Categories=Network;

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.