ansible/packaging/debian
Gonéri Le Bouder 519e4f4223 debian: install lib in dist-packages (#64412)
On Ubuntu Precise and Trusty, the build was failing because the Ansible
libs were installed in /usr/lib/python2.7/site-packages.

According to the Debian Policy (2.5), they should actually be install in
/usr/lib/python2.7/dist-packages This is also CDBS default behaviour since
0.4.131.

See: https://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html

Closes: #64160
2019-11-05 10:45:05 -05:00
..
ansible-test.install debian: prepare the ansible-test package 2019-09-03 22:00:24 -07:00
ansible.dirs debian: install lib in dist-packages (#64412) 2019-11-05 10:45:05 -05:00
ansible.install debian: prepare the ansible-test package 2019-09-03 22:00:24 -07:00
changelog 2.6 changelog gen/version/root dir cleanup (#40421) 2018-05-21 16:14:53 -07:00
compat Move debian under packaging subdirectory 2012-04-18 22:50:09 -04:00
control debian: prepare the ansible-test package 2019-09-03 22:00:24 -07:00
copyright Move debian under packaging subdirectory 2012-04-18 22:50:09 -04:00
Dockerfile Move man pages generations to rst2man (#37861) 2018-03-26 16:28:28 -07:00
docs README.md was renamed. Fix deb build reference to the README 2018-04-11 11:22:50 -07:00
pycompat Move debian under packaging subdirectory 2012-04-18 22:50:09 -04:00
README.md Move man pages generations to rst2man (#37861) 2018-03-26 16:28:28 -07:00
rules debian: install lib in dist-packages (#64412) 2019-11-05 10:45:05 -05:00

Ansible Debian Package

To create an Ansible DEB package:

Note: You must run this target as root or set PBUILDER_BIN='sudo pbuilder'

apt-get install python-docutils cdbs debootstrap devscripts make pbuilder python-setuptools
git clone https://github.com/ansible/ansible.git
cd ansible
DEB_DIST='xenial trusty precise' make deb

Building in Docker:

git clone https://github.com/ansible/ansible.git
cd ansible
docker build -t ansible-deb-builder -f packaging/debian/Dockerfile .
docker run --privileged -e DEB_DIST='trusty' -v $(pwd):/ansible ansible-deb-builder

The debian package file will be placed in the deb-build directory. This can then be added to an APT repository or installed with dpkg -i <package-file>.

Note that dpkg -i does not resolve dependencies.

To install the Ansible DEB package and resolve dependencies:

dpkg -i <package-file>
apt-get -fy install

Or, if you are running Debian Stretch (or later) or Ubuntu Xenial (or later):

apt install /path/to/<package-file>