debian/0000755000000000000000000000000012562116316007171 5ustar debian/patches/0000755000000000000000000000000012562116316010620 5ustar debian/patches/series0000644000000000000000000000011012562116316012025 0ustar retrieve-version-from-debian-changelog.diff add-entry-rdev-methods.diff debian/patches/retrieve-version-from-debian-changelog.diff0000644000000000000000000000237712562116316021101 0ustar Description: retrieve upstream version from debian/changelog Author: Jérémy Bobbio diff --git a/version.py b/version.py index 3441617..5c975ce 100644 --- a/version.py +++ b/version.py @@ -9,26 +9,12 @@ from subprocess import CalledProcessError, check_output version_re = re.compile('^Version: (.+)$', re.M) def get_version(): - d = dirname(__file__) - - if isdir(join(d, '.git')): - # Get the version using "git describe". - cmd = 'git describe --tags --match [0-9]*'.split() - try: - version = check_output(cmd).decode().strip() - except CalledProcessError: - print('Unable to get version number from git tags') - exit(1) - - # PEP 386 compatibility - if '-' in version: - version = '.post'.join(version.split('-')[:2]) - - else: - # Extract the version from the PKG-INFO file. - with open(join(d, 'PKG-INFO')) as f: - version = version_re.search(f.read()).group(1) - + cmd = 'dpkg-parsechangelog -S Version'.split() + try: + version = check_output(cmd).decode().strip().split('-')[0] + except CalledProcessError: + print('Unable to get version number from git tags') + exit(1) return version debian/patches/add-entry-rdev-methods.diff0000644000000000000000000000276412562116316015751 0ustar Description: add support for reading rdevmajor and rdevminor Author: Jérémy Bobbio diff --git a/libarchive/entry.py b/libarchive/entry.py index a5a2519..33e6d9f 100644 --- a/libarchive/entry.py +++ b/libarchive/entry.py @@ -126,3 +126,11 @@ class ArchiveEntry(object): # note we strip the mode because archive_entry_strmode # returns a trailing space: strcpy(bp, "?rwxrwxrwx "); return ffi.entry_strmode(self._entry_p).strip() + + @property + def rdevmajor(self): + return ffi.entry_rdevmajor(self._entry_p) + + @property + def rdevminor(self): + return ffi.entry_rdevminor(self._entry_p) diff --git a/libarchive/ffi.py b/libarchive/ffi.py index 558ab44..cea23aa 100644 --- a/libarchive/ffi.py +++ b/libarchive/ffi.py @@ -6,7 +6,7 @@ from __future__ import division, print_function, unicode_literals from ctypes import ( - c_char_p, c_int, c_longlong, c_size_t, c_ssize_t, c_void_p, c_wchar_p, + c_char_p, c_int, c_uint, c_longlong, c_size_t, c_ssize_t, c_void_p, c_wchar_p, CFUNCTYPE, POINTER, ) import ctypes @@ -119,6 +118,8 @@ ffi('entry_hardlink', [c_archive_entry_p], c_char_p) ffi('entry_hardlink_w', [c_archive_entry_p], c_wchar_p) ffi('entry_symlink', [c_archive_entry_p], c_char_p) ffi('entry_symlink_w', [c_archive_entry_p], c_wchar_p) +ffi('entry_rdevmajor', [c_archive_entry_p], c_uint) +ffi('entry_rdevminor', [c_archive_entry_p], c_uint) ffi('entry_update_pathname_utf8', [c_archive_entry_p, c_char_p], None) debian/watch0000644000000000000000000000014112562116316010216 0ustar version=3 https://pypi.python.org/simple/libarchive-c \ .*/libarchive-c-(.+)\.tar\.gz#.* debian/source/0000755000000000000000000000000012562116316010471 5ustar debian/source/format0000644000000000000000000000001412562116316011677 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000000123112562116316011040 0ustar python-libarchive-c (2.1-3) unstable; urgency=low * Format autopkgtest dependency list properly. Thanks Martin Pitt! (Closes: #795064) -- Jérémy Bobbio Mon, 10 Aug 2015 14:44:45 +0200 python-libarchive-c (2.1-2) unstable; urgency=low * Add watch file. * Fix copyright date for packaging. * Add missing Depends for autopkgtest. -- Jérémy Bobbio Sun, 09 Aug 2015 08:30:48 +0200 python-libarchive-c (2.1-1) unstable; urgency=low * Initial release: (Closes: #793755) - Add a patch to support reading rdevmajor and rdevminor. -- Jérémy Bobbio Mon, 27 Jul 2015 12:03:30 +0200 debian/copyright0000644000000000000000000001076712562116316011137 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: python-libarchive-c Source: https://github.com/Changaco/python-libarchive-c Files: * Copyright: 2014-2015 Changaco License: LGPL-2+ Files: tests/surrogateescape.py Copyright: 2015 Changaco 2011-2013 Victor Stinner License: BSD-2-clause or PSF-2 Files: debian/* Copyright: 2015 Jerémy Bobbio License: permissive Copying and distribution of this package, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. License: LGPL-2+ On Debian systems the full text of the GNU General Public License can be found in the /usr/share/common-licenses/LGPL-2 file. License: BSD-2-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. License: PSF-2 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using this software ("Python") in source or binary form and its associated documentation. . 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights Reserved" are retained in Python alone or in any derivative version prepared by Licensee. . 3. In the event Licensee prepares a derivative work that is based on or incorporates Python or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python. . 4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. . 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. . 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. . 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. . 8. By copying, installing or otherwise using Python, Licensee agrees to be bound by the terms and conditions of this License Agreement. debian/tests/0000755000000000000000000000000012562116316010333 5ustar debian/tests/control0000644000000000000000000000015012562116316011732 0ustar Tests: upstream-tests Depends: python-libarchive-c, python-pytest, python3-libarchive-c, python3-pytest debian/tests/upstream-tests0000755000000000000000000000024512562116316013262 0ustar #!/bin/sh set -e if ! [ -d "$ADTTMP" ]; then echo "ADTTMP not set." >&2 exit 1 fi cp -r tests $ADTTMP (cd $ADTTMP; py.test tests) (cd $ADTTMP; py.test-3 tests) debian/compat0000644000000000000000000000000212562116316010367 0ustar 9 debian/control0000644000000000000000000000341012562116316010572 0ustar Source: python-libarchive-c Maintainer: Jérémy Bobbio Section: python Priority: extra Build-Depends: debhelper (>= 9), dh-python, libarchive-dev, python-all, python-pytest, python-setuptools, python3-all, python3-pytest, python3-setuptools X-Python-Version: >= 2.7 X-Python3-Version: >= 3.2 Standards-Version: 3.9.6 Homepage: https://github.com/Changaco/python-libarchive-c Vcs-Git: git://anonscm.debian.org/collab-maint/python-libarchive-c.git Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/python-libarchive-c.git XS-Testsuite: autopkgtest Package: python-libarchive-c Architecture: all Depends: ${misc:Depends}, ${python:Depends}, libarchive13 Description: Python interface to libarchive The libarchive library provides a flexible interface for reading and writing archives in various formats such as tar and cpio. libarchive also supports reading and writing archives compressed using various compression filters such as gzip and bzip2. . This package contains a Python interface to libarchive written using the standard ctypes module to dynamically load and access the C library. Package: python3-libarchive-c Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, libarchive13 Description: Python3 interface to libarchive The libarchive library provides a flexible interface for reading and writing archives in various formats such as tar and cpio. libarchive also supports reading and writing archives compressed using various compression filters such as gzip and bzip2. . This package contains a Python3 interface to libarchive written using the standard ctypes module to dynamically load and access the C library. debian/rules0000755000000000000000000000032312562116316010247 0ustar #!/usr/bin/make -f export PYBUILD_NAME = libarchive-c %: dh $@ --with python2,python3 --buildsystem=pybuild override_dh_auto_test: LC_ALL=C.UTF-8 py.test -s -vv tests LC_ALL=C.UTF-8 py.test-3 -s -vv tests