Skip to content

Commit

Permalink
Use dpkg-shlibdeps to generate dependency list for deb pkg (#12)
Browse files Browse the repository at this point in the history
### WHY are these changes introduced?

The old way of doing it would mistakingly add `libc6-dev` as a dependency to sparoid under Ubuntu Noble (24.04) and Debian Bookworm (12).

This is the 'same' change as in cloudamqp/websocket-tcp-relay#21

### WHAT is this pull request doing?

Using `dpkg-shlibdeps` to generate dependency list for the Debian package.

### HOW can this pull request be tested?

Built Ubuntu 18.04/24.04 and Debian 10/12 locally and inspected the generated `Depends:` line (added after `build/deb` step: `RUN dpkg -I $(find . -name *.deb)`).

Also manually installed the 24.04 package on a 24.04 machine, and 22.04 respectively seems to work fine.
  • Loading branch information
walro authored Sep 23, 2024
1 parent 4d8da21 commit 4ca2d94
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build/deb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ shards build --production --release --no-debug sparoid-server
shards build --production --release --no-debug -Dgc_none sparoid
strip bin/*

# dpkg-shlibdeps requires presence of `debian/control`
apt-get update && apt-get install dpkg-dev --yes
mkdir debian
touch debian/control
shlib_depends=$(dpkg-shlibdeps -O -e bin/* 2> /dev/null);
depends=${shlib_depends#shlibs:Depends=}
rm -r debian

mkdir debroot
cd debroot
Expand Down Expand Up @@ -107,7 +114,7 @@ Homepage: https://github.com/84codes/sparoid
Section: net
Priority: optional
Architecture: $architecture
Depends: $(ldd ../bin/* | awk '/=>/ {print $1}' | xargs dpkg -S | awk -F: "/$architecture/ { print \$1 }" | sort -u | paste -sd,)
Depends: $depends
Installed-Size: $(du -ks usr/ | cut -f 1)
Maintainer: 84codes <[email protected]>
Description: Single Packet Authorization
Expand Down

0 comments on commit 4ca2d94

Please sign in to comment.