Skip to content

Commit

Permalink
Use cmake utils instead of make
Browse files Browse the repository at this point in the history
  • Loading branch information
marek22k committed Jan 17, 2024
1 parent 25c6f01 commit a604f9e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions deb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ die () {
)

(
mkdir ../build
cd ../build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr .. || die "Failed to configure project"
make -j "$(nproc)" || die "Failed to build project"
make DESTDIR="../deb/package/" install || die "Failed to install project into package directory"
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -B build -S ".." || die "Failed to configure project"
cmake --build build || die "Failed to build project"
DESTDIR="../deb/package/" cmake --install build
)

mkdir -p package/DEBIAN/
VERSION="$(git describe --long | sed 's/^libtuntap-//')"
[ "$VERSION" ] || die "Failed to get version string"
ARCH="$(dpkg --print-architecture)"
[ "$ARCH" ] || die "Failed to get architecture string"

cp control.template package/DEBIAN/control
sed "s/%VERSION%/$VERSION/" -i package/DEBIAN/control
sed "s/%ARCHITECTURE%/$(dpkg --print-architecture)/" -i package/DEBIAN/control
sed "s/%ARCHITECTURE%/$ARCH/" -i package/DEBIAN/control

mkdir -p package/usr/share/doc/libtuntap-dev/
cp copyright package/usr/share/doc/libtuntap-dev/copyright
Expand Down

0 comments on commit a604f9e

Please sign in to comment.