Files
AireOptoSifAndSpectral/deb_pack.sh

62 lines
1.1 KiB
Bash
Raw Normal View History

2025-04-28 10:15:59 +08:00
#!/bin/bash
# 检查是否提供了版本号参数
#if [ $# -eq 0 ]; then
# echo "错误:请提供版本号参数"
# echo "用法: $0 <版本号>"
# exit 1
#fi
2025-04-28 10:15:59 +08:00
2025-11-19 15:11:44 +08:00
VERSION=2.1.5
sh install.sh
2025-04-28 10:15:59 +08:00
thispwd=$(pwd)
#cd /home/pi/
2025-04-28 10:15:59 +08:00
DebDirectory=DebpackTowerSif
mkdir $DebDirectory
cd $DebDirectory/
2025-04-28 09:24:06 +08:00
mkdir -p ./home/pi/bin
cd home/pi/bin/
cp /home/pi/bin/* .
cd ../../..
mkdir DEBIAN
cd DEBIAN
2025-11-04 17:19:32 +08:00
#echo "Package: TowerSif
#Version: $VERSION
#Architecture: armhf
#Maintainer: rlx, tc
#Description: test" > control
cp ../../dpkg/* ./
echo "Version:${VERSION}"
echo "Version:${VERSION}" >> ./control
echo "echo \"V${VERSION}\" > /home/data/version" >> ./postinst
chmod +x ./post*
chmod +x ./control
cd ../
#复制root文件
mkdir -p ./root
cp ../root/* ./root/
chmod +x ./root/*.sh
#复制html文件
mkdir -p ./var/www/html/
cp -r ../html/* ./var/www/html/
chmod +x ./var/www/html/php/*.sh
mkdir -p ./home/data/
cp ../ChangeLog.md ./home/data/ChangeLog.md
2025-04-28 09:24:06 +08:00
#cd /home/pi/
cd $thispwd
2025-11-19 15:11:44 +08:00
sudo dpkg -b $DebDirectory AIRSif_V${VERSION}.deb
mkdir -p DEB
2025-11-19 15:11:44 +08:00
cp AIRSif_V${VERSION}.deb DEB/
2025-04-28 10:15:59 +08:00
rm -r $DebDirectory
2025-04-28 09:24:06 +08:00
#sudo dpkg -r TowerSif
2025-04-28 10:15:59 +08:00