Skip to content

Commit b99c49f

Browse files
committed
better build
1 parent e20ee3c commit b99c49f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build-packages.sh

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
1111
STARTDIR="$(pwd)"
1212
DESTDIR="$STARTDIR/pkg"
1313
OUTDIR="$STARTDIR/deb"
14+
# get version
15+
repo="azlux/log2ram"
16+
api=$(curl --silent "https://api.github.com/repos/$repo/releases/latest")
17+
new=$(echo $api | grep -Po '"tag_name": "\K.*?(?=")')
1418

1519
# Remove potential leftovers from a previous build
1620
rm -rf "$DESTDIR" "$OUTDIR"
@@ -30,4 +34,8 @@ install -Dm 644 "$STARTDIR/log2ram.logrotate" "$DESTDIR/etc/logrotate.d/log2ram"
3034
# Build .deb
3135
mkdir "$DESTDIR/DEBIAN" "$OUTDIR"
3236
cp "$STARTDIR/debian/"* "$DESTDIR/DEBIAN/"
37+
38+
# Set version
39+
sed -i "s/VERSION-TO-REPLACE/$new/" "$DESTDIR/DEBIAN/control"
40+
3341
dpkg-deb --build "$DESTDIR" "$OUTDIR"

debian/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: log2ram
2-
Version: 1.4.2
2+
Version: VERSION-TO-REPLACE
33
Section: net
44
Priority: optional
55
Architecture: all

0 commit comments

Comments
 (0)