[Newbies] 实战打包蓝信
Tofloor
poster avatar
石品良
deepin
2022-06-11 20:23
Author

致敬这个教程,来个依葫芦画瓢!

一、准备deb的基本信息

1、容器名

wine-lanxin
2、版本号
7.33.32.602645spark0
3、exe的主执行程序路径
c:/Program Files (x86)/LanxinSoftCustom/main/LxMainNew.exe
4、包名
org.lanxin.spark
5、图标exce执行路径
/opt/apps/org.lanxin.spark/files/run.sh" -f %f

6、短述:一句话介绍你打包的软件
蓝信是一款通讯软件,类似微信等

二、创建空白文件夹

建议在下载文件下创建package文件夹;

在package文件夹创建files、entries、build三个文件夹

截图_选择区域_20220610182846.png

三、制作桌面图标

/.deepinwine/wine-lanxin/drive_c/Program Files (x86)/LanxinSoftCustom/main中查找*.png,找到图标文件app_icon.png,用inkscape另存为纯svg文件格式(网页转换的那个会变黑,没有用)。

将svg图标文件存入第二步的entries文件夹,并将svg文件重命名为:包名.svg,本例为:org.lanxin.spark.svg

四、压缩容器

1、更改当前用户名

将目标容器C盘(即drive_c)下面的users文件下面当前用户名(也就是你自己的用户名)文件夹改为@current_user@

截图_选择区域_20220610210009.png

2、批量修改注册表里的当前用户名

在目标容器里右键——在终端中打开,终端输入:sed -i "s#$USER#@current_user@#" ./*.reg

image.png

3、压缩目标容器为files.7z

在目标容器里右键——在终端中打开,终端输入:

7z a -t7z -r files.7z 容器路径/*

本次为:7z a -t7z -r files.7z ~/.deepinwine/wine-lanxin/*

image.png

4、将压缩好的files.7z移动到第二步的files文件夹

截图_选择区域_20220610183745.png

五、压缩deepin-wine6-stable

由于deepin-wine6-stable是Deepin/UOS系统自带的,无需压缩deepin-wine6-stable。

六、制作执行程序run.sh

我们将wine版微信的run.sh文件和dlls文件夹复制到第二步的files文件夹。

注:wine版微信的run.sh文件和dlls文件夹的路径在:/opt/apps/com.qq.weixin.deepin/files/

image.png

替换run.sh里面的内容:右键用文本编辑器打开run.sh,然后将第一步1-4的信息替换run.sh里面原有的信息。替换好后保存并退出run.sh。

image.png

七、用UOS打包工具(Debreate)打包为deb包

没有安装UOS打包工具的小伙伴,可以去在Deepin/UOS应用商店或星火应用商店下载。

以下步骤需要用到本帖开头第一步的信息,需要把第一步的信息对号入座填进去。

1、control

架构选择amd64或i386

image.png

2、依赖和冲突

由于本教程exe是用deepin-wine6-stable运行,所以依赖项要填写deepin-wine6-stable和deepin-wine-helper。若其他linux系统上没有安装deepin-wine6-stable和deepin-wine-helper,是无法运行我们打包的deb包的。

可以参考这个依赖项:

deepin-wine6-stable:amd64 (>= 6.0.0.19-1)

deepin-wine-helper (>= 5.1.30-1)

截图_init.py_20220610191159.png

3、info文件

应用权限根据软件实际需要勾选

image.png

4、desktop文件

执行路径注意引号,不要漏了。图标那里填写包名即可。分类根据实际情况选择。

image.png

5、icon文件

添加第三步entries文件夹里的图标文件

image.png

6、files目录文件

添加第六步files文件夹里的files.7z、run.sh、dlls文件夹

image.png

7、添加脚本

添加一个可以在卸载该软件时自动删除它的容器的Post-Remove脚本:

#!/bin/bash
for username in `ls /home`  
    do
      echo /home/$username
        if [ -d /home/$username/.deepinwine/wine-lanxin ]  
        then
        rm -rf /home/$username/.deepinwine/wine-lanxin
        fi
done

image.png

注:这里的wine-lanxi是软件的容器,若您的软件不一样,请替换为你自己在第一步第1点所设定的容器名。

8、更新日志(非必须,可略过)

9、版权文件(非必须,可略过)

10、构建

点击中间绿色的开始构建图标,选择第二步的build文件夹就可以开始自动打包了。

截图_init.py_20220610192544.png

打包好后在build文件夹就可以看到deb文件了。

Reply Favorite View the author
All Replies
神末shenmo
deepin
Spark-App
Q&A Team
2022-06-12 00:02
#1

七、 请加入判断是否为更新的脚本


#!/bin/bash

if [ "$1" = "remove" ] || [ "$1" = "purge" ];then

echo "清理卸载残留"
for username in `ls /home`  
    do
      echo /home/$username
        if [ -d /home/$username/.deepinwine/容器 ]
        then
        rm -rf /home/$username/.deepinwine/容器
        fi
    done
else
echo "非卸载,跳过清理"
fi

关于打包:拆开改会更简单一些


如果是准备投给星火商店,可用以下方法进一步优化


‘’

六、建议:可根据 https://gitee.com/deepin-community-store/spark-wine/blob/master/spark-dwine-launch/run-template_v1.sh 修改

如果要使用,请加入依赖 spark-dwine-helper 依赖

关于spark-dwine-helper:做了一些改动以更广泛地适配wine和其他发行版 https://gitee.com/deepin-community-store/spark-wine/releases

Reply View the author
石品良
deepin
2022-06-12 00:59
#2

根据 神末shenmo 的建议进行优化:

7.2 依赖和冲突

增加一条:spark-dwine-helper>=1.6.1

image.png

7.7 添加脚本

添加一个可以在卸载该软件时自动删除它的容器的Post-Remove脚本:

#!/bin/bash

if [ "$1" = "remove" ] || [ "$1" = "purge" ];then

echo"清理卸载残留"
for username in ls /home
do
echo /home/$username
if [ -d /home/$username/.deepinwine/容器 ]
then
rm -rf /home/$username/.deepinwine/容器
fi
done
else
echo"非卸载,跳过清理"
fi

完善run.sh

根据https://gitee.com/deepin-community-store/spark-wine/blob/master/spark-dwine-launch/run-template_v1.sh修改run.sh,在中间增加以下代码。

image.png

image.png

deb文件下载链接: https://pan.baidu.com/s/1ZmnzyBf6j5xGbtmcHoeXVw 提取码: 31vf
--来自百度网盘超级会员v6的分享

Reply View the author
delsin
deepin
2022-06-12 06:28
#3

赞一个。

Reply View the author
张耘赫
deepin
2022-06-12 20:21
#4
delsin

赞一个。

蓝信有linux版本的包不知道你折腾这个干嘛

Reply View the author
石品良
deepin
2022-06-13 05:08
#5
张耘赫

蓝信有linux版本的包不知道你折腾这个干嘛

uos家庭版中的linux版本下载文件不能打开。专业版中下载的又是华为版的。

Reply View the author