Skip to content

HowToBuild

Thor Watanabe edited this page Feb 14, 2018 · 15 revisions

How to Build Your Own WebIOPi+ debian Package

If you've already installed the previous YA-WebIOPi+ or the official WebIOPi, create an old archive file including original files into the ~/webiopi.old.tbz, and remove old files completely from python distribution package directories.

 sudo dpkg --purge python2-webiopi
 sudo dpkg --purge python3-webiopi
 find /usr | grep -i webiopi  | sort > ~/webiopi.old.files
 tar cjvf ~/webiopi.old.tbz --files-from ~/webiopi.old.files 
 cat ~/webiopi.old.files | sort -r | sed -e 's/^/sudo rm -f /;' |  sh 2>/dev/null
 cat ~/webiopi.old.files | sort -r | sed -e 's/^/sudo rmdir /;' | sh 2>/dev/null

First of all, clone the repository:

 sudo apt-get install git # if you don't have git yet.
 git clone https://github.com/thortex/rpi3-webiopi.git
 cd rpi3-webiopi

Second, install debian package management development files:

 cd dev
 ./01_setup-required-packages.sh 

Third, install python setup tools and development files:

 ./03_install_python_dev.sh

Forth, execute the following shell script to build package:

 ./10_make_deb.sh

Finally, you can install WebIOPi+ debian package by typing the following command:

 sudo dpkg -i ~/build.webiopi/python2-webiopi*.deb
 sudo dpkg -i ~/build.webiopi/python3-webiopi*.deb
 sudo webiopi-select-python 2

 sudo systemctl daemon-reload
 sudo systemctl restart webiopi

Note that remove official WebIOPi python codes/modules/eggs from your system before installing Yet Another WebIOPi+ debian package. You can install either the official WebIOPi or YA-WebIOPi+.

If you want install WebIOPi+ for python3, select python3 for webiopi daemon/command:

 webiopi-select-python 3
 sudo systemctl daemon-reload
 sudo systemctl restart webiopi

If you don't have systemd, init.d command is available to start/stop/restart WebIOPi daemon:

 sudo /etc/init.d/webiopi restart

Note that python3-webiopi package only includes a native c library and python module scripts without htdocs, init, systemd, and etc. Even if you only use python3, you have to install python2-webiopi package to work proper.

Uninstallation

 sudo dpkg --purge python2-webiopi

and/or

 sudo dpkg --purge python3-webiopi

Clone this wiki locally