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

Add debian packaging files #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python3-ssh (1.0.0-1) UNRELEASED; urgency=medium

*

-- Scott Hamilton <[email protected]> Thu, 13 Jul 2023 20:09:55 +0200
26 changes: 26 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Source: python3-ssh
Maintainer: Scott Hamilton <[email protected]>
Section: utils
Priority: optional
Build-Depends: dh-python,
python3-all,
python3-setuptools,
debhelper-compat (= 12),
libssh-dev,
zlib1g-dev,
libpython3-dev,
libc6,
python3-jinja2,
python3-pytest,
openssh-server,
openssh-client,
cmake
Standards-Version: 4.5.0

Package: python3-ssh
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/
41 changes: 41 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/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 SYSTEM_LIBSSH=1
export LDFLAGS=-s

define write_skip_tests
@for test in $(1); do \
awk '/def '$$test'\(/ { print " @unittest.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_channel_skips := test_write_stdin
test_sftp_skips := test_mkdir

override_dh_auto_test:
$(call write_skip_tests,$(test_channel_skips),tests/test_channel.py)
$(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 ssh_python.egg-info
rm -rf .pybuild
rm -rf .pytest_cache
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)