-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_deb
executable file
·37 lines (32 loc) · 1.34 KB
/
make_deb
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
30
31
32
33
34
35
36
37
# This README file gives a very rough idea of how to build Debian
# packages for this module
# There may be dependencies I've forgotten to mention!
# Version numbers may change as well!
VERSION=0.7.1
DISTRO=`lsb_release -sc`
#DEBFULLNAME="Ben Croston"
#DEBEMAIL="ben@croston.org"
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
set -e
# install debian package build dependencies
# sudo apt-get install devscripts build-essential fakeroot dh-make python-dev python3-dev python-setuptools python3-setuptools
# or for Buster try:
# sudo apt install debhelper dh-python python-all python-all-dev python3-all python3-all-dev python3-setuptools
python setup.py sdist
rm -rf ~/build_rpi.gpio
mkdir ~/build_rpi.gpio
cp dist/RPi.GPIO-$VERSION.tar.gz ~/build_rpi.gpio/rpi.gpio_$VERSION~$DISTRO.orig.tar.gz
cd ~/build_rpi.gpio
tar xvfz rpi.gpio_$VERSION~$DISTRO.orig.tar.gz
cp -a $SCRIPTPATH/debian_$DISTRO ~/build_rpi.gpio/RPi.GPIO-$VERSION/debian
# build .deb files
cd ~/build_rpi.gpio/RPi.GPIO-$VERSION
dpkg-buildpackage -us -uc
#debuild clean
cp ~/build_rpi.gpio/python*deb $SCRIPTPATH/dist
cp ~/build_rpi.gpio/rpi.gpio_$VERSION~$DISTRO.orig.tar.gz $SCRIPTPATH/dist
cp ~/build_rpi.gpio/rpi.gpio_$VERSION~$DISTRO*.dsc $SCRIPTPATH/dist
cp ~/build_rpi.gpio/rpi.gpio_$VERSION~$DISTRO*.debian.tar.* $SCRIPTPATH/dist
rm -rf ~/build_rpi.gpio
rm $SCRIPTPATH/MANIFEST