forked from evrenonur/server-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·34 lines (26 loc) · 915 Bytes
/
build.sh
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
#!/bin/bash
set -e
# Geçici dizin oluştur
TEMP_DIR=$(mktemp -d)
PKG_NAME="server-monitor"
PKG_VERSION="0.1.0"
BUILD_DIR="$TEMP_DIR/$PKG_NAME-$PKG_VERSION"
# Ana dizin yapısını oluştur
mkdir -p "$BUILD_DIR"
cp -r DEBIAN "$BUILD_DIR/"
cp -r etc "$BUILD_DIR/"
cp -r usr "$BUILD_DIR/"
# Python paket dizinini oluştur
mkdir -p "$BUILD_DIR/usr/lib/python3/dist-packages/server_monitor"
touch "$BUILD_DIR/usr/lib/python3/dist-packages/server_monitor/__init__.py"
# Monitor modülünü kopyala
cp usr/lib/python3/dist-packages/server_monitor/monitor.py "$BUILD_DIR/usr/lib/python3/dist-packages/server_monitor/"
# İzinleri ayarla
chmod -R 755 "$BUILD_DIR/DEBIAN"
chmod -R 755 "$BUILD_DIR/usr"
chmod -R 755 "$BUILD_DIR/etc"
# Debian paketini oluştur
dpkg-deb --build "$BUILD_DIR" "$PKG_NAME-$PKG_VERSION.deb"
# Geçici dizini temizle
rm -rf "$TEMP_DIR"
echo "Paket oluşturuldu: $PKG_NAME-$PKG_VERSION.deb"