Created
January 22, 2024 13:17
-
-
Save dastanaron/e4103d49fef61eb67ef3712299ce75c1 to your computer and use it in GitHub Desktop.
Script for building debian package
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
#!/usr/bin/env bash | |
PROJECT_NAME="any_name" | |
PROJECT_VERSION="1.0" | |
PROJECT_BUILD_VERSION="1" | |
PACKAGE_NAME="anyName" | |
ARCHITECTURE="amd64" | |
INSTALL_PATH="/usr/local/bin" | |
MAINTAINER="dastanaron dastanaron@daserver.ru" | |
DESCRIPTION="any text" | |
BINARY_FILE_PATH=$1 | |
PROJECT_PATH=${PROJECT_NAME}_${PROJECT_VERSION}-${PROJECT_BUILD_VERSION}_${ARCHITECTURE} | |
mkdir -p ${PROJECT_PATH}${INSTALL_PATH} | |
cp ${BINARY_FILE_PATH} ${PROJECT_PATH}${INSTALL_PATH} | |
mkdir ${PROJECT_PATH}/DEBIAN | |
touch ${PROJECT_PATH}/DEBIAN/control | |
echo "Package: $PACKAGE_NAME" >> ${PROJECT_PATH}/DEBIAN/control | |
echo "Version: $PROJECT_VERSION" >> ${PROJECT_PATH}/DEBIAN/control | |
echo "Architecture: $ARCHITECTURE" >> ${PROJECT_PATH}/DEBIAN/control | |
echo "Maintainer: $MAINTAINER" >> ${PROJECT_PATH}/DEBIAN/control | |
echo "Description: $DESCRIPTION" >> ${PROJECT_PATH}/DEBIAN/control | |
dpkg-deb --build --root-owner-group ${PROJECT_PATH} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment