blob: 31f7146f9230b77f8b23a58e21e69a902589f6ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/bash
#
# Created using the tutorial
# https://john-tucker.medium.com/debian-packaging-by-example-118c18f5dbfe And
# this confusing one -> https://wiki.debian.org/Packaging/Intro
#
# Define expected version when running.
#
# VERSION=0.0.4 ./make-package.sh
#
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=mirror
PROJECT_PATH="$(realpath ./../..)"
VERSION="${VERSION:-#VERSION#}"
TMP="${TMP:-/tmp/debian}"
PKG="$TMP/package-$PRGNAM"
OUTPUT="${OUTPUT:-/tmp}"
set -e
#
# Prepare what the debian build tools run on from these files.
#
rm -fr "$PKG"
mkdir -p "$TMP" "$PKG" "$OUTPUT"
cd "$TMP"
rm -fr "$PRGNAM-$VERSION"
cp -R "$PROJECT_PATH" "$PRGNAM-$VERSION"
cd "$PRGNAM-$VERSION"
cp -r . "$PKG"
#cp contrib/debian/Makefile "$PKG"
tar -C .. -f "$PKG/${PRGNAM}_${VERSION}.orig.tar.gz" -c "${PRGNAM}-${VERSION}"
cp -r contrib/debian/debian "$PKG"
sed -i "s/#VERSION#/${VERSION}/g" "$PKG/debian/changelog"
#
# Make the deliverable using Debian's tools.
#
cd "$PKG"
debuild -b -uc -us
mv ../mirror_*.deb "$OUTPUT"
|