Building Bareos RPMs on Ubuntu 16.04
Following on from my previous post on how to build Bareos (Backup Archiving Recovery Open Sourced) RPM packages on CentOS 6 & 7 (https://www.spheron1.uk/2018/03/14/building-bareos-rpms-on-centos-6-7/), the following instructions will show you how to build .deb versions of the packages on Ubuntu 16.04.
Again, these instructions are based on Bareos version 17.2.5, so would need to be adjusted appropriately for other versions and I’m working exclusively with 64-bit (amd64) versions.
Before we start, lets make sure that everything is up to date:
apt-get update
apt-get upgrade
Before we start building anything, we’ll need to install all of the dependencies which are required in order to build the .deb packages. We’ll use the libfastlz and libfastlz-dev packages from the Bareos repositories:
apt-get install build-essential acl-dev autotools-dev bc chrpath debhelper libacl1-dev libcap-dev libjansson-dev liblzo2-dev libqt4-dev libreadline-dev libssl-dev libwrap0-dev libx11-dev libsqlite3-dev libmysqlclient-dev libpq-dev mtx ncurses-dev pkg-config po-debconf python-dev zlib1g-dev glusterfs-common librados-dev libcephfs-dev apache2-dev apache2 autoconf automake python-all python-setuptools
wget http://download.bareos.org/bareos/release/17.2/xUbuntu_16.04/amd64/libfastlz_0.1-7.2_amd64.deb
wget http://download.bareos.org/bareos/release/17.2/xUbuntu_16.04/amd64/libfastlz-dev_0.1-7.2_amd64.deb
dpkg -i libfastlz_0.1-7.2_amd64.deb libfastlz-dev_0.1-7.2_amd64.deb
Now let’s download the Bareos source code the various repositories on GitHub and extract it ready for building:
wget https://github.com/bareos/bareos/archive/Release/17.2.5.tar.gz -qO – | tar zx
wget https://github.com/bareos/bareos-webui/archive/Release/17.2.5.tar.gz -qO – | tar zx
wget https://github.com/bareos/python-bareos/archive/Release/17.2.5.tar.gz -qO – | tar zx
Before starting the build, we need to create a changelog file which contains information used by the build process. Use your favourite text editor to put the below into ~/bareos-Release-17.2.5/debian/changelog:
bareos (17.2.5-0) stable; urgency=low
* Bareos 17.2.5 release; https://www.bareos.org/en/news/bareos-17-2-5-maintenance-version-released.html
— Your Name <your@email.address> Thu, 16 Mar 2018 10:58:00 +0000
Once that’s done, you can start the build process:
cd ~/bareos-Release-17.2.5/
fakeroot debian/rules binary
Now we just need to repeat this process for the bareos-webui package. Use your favourite text editor to create the ~/bareos-webui-Release-17.2.5/debian/changelog file containing the below:
bareos-webui (17.2.5-0) stable; urgency=low
* Bareos 17.2.5 release; https://www.bareos.org/en/news/bareos-17-2-5-maintenance-version-released.html
— Your Name <your@email.address> Thu, 16 Mar 2018 10:58:00 +0000
Unlike the main bareos repository, the debian/rules file isn’t executable by default in the code from bareos-webui repository, so we need to set that before we can start the build process:
cd ~/bareos-webui-Release-17.2.5/
chmod +x debian/rules
fakeroot debian/rules binary
Finally we need to build the python-bareos package. Use your favourite text editor to create the ~/python-bareos-Release-17.2.5/debian/changelog file containing the below:
python-bareos (17.2.5-0) stable; urgency=low
* Bareos 17.2.5 release; https://www.bareos.org/en/news/bareos-17-2-5-maintenance-version-released.html
— Your Name <your@email.address> Thu, 16 Mar 2018 10:58:00 +0000
Then it’s just the usual commands to start the build process:
cd ~/python-bareos-Release-17.2.5/
fakeroot debian/rules binary
You should now have all of the .deb package files in your home directory which you can install locally or host in your own APT repository.