mirror of https://github.com/azlux/log2ram.git
better build
This commit is contained in:
parent
e20ee3cfc2
commit
b99c49fb8e
|
@ -11,6 +11,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
STARTDIR="$(pwd)"
|
STARTDIR="$(pwd)"
|
||||||
DESTDIR="$STARTDIR/pkg"
|
DESTDIR="$STARTDIR/pkg"
|
||||||
OUTDIR="$STARTDIR/deb"
|
OUTDIR="$STARTDIR/deb"
|
||||||
|
# get version
|
||||||
|
repo="azlux/log2ram"
|
||||||
|
api=$(curl --silent "https://api.github.com/repos/$repo/releases/latest")
|
||||||
|
new=$(echo $api | grep -Po '"tag_name": "\K.*?(?=")')
|
||||||
|
|
||||||
# Remove potential leftovers from a previous build
|
# Remove potential leftovers from a previous build
|
||||||
rm -rf "$DESTDIR" "$OUTDIR"
|
rm -rf "$DESTDIR" "$OUTDIR"
|
||||||
|
@ -30,4 +34,8 @@ install -Dm 644 "$STARTDIR/log2ram.logrotate" "$DESTDIR/etc/logrotate.d/log2ram"
|
||||||
# Build .deb
|
# Build .deb
|
||||||
mkdir "$DESTDIR/DEBIAN" "$OUTDIR"
|
mkdir "$DESTDIR/DEBIAN" "$OUTDIR"
|
||||||
cp "$STARTDIR/debian/"* "$DESTDIR/DEBIAN/"
|
cp "$STARTDIR/debian/"* "$DESTDIR/DEBIAN/"
|
||||||
|
|
||||||
|
# Set version
|
||||||
|
sed -i "s/VERSION-TO-REPLACE/$new/" "$DESTDIR/DEBIAN/control"
|
||||||
|
|
||||||
dpkg-deb --build "$DESTDIR" "$OUTDIR"
|
dpkg-deb --build "$DESTDIR" "$OUTDIR"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Package: log2ram
|
Package: log2ram
|
||||||
Version: 1.4.2
|
Version: VERSION-TO-REPLACE
|
||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: all
|
Architecture: all
|
||||||
|
|
Loading…
Reference in New Issue