Skip to content

Commit

Permalink
Debian package script generator for AMD64, RISCV64, and ARM (HF) arch…
Browse files Browse the repository at this point in the history
…itecture.
  • Loading branch information
nthnn committed Aug 8, 2024
1 parent 177d754 commit 97a2fc6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,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."

0 comments on commit 97a2fc6

Please sign in to comment.