Removed some test packages, they will be moved to another repository at a later date
This commit is contained in:
parent
555ea75403
commit
84259de9e8
Binary file not shown.
@ -1,154 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage () {
|
||||
echo "------BPM-Setup options------"
|
||||
echo "bpm-setup -D <directory> | Path to package directory"
|
||||
echo "bpm-setup -y | Skips confirmation prompt"
|
||||
echo "bpm-setup -n <name> | Set the package name (Defaults to \"package-name\")"
|
||||
echo "bpm-setup -d <description> | Set the package description (Defaults to \"Default package description\")"
|
||||
echo "bpm-setup -v <version> | Set the package version (Defaults to \"1.0\")"
|
||||
echo "bpm-setup -u <url> | Set the package URL (Optional)"
|
||||
echo "bpm-setup -l <licenses> | Set the package licenses (Optional)"
|
||||
echo "bpm-setup -t <binary/source> | Set the package type to binary or source (Defaults to binary)"
|
||||
echo "bpm-setup -s <source template file> | Use a default template file (Defaults to /etc/bpm-utils/source.default)"
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
usage
|
||||
exit
|
||||
fi
|
||||
|
||||
NAME="package-name"
|
||||
DESCRIPTION="Default package description"
|
||||
VERSION="1.0"
|
||||
#URL="https://my.project.url/ (Optional)"
|
||||
#LICENSE="Your project's license (Optional)"
|
||||
TYPE="binary"
|
||||
SOURCE_FILE="/etc/bpm-utils/source.default"
|
||||
|
||||
while getopts "D:n:d:v:u:l:t:s:y" o; do
|
||||
case "${o}" in
|
||||
D)
|
||||
DIRECTORY="${OPTARG}"
|
||||
;;
|
||||
y)
|
||||
CONFIRM=yes
|
||||
;;
|
||||
n)
|
||||
NAME="${OPTARG}"
|
||||
;;
|
||||
d)
|
||||
DESCRIPTION="${OPTARG}"
|
||||
;;
|
||||
v)
|
||||
VERSION="${OPTARG}"
|
||||
;;
|
||||
u)
|
||||
URL="${OPTARG}"
|
||||
;;
|
||||
l)
|
||||
LICENSE="${OPTARG}"
|
||||
;;
|
||||
t)
|
||||
TYPE="${OPTARG}"
|
||||
;;
|
||||
s)
|
||||
SOURCE_FILE="$(realpath ${OPTARG})"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "${DIRECTORY}" ]; then
|
||||
echo "Required directory argument missing. Try 'bpm-setup -D <directory> [other options...]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! "${DIRECTORY}" == "/"* ]]; then
|
||||
DIRECTORY="${PWD}/${DIRECTORY}"
|
||||
fi
|
||||
|
||||
if [ -e "${DIRECTORY}" ]; then
|
||||
echo "This path already exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$TYPE" != "binary" ]] && [[ "$TYPE" != "source" ]]; then
|
||||
echo "Invalid package type! Package type must be either 'binary' or 'source'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "${CONFIRM}" ]; then
|
||||
echo "Setting up package working directory at ${DIRECTORY} with the following information:"
|
||||
echo "Package name: $NAME"
|
||||
echo "Package description: $DESCRIPTION"
|
||||
echo "Package version: $VERSION"
|
||||
if [ -z "${URL}" ]; then
|
||||
echo "Package URL: Not set"
|
||||
else
|
||||
echo "Package URL: $URL"
|
||||
fi
|
||||
if [ -z "${LICENSE}" ]; then
|
||||
echo "Package license: Not set"
|
||||
else
|
||||
echo "Package license: $LICENSE"
|
||||
fi
|
||||
|
||||
echo "Package type: $TYPE"
|
||||
read -p "Create package directory? [y/N]: " CREATE
|
||||
case $CREATE in
|
||||
[Yy]* )
|
||||
;;
|
||||
*)
|
||||
echo "Exiting bpm-setup..."
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if ! mkdir -pv $DIRECTORY; then
|
||||
echo "Could not create $DIRECTORY!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $DIRECTORY
|
||||
|
||||
touch pkg.info
|
||||
echo "name: ${NAME}" >> pkg.info
|
||||
echo "description: ${DESCRIPTION}" >> pkg.info
|
||||
echo "version: ${VERSION}" >> pkg.info
|
||||
if [ ! -z "${URL}" ]; then echo "url: ${URL}" >> pkg.info; fi
|
||||
if [ ! -z "${LICENSE}" ]; then echo "license: ${LICENSE}" >> pkg.info; fi
|
||||
|
||||
if [[ "$TYPE" == "binary" ]]; then
|
||||
echo "architecture: $(uname -m)" >> pkg.info
|
||||
echo "type: binary" >> pkg.info
|
||||
mkdir -pv files
|
||||
echo "Package directory created successfully!"
|
||||
echo "Make sure to edit the pkg.info file with the appropriate information for your package"
|
||||
echo "Add your binaries under the 'files' directory. For example a binary called 'my_binary' should go under files/usr/bin/my_binary"
|
||||
echo "You can turn your package into a .bpm file use the 'bpm-create <name>' command"
|
||||
else
|
||||
echo "architecture: any" >> pkg.info
|
||||
echo "type: source" >> pkg.info
|
||||
mkdir -pv source-files
|
||||
if [ -f "${SOURCE_FILE}" ]; then
|
||||
touch source.temp
|
||||
cat "${SOURCE_FILE}" > source.temp
|
||||
export NAME DESCRIPTION VERSION URL LICENSE TYPE
|
||||
envsubst '$NAME:$DESCRIPTION:$VERSION:$URL:$LICENSE:$TYPE' < source.temp > source.sh
|
||||
rm source.temp
|
||||
else
|
||||
echo "Source file at ${SOURCE_FILE} does not exist! Creating empty source.sh instead..."
|
||||
touch source.sh
|
||||
fi
|
||||
echo "Package directory created successfully!"
|
||||
echo "Make sure to edit the pkg.info file with the appropriate information for your package"
|
||||
echo "Add your compilation code in the source.sh file. Follow the instructions on the template file on how to properly create your compilation script"
|
||||
echo "You can add additional files that will be used during compilation to the 'source-files' directory"
|
||||
echo "You can turn your package into a .bpm file use the 'bpm-package <filename>' command"
|
||||
fi
|
@ -1,8 +0,0 @@
|
||||
name: bpm-utils
|
||||
description: Utilities to create BPM packages
|
||||
version: 2.0.0
|
||||
url: https://gitlab.com/bubble-package-manager/bpm/
|
||||
license: GPL3
|
||||
architecture: any
|
||||
keep: etc/bpm-utils/source.default
|
||||
type: binary
|
Binary file not shown.
@ -1,8 +0,0 @@
|
||||
name: htop
|
||||
description: An interactive process viewer
|
||||
version: 3.3.0
|
||||
url: https://github.com/htop-dev/htop
|
||||
license: GPL2
|
||||
architecture: x86_64
|
||||
type: source
|
||||
#make_depends: git
|
@ -1,20 +0,0 @@
|
||||
# This file is read and executed by BPM to compile htop. It will run inside a temporary folder in /tmp during execution
|
||||
echo "Compiling htop..."
|
||||
# Creating 'source' directory
|
||||
mkdir source
|
||||
# Cloning the git repository into the 'source' directory
|
||||
git clone https://github.com/htop-dev/htop.git source
|
||||
# Changing directory into 'source'
|
||||
cd source
|
||||
# Configuring and making htop according to the installation instructions in the repository
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
# Creating an 'output' directory in the root of the temporary directory created by BPM
|
||||
mkdir ./../output/
|
||||
# Setting $dir to the 'output' directory
|
||||
dir=$(pwd)/../output/
|
||||
# Installing htop to $dir
|
||||
make DESTDIR="$dir" install
|
||||
# The compilation is done. BPM will now copy the files from the 'output' directory into the root of your system
|
||||
echo "htop compilation complete!"
|
Loading…
x
Reference in New Issue
Block a user