-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·31 lines (26 loc) · 963 Bytes
/
package.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
#!/bin/bash
PROJECT_NAME="qrepo"
VERSION="1.0.0"
ARCHITECTURES=("amd64" "riscv64" "armhf")
BUILD_DIR="dist"
INSTALL_DIR="/usr/bin"
PACKAGE_DIR="package"
mkdir -p $BUILD_DIR
for ARCH in "${ARCHITECTURES[@]}"; do
rm -rf $PACKAGE_DIR
mkdir -p $PACKAGE_DIR/DEBIAN
mkdir -p $PACKAGE_DIR/$INSTALL_DIR
GOARCH=$ARCH go build -ldflags "-s -w" -o $PACKAGE_DIR/$INSTALL_DIR/$PROJECT_NAME github.com/nthnn/Qrepo
cat <<EOF >$PACKAGE_DIR/DEBIAN/control
Package: $PROJECT_NAME
Version: $VERSION
Section: base
Priority: optional
Architecture: $ARCH
Maintainer: Nathanne Isip <[email protected]>
Description: Simple and easy-to-use all-for-one build tool for AIX, Android, Darwin, Dragonfly, FreeBSD, illumos, iOS, Linux, NetBSD, OpenBSD, Plan9, Solaris, and Windows.
EOF
dpkg-deb --build $PACKAGE_DIR $BUILD_DIR/${PROJECT_NAME}_${VERSION}_${ARCH}.deb
done
rm -rf $PACKAGE_DIR
echo "Debian packages have been created in the $BUILD_DIR directory."