Difference between revisions of "Building Debian packages"
Jump to navigation
Jump to search
Tomas Kirnak (talk | contribs) m |
Tomas Kirnak (talk | contribs) (Fixed error and completed the procedure) |
||
Line 37: | Line 37: | ||
cd ./nxms-packaging; | cd ./nxms-packaging; | ||
if [ -e .git ]; then | if [ -e .git ]; then | ||
git pull | git pull; | ||
else | else | ||
git clone http://git.netxms.org/public/netxms.git --branch develop ./ | git clone http://git.netxms.org/public/netxms.git --branch develop ./; | ||
fi | fi | ||
</pre> | |||
After this modify the debian change-log to ensure you have a different version with every build (so your apt repo and servers installing the packages can differentiate newer versions).<br> | |||
You can do this for example like this: | |||
<pre> | |||
dch -v `date +%Y%m%d%H%M`-1 | |||
</pre> | |||
After changelog is modified, run: | |||
<pre style="white-space: pre-wrap; | |||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word;"> | |||
./reconf; | ./reconf; | ||
./configure --with-dist; | ./configure --with-dist; | ||
make dist; | make dist; | ||
make distclean; | make distclean; | ||
git checkout debian/changelog; | |||
mkdir deb_packages && true; | mkdir deb_packages && true; | ||
mv netxms-*.tar.gz ./deb_packages | mv netxms-*.tar.gz ./deb_packages; | ||
cd ./deb_packages | cd ./deb_packages; | ||
rename s/netxms-/netxms_/ netxms-*.tar.gz | rename s/netxms-/netxms_/ netxms-*.tar.gz; | ||
rename s/.tar.gz/.orig.tar.gz/ netxms_*.tar.gz | rename s/.tar.gz/.orig.tar.gz/ netxms_*.tar.gz; | ||
tar xfz netxms_*.orig.tar.gz; | tar xfz netxms_*.orig.tar.gz; | ||
cd netxms-*; | cd netxms-*; | ||
dpkg-buildpackage -us -uc; | |||
</pre> | </pre> | ||
Here you will get an error about the upstream tarball missing like this: | |||
<pre> | |||
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../netxms_201507231213.orig.tar.{bz2,gz,lzma,xz} | |||
</pre> | |||
Fix the tarball name (you have a netxms_*.orig.tar.gz one directory above) and you can continue. | |||
<pre style="white-space: pre-wrap; | <pre style="white-space: pre-wrap; | ||
white-space: -moz-pre-wrap; | white-space: -moz-pre-wrap; |
Revision as of 12:26, 23 July 2015
Required packages and libraries
Install required packages and libraries:
apt-get install debootstrap devscripts git debhelper dh-autoreconf debconf libssl-dev zlib1g-dev libexpat1-dev libsensors4-dev libjansson-dev libreadline-dev libsqlite3-dev libmysqlclient-dev libcurl4-openssl-dev libpq-dev libldap2-dev libaio1 unixodbc-dev openjdk-7-jdk maven
Next you need the Oracle Instant Client from:
32bit: http://www.oracle.com/technetwork/topics/linuxsoft-082809.html
64bit: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Agree to the license and get the download link after signing in.
After download, run:
sudo unzip -x -d /opt instantclient-basiclite-linux*-11.2.0.4.0.zip sudo unzip -x -d /opt instantclient-sdk-linux*-11.2.0.4.0.zip sudo ln -s libclntsh.so.11.1 /opt/instantclient_11_2/libclntsh.so
Building packages
mkdir ./nxms-packaging && true; mkdir ./nxms-packages && true; cd ./nxms-packaging; if [ -e .git ]; then git pull; else git clone http://git.netxms.org/public/netxms.git --branch develop ./; fi
After this modify the debian change-log to ensure you have a different version with every build (so your apt repo and servers installing the packages can differentiate newer versions).
You can do this for example like this:
dch -v `date +%Y%m%d%H%M`-1
After changelog is modified, run:
./reconf; ./configure --with-dist; make dist; make distclean; git checkout debian/changelog; mkdir deb_packages && true; mv netxms-*.tar.gz ./deb_packages; cd ./deb_packages; rename s/netxms-/netxms_/ netxms-*.tar.gz; rename s/.tar.gz/.orig.tar.gz/ netxms_*.tar.gz; tar xfz netxms_*.orig.tar.gz; cd netxms-*; dpkg-buildpackage -us -uc;
Here you will get an error about the upstream tarball missing like this:
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../netxms_201507231213.orig.tar.{bz2,gz,lzma,xz}
Fix the tarball name (you have a netxms_*.orig.tar.gz one directory above) and you can continue.
dpkg-buildpackage -us -uc; cd ..; mv *.deb ../../nxms-packages; rm -r netxms_*; rm -r netxms-*; cd ../../nxms-packages; ls -l;