-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debian package script generator for AMD64, RISCV64, and ARM (HF) arch…
…itecture.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |