Skip to content

Commit

Permalink
Add debian packaging files
Browse files Browse the repository at this point in the history
  • Loading branch information
SCOTT-HAMILTON committed Jul 13, 2023
1 parent 692bbbf commit 63e741d
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python3-ssh2 (1.0.0-1) UNRELEASED; urgency=medium

*

-- Scott Hamilton <[email protected]> Tue, 11 Jul 2023 18:01:37 +0200
25 changes: 25 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Source: python3-ssh2
Maintainer: Scott Hamilton <[email protected]>
Section: utils
Priority: optional
Build-Depends: dh-python,
python3-all,
python3-setuptools,
debhelper-compat (= 12),
libssl-dev,
zlib1g-dev,
libpython3-dev,
libc6,
python3-jinja2,
openssh-server,
openssh-client,
cmake
Standards-Version: 4.5.0

Package: python3-ssh2
Architecture: any
Depends: ${python3:Depends},
${shlibs:Depends},
${misc:Depends}
Description: Python bindings for libssh2 C library.
ssh2-python is a super fast SSH2 protocol library
1 change: 1 addition & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
3 changes: 3 additions & 0 deletions debian/python3-ssh2.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore embedded-library errors for all files in usr/lib/python3/dist-packages/ssh2
# since upstream made the choice to bundle libssh2 instead of relying on system's one.
python3-ssh2 binary: embedded-library usr/lib/python3/dist-packages/ssh2/*.so*
39 changes: 39 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

#! /usr/bin/make -f

#export DH_VERBOSE = 1
export PYBUILD_NAME = ssh2-python
export PYBUILD_BEFORE_TEST=mkdir -p {build_dir}/ssh2; cp ssh2/sftp_handle.c {build_dir}/ssh2
export LDFLAGS=-s

define write_skip_tests
@for test in $(1); do \
awk '/def '$$test'\(/ { print " @skipUnless(False, \"debian packaging\")" RS $$0; next }1' $(2) > "$(2)_temp" && mv "$(2)_temp" $(2); \
done
endef

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

test_sftp_skips := test_mkdir

override_dh_auto_test:
$(call write_skip_tests,$(test_sftp_skips),tests/test_sftp.py)
out_ssh_agent=$$(ssh-agent -s); \
export SSH_AUTH_SOCK=$$(echo $$out_ssh_agent | grep SSH_AUTH_SOCK| cut -d';' -f1 | sed -E 's/^SSH_AUTH_SOCK=(.*)/\1/g'); \
export SSH_AGENT_PID=$$(echo $$out_ssh_agent | grep SSH_AGENT_PID | sed -E 's/.*SSH_AGENT_PID=([0-9]*);.*/\1/g'); \
PYTHONDONTWRITEBYTECODE=1 dh_auto_test; \
ssh-agent -k
clean:
dh_clean
rm -rf __pycache__
rm -rf build_dir
rm -rf build
rm -rf ssh2_python.egg-info
rm -rf .pybuild
rm -f ssh2/libssh2.so*
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)

0 comments on commit 63e741d

Please sign in to comment.