B3 is distributed as different packages:
- python sources package as a zip file
- python wheel package
- win32 zip package
- win32 installer package (built with InnoSetup Installer)
- linux zip package
- apple OS X .dmg disk image
You need the bumpversion tool for that task. See https://pypi.python.org/pypi/bumpversion/
Usage:
bumpversion patch # will change "1.10.0" to "1.10.1"
bumpversion minor # will change "1.10.0" to "1.11.0"
bumpversion major # will change "1.10.0" to "2.0.0"
To be able to build B3 distribution packages you need to have installed Python 2.7 32bit on your system.
You can check your python version by starting the python interpreter in a terminal window (or command
prompt on win32 platform). Also you need to make sure to have python
in your PATH environment variable.
You also need to have installed GIT on your system and make sure that the git
command
is in your PATH environment. Once the building process is completed you will find the built package(s) inside the
dist directory.
Open a terminal window (or command prompt if on win32 platform) and type the following commands:
- clone big brother bot repository:
git clone https://github.com/BigBrotherBot/big-brother-bot.git
cd big-brother-bot
- build source and wheel packages:
python setup.py release
Install Qt Library (Mingw32 bundle).
Install Microsofts Visual C++ Compiler for Python2.7.
Install InnoSetup.
Install psycopg2.
Install pycripto.
Install paramiko.
Install cx_Freeze.
Make sure to have pip
in your PATH environment.
Open a command prompt window and type the following (tested on Windows 8.1 Pro):
- make sure to have
qmake
andmingw32-make
in your PATH environment variable:PATH=C:\Qt\Qt5.4.1\5.4\mingw491_32\bin;C:\Qt\Qt5.4.1\Tools\mingw491_32\bin;%PATH%
- download python SIP Library.
- uncompress the SIP archive and move to the new created directory using the command prompt.
- type the following in the command prompt window:
python configure.py -p win32-g++
mingw32-make && mingw32-make install
- download python PyQt5 Library.
- uncompress the PyQt5 archive and move to the new created directory using the command prompt.
- type the following in the command prompt window:
python configure.py --spec win32-g++
mingw32-make && mingw32-make install
- clone big brother bot repository:
git clone https://github.com/BigBrotherBot/big-brother-bot.git
cd big-brother-bot
- install python requirements:
pip install -r requirements.txt
pip install -r build-requirements.txt
- update
installer/innosetup/build.yaml
config file with the path to your InnoSetup compiler. - build the frozen application:
python setup.py egg_info
python setup.py build_exe
Open a terminal window and type the following commands as root user (tested on Ubuntu 14.04.2 LTS):
- install python-dev package, psycopg2 and Qt5 library:
apt-get install python-dev
apt-get install python-psycopg2
apt-get install qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev
apt-get install qt5-default qttools5-dev-tools
- download and install python SIP:
cd /root
wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.7/sip-4.16.7.tar.gz
tar xzf sip-4.16.7.tar.gz && cd sip-4.16.7
python configure.py
make -j 5 && make install
- download and install python PyQt5:
cd /root
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.4.1/PyQt-gpl-5.4.1.tar.gz
tar xzf PyQt-gpl-5.4.1.tar.gz && cd PyQt-gpl-5.4.1
python configure.py --confirm-license
make -j 5 && make install
- clone big brother bot repository:
cd /root
git clone https://github.com/BigBrotherBot/big-brother-bot.git
cd /root/big-brother-bot
- install python requirements:
pip install paramiko
pip install -r requirements.txt
pip install -r build-requirements.txt
- build the frozen application:
cd /root/big-brother-bot
python setup.py egg_info
python setup.py build_exe
Make sure you have installed Xcode and Xcode command line tools.
Install homebrew.
Install Qt Library.
Make sure you have qmake
in your path: export PATH=$PATH:~/Qt/5.4/clang_64/bin
.
Open a terminal window and type the following commands (tested on OS X Yosemite 10.10.3):
- prepare the system (if you do not wish to install wget you can download packages manually using a web browser):
brew install wget
- download and install python SIP:
cd ~/Downloads
wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.16.7/sip-4.16.7.tar.gz
tar xzf sip-4.16.7.tar.gz && cd sip-4.16.7
python configure.py
make -j 5 && make install
- download and install python PyQt5:
cd ~/Downloads
wget http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.4.1/PyQt-gpl-5.4.1.tar.gz
tar xzf PyQt-gpl-5.4.1.tar.gz && cd PyQt-gpl-5.4.1
python configure.py --confirm-license
make -j 5 && make install
- clone big brother bot repository:
cd ~/Downloads
git clone https://github.com/BigBrotherBot/big-brother-bot.git
cd ~/Downloads/big-brother-bot
- install python requirements:
sudo pip install -r requirements.txt
sudo pip install -r build-requirements.txt
sudo pip install -r optional-requirements.txt
- build the frozen application:
cd ~/Downloads/big-brother-bot
python setup.py egg_info
python setup.py bdist_dmg
If you upgraded your python version to 2.7.10 you may encounter the following error while building the SIP module:
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -shared -Wl,-subsystem,console
-Wl,-s -o sip.pyd siplib.o apiversions.o descriptors.o qtlib.o threads.o objmap.o voidptr.o array.o bool.o -LC:\Python27\libs -l
python27
C:\Python27\libs/libpython27.a(dmmes01026.o):(.idata$7+0x0): undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00712.o):(.idata$7+0x0): undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00245.o):(.idata$7+0x0): undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00253.o):(.idata$7+0x0): undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes01027.o):(.idata$7+0x0): undefined reference to '_head_C__build27_cpython_PCBuild_libpython27_a'
C:\Python27\libs/libpython27.a(dmmes00212.o):(.idata$7+0x0): more undefined references to '_head_C__build27_cpython_PCBuild_libpython27_a' follow
If that is the case it means that you have to rebuild your libpython27.a
interface. To do so, move to C:\Windows\System32
using
a command prompt window with Administrator privileges, and type the following:
gendef.exe python27.dll
dlltool.exe --dllname python27.dll --def python27.def --output-lib libpython27.a
Move the newly generated libpython27.a
file into C:\Python27\libs
.