Skip to content

Commit

Permalink
Merge pull request #32 from mithro/debian
Browse files Browse the repository at this point in the history
Initial (crappy) Debian packaging
  • Loading branch information
mithro committed Aug 11, 2016
2 parents 10c5e72 + a04fb3f commit d6193ed
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ docs/_build/
# PyBuilder
target/

# Debian stuff
debian/files
debian/hdmi2usb-mode-switch*

# conda
Miniconda3-latest-Linux-x86_64.sh
conda

# Helper util.
bin/unbind-helper

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ check-unbind-helper:
@[ "$$(stat -c "%a %U" bin/unbind-helper)" = "4755 root" ]

clean-unbind-helper:
sudo rm bin/unbind-helper
if [ -e bin/unbind-helper ]; then sudo rm bin/unbind-helper; fi

# udev rules
install-udev:
Expand Down Expand Up @@ -94,7 +94,7 @@ update-usb-ids:
clean:
make clean-conda
make clean-unbind-helper
make uninstall-udev
git clean -d -x -f

setup:
if ! make check-conda; then \
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hdmi2usb-mode-switch (0.0.0) unstable; urgency=low

* Initial (dirty) packaging.

-- Tim 'mithro' Ansell <mithro@mithis.com> Mon, 09 Dec 2013 02:58:24 +0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
43 changes: 43 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Source: hdmi2usb-mode-switch
Section: admin
Priority: optional
Maintainer: Tim 'mithro' Ansell <mithro@mithis.com>
Build-Depends: debhelper (>= 9), dh-python, build-essential, git-buildpackage, python3-setuptools
Standards-Version: 3.9.5
X-Python3-Version: >= 3.2
Homepage: https://hdmi2usb.tv/
Vcs-Git: https://github.com/timvideos/HDMI2USB-mode-switch.git

Package: hdmi2usb-mode-switch
Priority: extra
Architecture: all
Recommends: openocd
Depends: ${python:Depends}, ${misc:Depends}, fxload
Description: HDMI2USB mode-switch tool
${Description}
.
Tool for changing the operating mode of HDMI2USB devices.
.
${Requirement}

Package: hdmi2usb-mode-switch-unbind-helper
Architecture: linux-any
Depends: ${misc:Depends}
Suggests: hdmi2usb-mode-switch-udev
Description: HDMI2USB mode-switch driver unbinding helper
${Description}
.
Tool to allow non-root users to unbind drivers from USB devices.
.
${Requirement}

Package: hdmi2usb-mode-switch-udev
Architecture: all
Suggests: hdmi2usb-mode-switch-unbind-helper
Description: HDMI2USB udev rules
${Description}
.
This package provides a udev rules files for HDMI2USB devices.
.
${Requirement}

28 changes: 28 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export PYBUILD_NAME=hdmi2usb.modeswitch

include /usr/share/dpkg/pkg-info.mk

%:
dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_install:
python3 setup.py install --root=$(CURDIR)/debian/$(DEB_SOURCE) --install-layout=deb
# udev rules
mkdir -p $(CURDIR)/debian/$(DEB_SOURCE)-udev/lib/udev/rules.d/
cp udev/*.rules $(CURDIR)/debian/$(DEB_SOURCE)-udev/lib/udev/rules.d/
install --mode=0755 --owner=root --group=root udev/hdmi2usb-human-path-helper.sh $(CURDIR)/debian/$(DEB_SOURCE)-udev/lib/udev/rules.d/
sed -i -e's-/etc/udev/rules.d/-/lib/udev/rules.d/-' $(CURDIR)/debian/$(DEB_SOURCE)-udev/lib/udev/rules.d/*
# unbind-helper
gcc -Wall -std=c99 unbind-helper.c -o debian/unbind-helper
mkdir -p $(CURDIR)/debian/$(DEB_SOURCE)-unbind-helper/usr/sbin/
install --mode=4755 --owner=root --group=root debian/unbind-helper $(CURDIR)/debian/$(DEB_SOURCE)-unbind-helper/usr/sbin/
rm debian/unbind-helper

# Include the same text at the beginning of the extended description of
# each package, and the same requirement at the end.
override_dh_gencontrol:
dh_gencontrol -- -Tdebian/substvars
3 changes: 3 additions & 0 deletions debian/substvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Description=Tool for changing the operating mode of HDMI2USB devices.

Requirement=OpenOCD and fxload
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
# vim: set ts=4 sw=4 et sts=4 ai:

import sys
from setuptools import setup
from setuptools import find_packages
from setuptools import setup
import os
import sys

import versioneer

Expand All @@ -12,6 +13,12 @@
raise SystemExit("You need Python 3.3+")


if os.environ.get('PYBUILD_NAME'):
setup_requires = []
else:
setup_requires = ['setuptools-pep8']


setup(
name="hdmi2usb.modeswitch",
version=versioneer.get_version(),
Expand Down Expand Up @@ -47,7 +54,7 @@
# ('/etc/udev/rules.d/', os.listdir(udev,
# "*-hdmi2usb-*.rules", "hdmi2usb-*.sh"),
# ],
setup_requires=['setuptools-pep8'],
setup_requires=setup_requires,
include_package_data=True,
entry_points={
"console_scripts": [x+"=hdmi2usb.modeswitch.cli:main" for x in (
Expand Down

0 comments on commit d6193ed

Please sign in to comment.