mirror of
https://github.com/eosswedenorg/eth-healthcheck
synced 2026-06-18 05:20:02 +02:00
Inital Commit
This commit is contained in:
commit
0d27205c7c
15 changed files with 472 additions and 0 deletions
36
scripts/pkg.sh
Executable file
36
scripts/pkg.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
############################
|
||||
# Exported variables. #
|
||||
############################
|
||||
|
||||
export BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "$0 <pkg_type> <build_dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PKG_TYPE=$1
|
||||
BUILD_DIR=$2
|
||||
|
||||
PKG_SCRIPT="${BASE_DIR}/pkg_${PKG_TYPE}.sh"
|
||||
|
||||
# Check and call script
|
||||
if [ ! -x $PKG_SCRIPT ]; then
|
||||
echo "$PKG_SCRIPT not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Info
|
||||
set -o allexport
|
||||
source ${BUILD_DIR}/pkg_info
|
||||
set +o allexport
|
||||
|
||||
# Directories.
|
||||
export PACKAGE_BINDIR=${PACKAGE_PREFIX}/bin
|
||||
export PACKAGE_SHAREDIR=${PACKAGE_PREFIX}/share/${PACKAGE_NAME}
|
||||
export PACKAGE_TMPDIR="${BUILD_DIR}/pkg_${PKG_TYPE}"
|
||||
export BUILD_DIR
|
||||
|
||||
$PKG_SCRIPT
|
||||
46
scripts/pkg_deb.sh
Executable file
46
scripts/pkg_deb.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PACKAGE_ARCH=amd64
|
||||
|
||||
if [[ -f /etc/upstream-release/lsb-release ]]; then
|
||||
source /etc/upstream-release/lsb-release
|
||||
elif [[ -f /etc/lsb-release ]]; then
|
||||
source /etc/lsb-release
|
||||
else
|
||||
echo "ERROR: could not determine debian release."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DISTRIB_ID=$(echo $DISTRIB_ID | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Default to 1 if no release is set.
|
||||
if [[ -z $RELEASE ]]; then
|
||||
RELEASE="1"
|
||||
fi
|
||||
|
||||
PACKAGE_FULLNAME="${PACKAGE_NAME}_${PACKAGE_VERSION}-${RELEASE}-${DISTRIB_ID}-${DISTRIB_RELEASE}_${PACKAGE_ARCH}"
|
||||
|
||||
rm -fr ${PACKAGE_TMPDIR}
|
||||
|
||||
# Create debian files.
|
||||
mkdir -p ${PACKAGE_TMPDIR}/DEBIAN
|
||||
echo "Package: ${PACKAGE_NAME}
|
||||
Version: ${PACKAGE_VERSION}-${RELEASE}
|
||||
Section: introspection
|
||||
Priority: optional
|
||||
Architecture: ${PACKAGE_ARCH}
|
||||
Homepage: https://github.com/eosswedenorg/eth-healthcheck
|
||||
Maintainer: Henrik Hautakoski <henrik@eossweden.org>
|
||||
Description: ${PACKAGE_DESCRIPTION}" &> ${PACKAGE_TMPDIR}/DEBIAN/control
|
||||
|
||||
cat ${PACKAGE_TMPDIR}/DEBIAN/control
|
||||
|
||||
# Copy program
|
||||
mkdir -p ${PACKAGE_TMPDIR}/${PACKAGE_BINDIR}
|
||||
cp ${BUILD_DIR}/${PACKAGE_PROGRAM} ${PACKAGE_TMPDIR}/${PACKAGE_BINDIR}/${PACKAGE_NAME}
|
||||
|
||||
# Copy files.
|
||||
mkdir -p ${PACKAGE_TMPDIR}/${PACKAGE_SHAREDIR}
|
||||
cp ${BASE_DIR}/../LICENSE ${PACKAGE_TMPDIR}/${PACKAGE_SHAREDIR}
|
||||
|
||||
fakeroot dpkg-deb --build ${PACKAGE_TMPDIR} ${BUILD_DIR}/${PACKAGE_FULLNAME}.deb
|
||||
Loading…
Add table
Add a link
Reference in a new issue