Skip to content

Support building Python 3 debs#16

Open
msabramo wants to merge 3 commits intonylas:masterfrom
msabramo:python3_and_options_click
Open

Support building Python 3 debs#16
msabramo wants to merge 3 commits intonylas:masterfrom
msabramo:python3_and_options_click

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
```
@msabramo msabramo force-pushed the python3_and_options_click branch from ffe1aa0 to 2580914 Compare October 31, 2016 20:18
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