使用debian脚本构建deb包

Signed-off-by: gfdgd_xi <3025613752@qq.com>
This commit is contained in:
2026-06-16 22:29:05 +08:00
parent 3aa96f27c7
commit 3d964c9473
10 changed files with 286 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
.DEFAULT_GOAL := build
clean:
rm -rf release/
build:
npm run build:deb
install:
mkdir -p $(DESTDIR)/opt/spark-store/bin/
mkdir -p $(DESTDIR)/opt/spark-store/extras/
mkdir -p $(DESTDIR)/opt/durapps/spark-store/bin/
mkdir -p $(DESTDIR)/usr/share/icons/
mkdir -p $(DESTDIR)/usr/lib/
mkdir -p $(DESTDIR)/usr/bin/
cp -rv release/*/linux-unpacked/* $(DESTDIR)/opt/spark-store/bin/
cp -rv release/*/linux-unpacked/extras/* $(DESTDIR)/opt/spark-store/extras/
cp -rv tool/* $(DESTDIR)/opt/spark-store/bin/
cp -rv pkg/usr/share/fish/ $(DESTDIR)/usr/share/
cp -rv icons/hicolor/ $(DESTDIR)/usr/share/icons/
cp -rv pkg/usr/share/icons/hicolor/ $(DESTDIR)/usr/share/icons/
cp -rv pkg/usr/lib/systemd $(DESTDIR)/usr/lib/
cp -rv pkg/usr/share/applications/ $(DESTDIR)/usr/share/
cp -rv pkg/usr/share/polkit-1 $(DESTDIR)/usr/share/
cp -rv pkg/usr/share/aptss $(DESTDIR)/usr/share/
cp -rv tool/spark-store.asc $(DESTDIR)/opt/durapps/spark-store/bin/
ln -s ../../../spark-store/extras/spark-store $(DESTDIR)/opt/durapps/spark-store/bin/spark-store
+5
View File
@@ -0,0 +1,5 @@
spark-store (5.1.1) UNRELEASED; urgency=medium
* Initial release. (Closes: #nnnn) <nnnn is the bug number of your ITP>
-- gfdgd_xi <3025613752@qq.com> Tue, 16 Jun 2026 21:45:35 +0800
+40
View File
@@ -0,0 +1,40 @@
Source: spark-store
Section: utils
Priority: optional
Maintainer: shenmo <shenmo@spark-app.store>
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
make,
npm,
Standards-Version: 4.7.2
Homepage: https://www.spark-app.store/
Package: spark-store
Architecture: any
Provides: spark-store-console-in-container
Depends:
${shlibs:Depends},
${misc:Depends},
libgtk-3-0,
libnotify4,
libnss3,
libxss1,
libxtst6,
xdg-utils,
libatspi2.0-0,
libuuid1,
libsecret-1-0,
xdg-utils,
shared-mime-info,
aria2,
gnupg,
zenity,
policykit-1 | pkexec,
libnotify-bin,
desktop-file-utils,
lsb-release,
systemd,
curl
Description: Spark Store
A community powered app store, powered by APM.
Vendored Executable
+78
View File
@@ -0,0 +1,78 @@
#!/bin/bash
case "$1" in
configure)
case `arch` in
x86_64)
echo "Enabling i386 arch..."
dpkg --add-architecture i386
;;
aarch64)
echo "Will not enable armhf since 4271"
;;
loongarch64)
echo "Nope we DO NOT WANT ABI1 now"
dpkg --remove-architecture loongarch64
;;
*)
echo "Unknown architecture, skip enable 32-bit arch"
;;
esac
mkdir -p /var/lib/aptss/lists
# Remove the sources.list file
rm -f /etc/apt/sources.list.d/sparkstore.list
rm -f /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list
# Check if /usr/local/bin existed
mkdir -p /usr/local/bin
## I hate /usr/local/bin. We will abandon them later
# Create symbol links for binary files
ln -s -f /opt/durapps/spark-store/bin/spark-store /usr/local/bin/spark-store
ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/local/bin/ssinstall
ln -s -f /opt/durapps/spark-store/bin/ssaudit /usr/local/bin/ssaudit
ln -s -f /opt/durapps/spark-store/bin/ssinstall /usr/bin/ssinstall
ln -s -f /opt/durapps/spark-store/bin/ssaudit /usr/bin/ssaudit
ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/local/bin/spark-dstore-patch
ln -s -f /opt/durapps/spark-store/bin/spark-dstore-patch /usr/bin/spark-dstore-patch
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
# Install key
mkdir -p /tmp/spark-store-install/
cp -f /opt/durapps/spark-store/bin/spark-store.asc /tmp/spark-store-install/spark-store.asc
gpg --dearmor /tmp/spark-store-install/spark-store.asc
cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg
# Start upgrade detect service
systemctl daemon-reload
systemctl enable spark-update-notifier
systemctl start spark-update-notifier
# Update certain caches
cp -fv /opt/spark-store/extras/store.spark-app.spark-store.policy /usr/share/polkit-1/actions/store.spark-app.spark-store.policy
xdg-mime default spark-store.desktop x-scheme-handler/spk
update-mime-database /usr/share/mime || true
# Send email for statistics
#/tmp/spark-store-install/feedback.sh
# Remove temp dir
rm -rf /tmp/spark-store-install
;;
triggered)
spark-dstore-patch
;;
esac
Vendored Executable
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
rm -fv /usr/share/polkit-1/actions/store.spark-app.spark-store.policy
# Update certain caches
update-icon-caches /usr/share/icons/hicolor || true
update-desktop-database /usr/share/applications || true
update-mime-database /usr/share/mime || true
Vendored Executable
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
#检测网络链接畅通
function network-check()
{
#超时时间
local timeout=15
#目标网站
local target=www.baidu.com
#获取响应状态码
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
if [ "x$ret_code" = "x200" ]; then
echo "Network Checked successful ! Continue..."
echo "网络通畅,继续安装"
else
#网络不畅通
echo "Network failed ! Cancel the installation"
echo "网络不畅,终止安装"
exit -1
fi
}
#network-check
echo "不再检测网络"
Vendored Executable
+64
View File
@@ -0,0 +1,64 @@
#!/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 [ "$1" = "remove" -o "$1" = "purge" ] ; then
echo "$1"
echo "卸载操作,进行配置清理"
# Remove residual symbol links
unlink /usr/local/bin/spark-store
unlink /usr/local/bin/ssinstall
unlink /usr/local/bin/ssaudit
unlink /usr/bin/ssinstall
unlink /usr/bin/ssaudit
unlink /usr/local/bin/spark-dstore-patch
unlink /usr/bin/spark-dstore-patch
unlink /usr/local/bin/ss-apt-fast
unlink /usr/bin/aptss
rm -rf /etc/aptss/
rm -rf /var/lib/aptss/
# Remove residual symbol links to stop upgrade detect
rm -f /etc/xdg/autostart/spark-update-notifier.desktop
# Remove config files
for username in `ls /home`
do
echo /home/$username
if [ -d /home/$username/.config/spark-union/spark-store ]
then
rm -rf /home/$username/.config/spark-union/spark-store
fi
done
# Shutdown services
systemctl stop spark-update-notifier
# Stop update detect service
systemctl disable spark-update-notifier
# Remove gpg key file
rm -f /etc/apt/trusted.gpg.d/spark-store.gpg
apt-key del '9D9A A859 F750 24B1 A1EC E16E 0E41 D354 A29A 440C' || true
else
if [ ! -z "`pidof spark-store`" ] ; then
echo "关闭已有 spark-store.."
notify-send "正在升级星火商店" "请在升级结束后重启星火商店" -i spark-store
killall spark-store
fi
fi
Vendored Executable
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1
# See FEATURE AREAS in dpkg-buildflags(1).
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# See ENVIRONMENT in dpkg-buildflags(1).
# Package maintainers to append CFLAGS.
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# Package maintainers to append LDFLAGS.
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
%:
dh $@
override_dh_dwz:
true
override_dh_strip:
true
override_dh_shlibdeps:
true
# dh_make generated override targets.
# This is an example for Cmake (see <https://bugs.debian.org/641051>).
#override_dh_auto_configure:
# dh_auto_configure -- \
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
+1
View File
@@ -0,0 +1 @@
3.0 (quilt)
Vendored Executable
+2
View File
@@ -0,0 +1,2 @@
interest-noawait /opt/apps