diff -Nru libarchive-3.0.4/debian/changelog libarchive-3.0.4/debian/changelog --- libarchive-3.0.4/debian/changelog 2012-05-24 14:50:50.000000000 +0200 +++ libarchive-3.0.4/debian/changelog 2012-10-31 10:33:00.000000000 +0100 @@ -1,3 +1,9 @@ +libarchive (3.0.4-2ubuntu1) raring; urgency=low + + * Add autopkgtest support (LP: #1073390). + + -- Benjamin Drung Wed, 31 Oct 2012 01:49:44 +0100 + libarchive (3.0.4-2) unstable; urgency=low * Add debian/patches/gcc-4.7-fixes-from-upstream.patch diff -Nru libarchive-3.0.4/debian/control libarchive-3.0.4/debian/control --- libarchive-3.0.4/debian/control 2012-05-24 14:50:50.000000000 +0200 +++ libarchive-3.0.4/debian/control 2012-10-31 08:26:34.000000000 +0100 @@ -1,6 +1,7 @@ Source: libarchive Priority: optional -Maintainer: Debian Libarchive Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Libarchive Maintainers Uploaders: Andreas Henriksson , Andres Mejia Build-Depends: debhelper (>= 8.1.3~), libbz2-dev, @@ -18,6 +19,7 @@ Homepage: http://libarchive.github.com/ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libarchive.git Vcs-Git: git://anonscm.debian.org/collab-maint/libarchive.git +XS-Testsuite: autopkgtest Package: libarchive-dev Section: libdevel diff -Nru libarchive-3.0.4/debian/patches/examples.patch libarchive-3.0.4/debian/patches/examples.patch --- libarchive-3.0.4/debian/patches/examples.patch 1970-01-01 01:00:00.000000000 +0100 +++ libarchive-3.0.4/debian/patches/examples.patch 2012-10-31 01:52:34.000000000 +0100 @@ -0,0 +1,26 @@ +Description: Add autopkgtest support. +Author: Benjamin Drung + +--- libarchive-3.0.4.orig/examples/untar.c ++++ libarchive-3.0.4/examples/untar.c +@@ -53,7 +53,7 @@ + */ + + #include +-__FBSDID("$FreeBSD$"); ++//__FBSDID("$FreeBSD$"); + + #include + +--- libarchive-3.0.4.orig/examples/minitar/minitar.c ++++ libarchive-3.0.4/examples/minitar/minitar.c +@@ -427,6 +427,9 @@ msg(const char *m) + static void + errmsg(const char *m) + { ++ if(m == NULL) { ++ m = "Error: No error description provided.\n"; ++ } + write(2, m, strlen(m)); + } + diff -Nru libarchive-3.0.4/debian/patches/series libarchive-3.0.4/debian/patches/series --- libarchive-3.0.4/debian/patches/series 2012-05-24 14:50:50.000000000 +0200 +++ libarchive-3.0.4/debian/patches/series 2012-10-31 01:53:57.000000000 +0100 @@ -1 +1,2 @@ gcc-4.7-fixes-from-upstream.patch +examples.patch diff -Nru libarchive-3.0.4/debian/tests/control libarchive-3.0.4/debian/tests/control --- libarchive-3.0.4/debian/tests/control 1970-01-01 01:00:00.000000000 +0100 +++ libarchive-3.0.4/debian/tests/control 2012-10-31 10:24:01.000000000 +0100 @@ -0,0 +1,2 @@ +Tests: minitar +Depends: build-essential, file, libarchive-dev, pkg-config diff -Nru libarchive-3.0.4/debian/tests/minitar libarchive-3.0.4/debian/tests/minitar --- libarchive-3.0.4/debian/tests/minitar 1970-01-01 01:00:00.000000000 +0100 +++ libarchive-3.0.4/debian/tests/minitar 2012-10-31 01:49:15.000000000 +0100 @@ -0,0 +1,50 @@ +#!/bin/sh +set -e + +# autopkgtest check: Build and run the example minitar program against +# libarchive, to verify that the headers and pkg-config file are installed +# correctly and minitar works as expected. +# Author: Benjamin Drung + +gcc -O2 -g -Wno-unused-result -o minitar examples/minitar/minitar.c $(pkg-config --cflags --libs libarchive) + +# Create different tarballs +echo "Deadbeaf" > foo +echo "Compressing foo.tar..." +./minitar -cf foo.tar foo +echo "Compressing foo.tar.gz..." +./minitar -czf foo.tar.gz foo +echo "Compressing foo.tar.bz2..." +./minitar -cyf foo.tar.bz2 foo + +# Test tarballs for correct mime type +echo "Testing mime type of foo.tar..." +test "$(file -b --mime-type foo.tar)" = "application/x-tar" +echo "Testing mime type of foo.tar.gz..." +test "$(file -b --mime-type foo.tar.gz)" = "application/x-gzip" +echo "Testing mime type of foo.tar.bz2..." +test "$(file -b --mime-type foo.tar.bz2)" = "application/x-bzip2" + +# FIXME: Extracting with minitar crashes; using untar instead. +gcc -O2 -g -Wno-unused-result -o untar examples/untar.c $(pkg-config --cflags --libs libarchive) + +# Extract tarballs and compare content +mv foo foo.orig +echo "Extracting foo.tar..." +# FIXME ./minitar -xf foo.tar +./untar -xf foo.tar +cmp foo foo.orig +rm foo foo.tar +echo "Extracting foo.tar.gz..." +# FIXME ./minitar -xf foo.tar.gz +tar -xf foo.tar.gz +cmp foo foo.orig +rm foo foo.tar.gz +echo "Extracting foo.tar.bz2..." +# FIXME ./minitar -xf foo.tar.bz2 +tar -xf foo.tar.bz2 +cmp foo foo.orig +rm foo foo.tar.bz2 + +# Clean-up +rm foo.orig minitar untar