Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building Python 3 debs #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

msabramo
Copy link

@msabramo msabramo commented Oct 31, 2016

and add options for customizability

$ make-deb --help
Usage: make-deb [OPTIONS]

Options:
  --python /path/to/python        Path to Python executable to use (e.g.:
                                  /usr/bin/python or /usr/bin/python3
  --python-version [2.x|3.4|3.5]  Python version
  --test / --no-test              Whether to run python setup.py test
  --postinst-commands TEXT        Commands to put in postinst script
  --help                          Show this message and exit.
$ rm -rf debian
$ make-deb && cat debian/rules
'debian' directory successfully placed at the root of your repository

%:
	dh $@ --with python-virtualenv
$ rm -rf debian
$ make-deb --no-test --python=/usr/bin/python3 --python-version=3.5 \
>     --postinst-commands='mkdir -p /var/log/sm'
'debian' directory successfully placed at the root of your repository

$ grep Pre-Depends debian/control
Pre-Depends: dpkg (>= 1.16.1), python3.5, ${misc:Pre-Depends}

$ cat debian/rules
#!/usr/bin/make -f

%:
	dh $@ --with python-virtualenv

override_dh_virtualenv:
	dh_virtualenv --no-test --python /usr/bin/python3

$ cat debian/smbot.triggers
# Register interest in Python interpreter changes (Python 2 for now); and
# don't make the Python package dependent on the virtualenv package
# processing (noawait)

interest-noawait /usr/bin/python3.5


# Also provide a symbolic trigger for all dh-virtualenv packages
interest dh-virtualenv-interpreter-update

$ cat debian/smbot.postinst
#!/bin/sh

#DEBHELPER#

mkdir -p /var/log/sm

Cc: @bszonye, @theaisforannie

and add options for customizability

```
$ make-deb --help
Usage: make-deb [OPTIONS]

Options:
  --python /path/to/python        Path to Python executable to use (e.g.:
                                  /usr/bin/python or /usr/bin/python3
  --python-version [2.x|3.4|3.5]  Python version
  --test / --no-test              Whether to run python setup.py test
  --help                          Show this message and exit.
```

```
$ rm -rf debian; make-deb && cat debian/rules
'debian' directory successfully placed at the root of your repository

%:
	dh $@ --with python-virtualenv
```

```
$ rm -rf debian; make-deb --no-test --python=/usr/bin/python3 --python-version=3.5 && cat debian/rules
'debian' directory successfully placed at the root of your repository

%:
	dh $@ --with python-virtualenv

override_dh_virtualenv:
	dh_virtualenv --no-test --python /usr/bin/python3
```
```
$ rm -rf debian; make-deb --no-test --python=/usr/bin/python3 --python-version=3.5 --postinst-commands='mkdir -p /var/log/sm'
'debian' directory successfully placed at the root of your repository

$ cat debian/smbot.postinst
#!/bin/sh

#DEBHELPER#

mkdir -p /var/log/sm
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant