-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathbuild_deb.sh
More file actions
executable file
·40 lines (31 loc) · 830 Bytes
/
build_deb.sh
File metadata and controls
executable file
·40 lines (31 loc) · 830 Bytes
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
#!/bin/bash
set -e
APPNAME="open-codex"
VERSION="0.1.17"
DEBBUILD_DIR="debbuild"
PKGROOT="$DEBBUILD_DIR/${APPNAME}_${VERSION}"
echo "Building .deb package for $APPNAME $VERSION"
# Prepare directories
rm -rf "$PKGROOT"
mkdir -p "$PKGROOT/DEBIAN"
mkdir -p "$PKGROOT/opt/$APPNAME"
mkdir -p "$PKGROOT/usr/bin"
cp -r dist/open-codex/* "$PKGROOT/opt/$APPNAME/"
cat <<CONTROL > "$PKGROOT/DEBIAN/control"
Package: $APPNAME
Version: $VERSION
Section: utils
Priority: optional
Architecture: amd64
Maintainer: Mo <coding.moh@gmail.com>
Description: LLM-Based CLI tool to generate shell commands from natural language
CONTROL
# start
cat <<WRAP > "$PKGROOT/usr/bin/$APPNAME"
#!/bin/bash
exec /opt/$APPNAME/open-codex "\$@"
WRAP
chmod +x "$PKGROOT/usr/bin/$APPNAME"
# Paket bauen
dpkg-deb --build "$PKGROOT"
echo "Done: $PKGROOT.deb"