38 lines
730 B
Bash
Raw Normal View History

2020-09-26 20:48:46 -04:00
#!/bin/sh
set -e
2020-12-04 16:27:28 -05:00
# Prepare
2021-06-17 17:32:24 -04: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
2021-09-11 23:18:12 -04:00
sed -i "s/\${VERSION}/${VERSION}/g" "${dir}/DEBIAN/control"
2021-06-17 17:32:24 -04:00
2021-06-18 08:48:55 -04:00
# Fix Permissions On Jenkins
2021-06-17 18:56:02 -04:00
chmod -R g-s "${dir}"
2021-06-17 17:32:24 -04:00
# Package
dpkg-deb --root-owner-group --build "${dir}" out
2020-12-04 16:27:28 -05:00
}
2020-10-03 16:18:53 -04:00
2021-06-17 17:32:24 -04:00
# Find And Package
for dir in out/*; do
2021-09-16 22:00:40 -04:00
# Check If Directory Exists
2021-06-17 17:32:24 -04:00
if [ -d "${dir}" ]; then
# Check If Debian Package Exists
pkg="$(basename ${dir})"
if [ -f "debian/${pkg}" ]; then
package "${pkg}"
fi
fi
done