aboutsummaryrefslogtreecommitdiff
path: root/meson/packaging/make-deb.sh
blob: 3d2a292748e16e4fd884c5e136fe10fbf0a574d8 (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
#!/bin/sh -e
cd "$MESON_BUILD_ROOT"
. "$MESON_SUBDIR/meta"
wd="`pwd`/`mktemp -d deb.XXXXXX`"
trap "rm -rf '$wd'" INT QUIT TERM EXIT

[ "$arch" = x86    ] && arch=i386
[ "$arch" = x86_64 ] && arch=amd64
target="$name-$version-$system-$arch.deb"

echo 2.0 > "$wd/debian-binary"
cat > "$wd/control" <<-EOF
	Package: $name
	Version: $version
	Section: misc
	Priority: optional
	Architecture: $arch
	Maintainer: $author
	Description: $summary
EOF
fakeroot sh -e <<-EOF
	DESTDIR="$wd/pkg" ninja install
	cd "$wd/pkg" && tar cJf ../data.tar.xz .
EOF

(cd "$wd" && tar czf control.tar.gz ./control)
ar rc "$target" "$wd/debian-binary" "$wd/control.tar.gz" "$wd/data.tar.xz"
echo Written $target