minecraft-pi-docker/scripts/package.sh

38 lines
731 B
Bash
Raw Normal View History

2020-09-27 00:48:46 +00:00
#!/bin/sh
set -e
2020-12-04 21:27:28 +00:00
# Prepare
2021-06-17 21:32:24 +00:00
VERSION="$(cat VERSION)"
# Common
package() {
local dir="out/$1"
# Create DEBIAN Dir
rm -rf "${dir}/DEBIAN"
mkdir -p "${dir}/DEBIAN"
cp "debian/$1" "${dir}/DEBIAN/control"
# Format DEBIAN/control
sed -i "s/\${VERSION}/${VERSION}~$(lsb_release -cs)/g" "${dir}/DEBIAN/control"
2021-06-17 22:56:02 +00:00
# Fix Permissions
chmod -R g-s "${dir}"
2021-06-17 21:32:24 +00:00
# Package
dpkg-deb --root-owner-group --build "${dir}" out
2020-12-04 21:27:28 +00:00
}
2020-10-03 20:18:53 +00:00
2021-06-17 21:32:24 +00:00
# Find And Package
for dir in out/*; do
# Check If Directory
if [ -d "${dir}" ]; then
# Check If Debian Package Exists
pkg="$(basename ${dir})"
if [ -f "debian/${pkg}" ]; then
package "${pkg}"
fi
fi
done