-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·29 lines (24 loc) · 1015 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·29 lines (24 loc) · 1015 Bytes
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
29
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
VERSION="$(python3 -c "import sys; sys.path.insert(0, '.'); from macabout import __version__; print(__version__)")"
PKG="macabout_${VERSION}_all"
BUILD="build/${PKG}"
rm -rf build
mkdir -p "${BUILD}/DEBIAN"
mkdir -p "${BUILD}/usr/bin"
mkdir -p "${BUILD}/usr/share/applications"
mkdir -p "${BUILD}/usr/lib/python3/dist-packages"
cp debian/DEBIAN/control "${BUILD}/DEBIAN/control"
cp debian/usr/bin/macabout "${BUILD}/usr/bin/macabout"
chmod 755 "${BUILD}/usr/bin/macabout"
cp debian/usr/share/applications/macabout.desktop "${BUILD}/usr/share/applications/macabout.desktop"
cp -r macabout "${BUILD}/usr/lib/python3/dist-packages/"
mkdir -p "${BUILD}/etc/sudoers.d"
cp debian/etc/sudoers.d/macabout "${BUILD}/etc/sudoers.d/macabout"
cp debian/DEBIAN/postinst "${BUILD}/DEBIAN/postinst"
chmod 755 "${BUILD}/DEBIAN/postinst"
dpkg-deb --build --root-owner-group "${BUILD}"
echo ""
echo "Built: build/${PKG}.deb"
echo "Install: sudo apt install ./build/${PKG}.deb"