mirror of
https://gitee.com/spark-store-project/uos-packaging-tools
synced 2025-05-21 23:49:52 +08:00
init
This commit is contained in:
parent
f886018e06
commit
7b66181ecb
README.md
src
DEBIAN
opt/uos-packaging-tools
usr
bin
share
applications
deepin/dde-file-manager/oem-menuextensions
icons
polkit-1/actions
5
README.md
Normal file
5
README.md
Normal file
@ -0,0 +1,5 @@
|
||||
uos-packaging-tools 一共包含了五个工具
|
||||
|
||||
可在deepin/UOS上使用
|
||||
|
||||
详细介绍见帖子
|
9
src/DEBIAN/control
Normal file
9
src/DEBIAN/control
Normal file
@ -0,0 +1,9 @@
|
||||
Package: uos-packaging-tools
|
||||
Version: 1.0.1
|
||||
Architecture: all
|
||||
Maintainer: shenmo<shenmo@spark-app.store>
|
||||
Installed-Size: 10
|
||||
Depends: libnotify-bin,fakeroot,zstd,store.spark-app.appimage2deb | appimage2deb ,policykit-1
|
||||
Section: graphics
|
||||
Priority: optional
|
||||
Description: uos-packaging-tools
|
35
src/opt/uos-packaging-tools/directory-create
Executable file
35
src/opt/uos-packaging-tools/directory-create
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "参数错误,请提供至少一个deb文件的目录路径"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for deb_file in "$@"
|
||||
do
|
||||
cd "$(dirname "$deb_file")"
|
||||
|
||||
# 获取deb包的包名和架构
|
||||
package_name=$(dpkg-deb -f "$deb_file" Package)
|
||||
architecture=$(dpkg-deb -f "$deb_file" Architecture)
|
||||
|
||||
# 创建文件夹
|
||||
folder_name="$package_name"
|
||||
mkdir "$folder_name"
|
||||
cd "$folder_name"
|
||||
|
||||
# 创建子文件夹和空文件
|
||||
mkdir "icons" "screenshot"
|
||||
touch "info.txt" "author.txt"
|
||||
|
||||
# 创建与架构名相同的文件夹并移动deb包
|
||||
mkdir "$architecture"
|
||||
mv "$deb_file" "$architecture/"
|
||||
|
||||
cp -r /opt/apps/"$package_name"/entries/icons/* icons/
|
||||
|
||||
echo "操作完成!"
|
||||
|
||||
echo "---------------------------------------------------------------------------"
|
||||
done
|
||||
|
19
src/opt/uos-packaging-tools/just-X-me
Executable file
19
src/opt/uos-packaging-tools/just-X-me
Executable file
@ -0,0 +1,19 @@
|
||||
#/bin/bash
|
||||
TMPDIR="/tmp"
|
||||
|
||||
unpack_package() {
|
||||
DEBPATH="$1"
|
||||
package_name=$(dpkg-deb -f "$DEBPATH" Package)
|
||||
OUTPATH=$(dirname "$DEBPATH")
|
||||
mkdir -p "$OUTPATH/$package_name/DEBIAN/"
|
||||
dpkg -e "$DEBPATH" "$OUTPATH/$package_name/DEBIAN/"
|
||||
dpkg -X "$DEBPATH" "$OUTPATH/$package_name/"
|
||||
notify-send "$package_name 解包已完成" -i /usr/share/icons/uos-packaging-tools.png
|
||||
|
||||
echo "---------------------------------------------------------------------------"
|
||||
}
|
||||
|
||||
for arg in "$@"; do
|
||||
unpack_package "$arg"
|
||||
done
|
||||
|
44
src/opt/uos-packaging-tools/just-install-me
Executable file
44
src/opt/uos-packaging-tools/just-install-me
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
function notify-send()
|
||||
{
|
||||
#Detect the user using such display
|
||||
local user=$(who | awk '{print $1}' | head -n 1)
|
||||
|
||||
#Detect the id of the user
|
||||
local uid=$(id -u $user)
|
||||
|
||||
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@"
|
||||
}
|
||||
|
||||
if [ -e /usr/local/bin/ssaudit ];then
|
||||
|
||||
for DEBPATH in "$@"
|
||||
do
|
||||
DEBPATH=$(realpath "$DEBPATH")
|
||||
notify-send "正在使用ssaudit安装 $(dpkg-deb -f "$DEBPATH" Package),请稍候...." -i /usr/share/icons/uos-packaging-tools.png
|
||||
/usr/local/bin/ssaudit "$DEBPATH"
|
||||
if [ "$?" = "0" ];then
|
||||
notify-send "$(dpkg-deb -f "$DEBPATH" Package) 安装已完成" -i /usr/share/icons/uos-packaging-tools.png
|
||||
else
|
||||
notify-send "$(dpkg-deb -f "$DEBPATH" Package) 安装出错!请手动安装!" -i /usr/share/icons/uos-packaging-tools.png
|
||||
fi
|
||||
|
||||
echo "---------------------------------------------------------------------------"
|
||||
done
|
||||
else
|
||||
|
||||
for DEBPATH in "$@"
|
||||
do
|
||||
DEBPATH=$(realpath "$DEBPATH")
|
||||
notify-send "正在使用apt安装 $(dpkg-deb -f "$DEBPATH" Package),请稍候...." -i /usr/share/icons/uos-packaging-tools.png
|
||||
apt install "$DEBPATH" --reinstall -y
|
||||
if [ "$?" = "0" ];then
|
||||
notify-send "$(dpkg-deb -f "$DEBPATH" Package) 安装已完成" -i /usr/share/icons/uos-packaging-tools.png
|
||||
else
|
||||
notify-send "$(dpkg-deb -f "$DEBPATH" Package) 安装出错!请手动安装!" -i /usr/share/icons/uos-packaging-tools.png
|
||||
fi
|
||||
|
||||
echo "---------------------------------------------------------------------------"
|
||||
done
|
||||
fi
|
24
src/opt/uos-packaging-tools/just-repack-me
Executable file
24
src/opt/uos-packaging-tools/just-repack-me
Executable file
@ -0,0 +1,24 @@
|
||||
#/bin/bash
|
||||
|
||||
TMPDIR=/tmp
|
||||
OUTPATH=""
|
||||
|
||||
for DEBPATH in "$@"
|
||||
do
|
||||
rm -rf $TMPDIR/unpack-dir
|
||||
mkdir -p "$TMPDIR/unpack-dir"
|
||||
cd "$TMPDIR/unpack-dir"
|
||||
ar -vx "$DEBPATH"
|
||||
rm debian-binary
|
||||
tar -xvf data.tar*
|
||||
mkdir DEBIAN
|
||||
tar -xvf control.tar* -C ./DEBIAN
|
||||
rm data.tar* control.tar*
|
||||
dpkg-deb -Z xz -b "$TMPDIR/unpack-dir/" "$OUTPATH"
|
||||
echo "Repack finished for $(dpkg-deb -f $DEBPATH Package). Remove tmp dir."
|
||||
rm -rf "$TMPDIR/unpack-dir"
|
||||
notify-send $(dpkg-deb -f "$DEBPATH" Package)重打包已完成 -i /usr/share/icons/uos-packaging-tools.png
|
||||
done
|
||||
|
||||
echo "---------------------------------------------------------------------------"
|
||||
|
9
src/usr/bin/pack
Executable file
9
src/usr/bin/pack
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
if [ "$1" != "" ];then
|
||||
opt=$1
|
||||
else
|
||||
opt=`pwd`
|
||||
fi
|
||||
dpkg-deb -Z xz -b $opt $opt/..
|
||||
notify-send `basename $opt`打包完成 -i /usr/share/icons/uos-packaging-tools.png
|
||||
exit
|
10
src/usr/share/applications/directory-create.desktop
Normal file
10
src/usr/share/applications/directory-create.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Categories=Development;
|
||||
Encoding=UTF-8
|
||||
Exec=/opt/uos-packaging-tools/directory-create %U
|
||||
Icon=uos-packaging-tools
|
||||
MimeType=application/vnd.debian.binary-package;application/x-deb;
|
||||
Name=生成目录
|
||||
StartupWMClass=生成目录
|
||||
Terminal=false
|
||||
Type=Application
|
10
src/usr/share/applications/just-X-me.desktop
Normal file
10
src/usr/share/applications/just-X-me.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Categories=Development;
|
||||
Encoding=UTF-8
|
||||
Exec=/opt/uos-packaging-tools/just-X-me %U
|
||||
Icon=uos-packaging-tools
|
||||
MimeType=application/vnd.debian.binary-package;application/x-deb;
|
||||
Name=直接解包
|
||||
StartupWMClass=直接解包
|
||||
Terminal=false
|
||||
Type=Application
|
10
src/usr/share/applications/just-install-me.desktop
Normal file
10
src/usr/share/applications/just-install-me.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Categories=Development;
|
||||
Encoding=UTF-8
|
||||
Exec=pkexec /opt/uos-packaging-tools/just-install-me %U
|
||||
Icon=uos-packaging-tools
|
||||
MimeType=application/vnd.debian.binary-package;application/x-deb;
|
||||
Name=直接安装
|
||||
StartupWMClass=直接安装
|
||||
Terminal=false
|
||||
Type=Application
|
10
src/usr/share/applications/just-repack-me.desktop
Normal file
10
src/usr/share/applications/just-repack-me.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Categories=Development;
|
||||
Encoding=UTF-8
|
||||
Exec=/opt/uos-packaging-tools/just-repack-me %U
|
||||
Icon=uos-packaging-tools
|
||||
MimeType=application/vnd.debian.binary-package;application/x-deb;
|
||||
Name=重新打包
|
||||
StartupWMClass=重新打包
|
||||
Terminal=false
|
||||
Type=Application
|
@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Exec=/usr/bin/pack %U
|
||||
Name=Pack Here
|
||||
Icon=uos-packaging-tools
|
||||
Type=Application
|
||||
X-DFM-MenuTypes=SingleDir;SingleFile;MultiFileDirs;
|
||||
Terminal=true
|
BIN
src/usr/share/icons/uos-packaging-tools.png
Normal file
BIN
src/usr/share/icons/uos-packaging-tools.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 58 KiB |
18
src/usr/share/polkit-1/actions/store.spark-app.uos-packaging-tools-just-install-me.policy
Normal file
18
src/usr/share/polkit-1/actions/store.spark-app.uos-packaging-tools-just-install-me.policy
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
<vendor>Spark Store</vendor>
|
||||
<icon_name>x-package-repository</icon_name>
|
||||
<action id="store.spark-app.ssinstall">
|
||||
<description>运行justinstallme需要权限</description>
|
||||
<message>要使用ssinstall需要权限</message>
|
||||
<defaults>
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/opt/uos-packaging-tools/just-install-me</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
Loading…
x
Reference in New Issue
Block a user