-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_deb.sh
More file actions
executable file
·128 lines (94 loc) · 2.83 KB
/
build_deb.sh
File metadata and controls
executable file
·128 lines (94 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
set -euo pipefail
PKG="pibackup_pkg"
version="2.0.2"
OUTDIR="/home/pi/git/pibackup/bin"
SRC_BIN="/home/pi/git/pibackup/source/pibackup"
ICON="/home/pi/git/pibackup/source/pibackup.png"
echo "🚀 Build pibackup.deb"
# Prüfen ob Binary existiert
if [ ! -f "$SRC_BIN" ]; then
echo "❌ Binary nicht gefunden: $SRC_BIN"
exit 1
fi
# Cleanup
rm -rf "$PKG"
# Struktur
mkdir -p "$PKG/DEBIAN"
mkdir -p "$PKG/usr/lib/pibackup"
mkdir -p "$PKG/usr/share/applications"
mkdir -p "$PKG/usr/share/icons/hicolor/256x256/apps"
mkdir -p "$PKG/usr/share/doc/pibackup"
mkdir -p "$PKG/usr/share/doc/pibackup/help"
# Binary
install -Dm755 "$SRC_BIN" \
"$PKG/usr/lib/pibackup/pibackup"
#install -Dm755 /usr/lib/aarch64-linux-gnu/libQt5Pas.so.1 \
# "$PKG/usr/lib/pibackup/libQt5Pas.so.1"
#install -Dm755 /usr/lib/aarch64-linux-gnu/libQt5Pas.so.1.2.14 \
# "$PKG/usr/lib/pibackup/libQt5Pas.so.1.2.14"
# Exclude-Dateien → /etc
install -Dm644 /home/pi/git/pibackup/source/dhcp-cleanup.exclude \
"$PKG/etc/pibackup/dhcp-cleanup.exclude"
install -Dm644 /home/pi/git/pibackup/source/raspberry.exclude \
"$PKG/etc/pibackup/raspberry.exclude"
install -Dm644 /home/pi/git/pibackup/source/ssh-cleanup.exclude \
"$PKG/etc/pibackup/ssh-cleanup.exclude"
install -Dm644 /home/pi/git/pibackup/docs/intro.html \
"$PKG/usr/share/doc/pibackup/help/intro.html"
install -Dm644 /home/pi/git/pibackup/README.md \
"$PKG/usr/share/doc/pibackup/README.md"
install -Dm644 /home/pi/git/pibackup/CHANGELOG.md \
"$PKG/usr/share/doc/pibackup/CHANGELOG.md"
install -Dm644 /home/pi/git/pibackup/LICENSE \
"$PKG/usr/share/doc/pibackup/LICENSE"
cat > "$PKG/etc/pibackup/pibackup.ini" <<EOF
[Drive]
[Destination]
[Exclude]
Last=/etc/pibackup/raspberry.exclude
[Option]
compress=1
DeletePastCompress=0
compresslevel=2
ChangeDeviceID=0
EOF
# Desktop Entry
cat > "$PKG/usr/share/applications/pibackup.desktop" <<EOF
[Desktop Entry]
Name=PiBackup
Comment=Backup and Restore Tool
Exec=sudo /usr/lib/pibackup/pibackup
Icon=pibackup
Terminal=false
Type=Application
Categories=Utility;System;
EOF
# Icon
install -Dm644 "$ICON" \
"$PKG/usr/share/icons/hicolor/256x256/apps/pibackup.png"
# Control-Datei
cat > "$PKG/DEBIAN/control" <<EOF
Package: pibackup
Version: $version
Section: utils
Priority: optional
Architecture: arm64
Maintainer: RaspberryFpc
Depends: zstd, e2fsprogs, sudo, libqt5pas1
Description: Raspberry Pi Backup Tool
Fast backup and restore tool with ZSTD compression.
EOF
# 👉 conffiles (wichtig!)
cat > "$PKG/DEBIAN/conffiles" <<EOF
/etc/pibackup/pibackup.ini
/etc/pibackup/dhcp-cleanup.exclude
/etc/pibackup/raspberry.exclude
/etc/pibackup/ssh-cleanup.exclude
EOF
#/etc/pibackup/pibackup.ini
# Paket bauen
dpkg-deb --build --root-owner-group "$PKG" "$OUTDIR/pibackup.deb"
# Cleanup
rm -rf "$PKG"
echo "✔ Fertig: $OUTDIR/pibackup.deb"