Jenkins showed that pkg-config was not pulled in by installing
libxml2-dev. Personally I think it might make sense to add it as a
depends, but I don't want to make the decision for the package
maintainer. Instead I made sure that it is installed for the test.

Updated patch attached.
diff -Nru libxml2-2.8.0+dfsg1/debian/changelog libxml2-2.8.0+dfsg1/debian/changelog
--- libxml2-2.8.0+dfsg1/debian/changelog	2012-07-22 14:48:05.000000000 +0200
+++ libxml2-2.8.0+dfsg1/debian/changelog	2012-10-10 08:16:04.000000000 +0200
@@ -1,3 +1,19 @@
+libxml2 (2.8.0+dfsg1-5ubuntu2) quantal; urgency=low
+
+  * debian/tests/control: added pkg-config as depends for the test. 
+    Change forwarded to Debian as bug 690047.
+
+ -- Daniel Holbach <daniel.holb...@ubuntu.com>  Wed, 10 Oct 2012 08:15:16 +0200
+
+libxml2 (2.8.0+dfsg1-5ubuntu1) quantal; urgency=low
+
+  * debian/tests/build, debian/tests/control: add test to check
+    that code can be easily built against libxml2, test some core
+    functionality too.
+  * debian/control: enable autopkgtest.
+
+ -- Daniel Holbach <daniel.holb...@ubuntu.com>  Tue, 09 Oct 2012 13:49:15 +0200
+
 libxml2 (2.8.0+dfsg1-5) unstable; urgency=low
 
   [ Daniel Veillard ]
diff -Nru libxml2-2.8.0+dfsg1/debian/control libxml2-2.8.0+dfsg1/debian/control
--- libxml2-2.8.0+dfsg1/debian/control	2012-07-22 14:50:34.000000000 +0200
+++ libxml2-2.8.0+dfsg1/debian/control	2012-10-09 15:28:19.000000000 +0200
@@ -1,7 +1,8 @@
 Source: libxml2
 Priority: optional
 Section: libs
-Maintainer: Debian XML/SGML Group <debian-xml-sgml-p...@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian XML/SGML Group <debian-xml-sgml-p...@lists.alioth.debian.org>
 Uploaders: Aron Xu <a...@debian.org>, YunQiang Su <wzss...@gmail.com>
 Standards-Version: 3.9.3
 Build-Depends: debhelper (>= 9), perl, dh-autoreconf, autotools-dev,
@@ -10,6 +11,7 @@
 Homepage: http://xmlsoft.org/
 Vcs-Git: git://git.debian.org/debian-xml-sgml/libxml2.git
 Vcs-Browser: http://git.debian.org/?p=debian-xml-sgml/libxml2.git
+XS-Testsuite: autopkgtest
 
 Package: libxml2
 Priority: standard
@@ -144,3 +146,18 @@
  This package contains the files needed to use the GNOME XML library
  in Python programs for use with the Python debug interpreter.
 
+Package: libxml2-udeb
+XC-Package-Type: udeb
+Architecture: any
+Section: debian-installer
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: GNOME XML library - minimal runtime
+ XML is a metalanguage to let you design your own markup language.
+ A regular markup language defines a way to describe information in
+ a certain class of documents (eg HTML). XML lets you define your
+ own customized markup languages for many classes of document. It
+ can do this because it's written in SGML, the international standard
+ metalanguage for markup languages.
+ .
+ This is a minimal package for use in debian-installer that yields a
+ library providing an extensive API to handle such XML data files.
diff -Nru libxml2-2.8.0+dfsg1/debian/tests/build libxml2-2.8.0+dfsg1/debian/tests/build
--- libxml2-2.8.0+dfsg1/debian/tests/build	1970-01-01 01:00:00.000000000 +0100
+++ libxml2-2.8.0+dfsg1/debian/tests/build	2012-10-09 13:47:35.000000000 +0200
@@ -0,0 +1,41 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libxml2, to verify that the
+# headers and pkg-config file are installed correctly
+# (C) 2012 Canonical Ltd.
+# Author: Daniel Holbach <daniel.holb...@ubuntu.com>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+cat <<EOF > xmltest.c
+#include <libxml/parser.h>
+
+int
+main(void)
+{
+
+    xmlNodePtr n;
+    xmlDocPtr doc;
+    xmlNodePtr cur;
+
+    doc = xmlNewDoc(BAD_CAST "1.0");
+    n = xmlNewNode(NULL, BAD_CAST "root");
+    xmlNodeSetContent(n, BAD_CAST "content");
+    xmlDocSetRootElement(doc, n);
+
+    cur = xmlDocGetRootElement(doc);
+    if (xmlStrcmp(cur->name, (const xmlChar *) "root"))
+        return (1);
+    xmlFreeDoc(doc);
+    return (0);
+
+}
+EOF
+
+gcc -o xmltest xmltest.c `pkg-config --cflags --libs libxml-2.0`
+echo "build: OK"
+[ -x xmltest ]
+./xmltest
+echo "run: OK"
diff -Nru libxml2-2.8.0+dfsg1/debian/tests/control libxml2-2.8.0+dfsg1/debian/tests/control
--- libxml2-2.8.0+dfsg1/debian/tests/control	1970-01-01 01:00:00.000000000 +0100
+++ libxml2-2.8.0+dfsg1/debian/tests/control	2012-10-10 08:15:14.000000000 +0200
@@ -0,0 +1,2 @@
+Tests: build
+Depends: libxml2-dev, build-essential, pkg-config

Reply via email to