--- apt-spacewalk-1.0.6.orig/50spacewalk
+++ apt-spacewalk-1.0.6/50spacewalk
@@ -11,5 +11,5 @@
   }
 };
 DPkg::Post-Invoke {
-    "/usr/lib/apt-spacewalk/post_invoke.py";
+    "if [ -x /usr/lib/apt-spacewalk/post_invoke.py ]; then /usr/lib/apt-spacewalk/post_invoke.py; fi";
 };
--- apt-spacewalk-1.0.6.orig/debian/postrm
+++ apt-spacewalk-1.0.6/debian/postrm
@@ -0,0 +1,34 @@
+#! /bin/sh
+
+set -e
+
+hook=/etc/apt/apt.conf.d/50spacewalk
+
+case "$1" in
+    purge)
+        rm -f $hook.disabled
+        ;;
+
+    remove)
+        mv $hook $hook.disabled
+        ;;
+
+    abort-install)
+        if test "x$2" != "x" && test -f $hook
+        then
+            mv $hook $hook.disabled
+        fi
+        ;;
+
+    upgrade|failed-upgrade|abort-upgrade|disappear)
+        ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+#DEBHELPER#
+
+exit 0
--- apt-spacewalk-1.0.6.orig/debian/copyright
+++ apt-spacewalk-1.0.6/debian/copyright
@@ -0,0 +1,21 @@
+apt-spacewalk is copyright 2011 by Red Hat Inc.
+apt-spacewalk is currently developed by Spacewalk Development Team <spacewalk-devel@redhat.com>.
+
+License: GPLv2
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; version 2 of the License.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+See /usr/share/common-licenses/GPL-2, or
+<http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version
+of the GNU General Public License.
--- apt-spacewalk-1.0.6.orig/debian/changelog
+++ apt-spacewalk-1.0.6/debian/changelog
@@ -0,0 +1,30 @@
+apt-spacewalk (1.0.6-2.1.2.201403130016) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Thu, 13 Mar 2014 00:16:32 +0100
+
+apt-spacewalk (1.0.6-2.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Add postrm/preinst scripts for removing/disabling/enabling the apt hook
+    file, and change the latter to test the existence of post_invoke.py before
+    invoking it (Closes: #703207, 700821).
+  * Setting high urgency due to RC bugs
+
+ -- Serafeim Zanikolas <sez@debian.org>  Wed, 20 Mar 2013 13:45:30 +0100
+
+apt-spacewalk (1.0.6-2) unstable; urgency=low
+
+  * [22c43b83] Rename binary package to apt-transport-spacewalk
+    as suggested by the apt developers.
+  * [e98c50bc] Remove extra 'either' from debian/copyright.
+  * [5ea16bcd] Fix dh_python2 override.
+
+ -- Bernd Zeimetz <bzed@debian.org>  Tue, 19 Jun 2012 22:15:45 +0200
+
+apt-spacewalk (1.0.6-1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Bernd Zeimetz <bzed@debian.org>  Sun, 17 Jun 2012 13:55:50 +0200
--- apt-spacewalk-1.0.6.orig/debian/compat
+++ apt-spacewalk-1.0.6/debian/compat
@@ -0,0 +1 @@
+7
--- apt-spacewalk-1.0.6.orig/debian/install
+++ apt-spacewalk-1.0.6/debian/install
@@ -0,0 +1,5 @@
+post_invoke.py /usr/lib/apt-spacewalk/
+pre_invoke.py /usr/lib/apt-spacewalk/
+spacewalk /usr/lib/apt/methods/
+50spacewalk /etc/apt/apt.conf.d/
+packages.py /usr/share/rhn/actions/
--- apt-spacewalk-1.0.6.orig/debian/rules
+++ apt-spacewalk-1.0.6/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@ --with python2
+
+override_dh_python2:
+	set -e; for i in /usr/lib/apt-spacewalk /usr/lib/apt/methods /usr/share/rhn/actions; do dh_python2 $$i; done
+
--- apt-spacewalk-1.0.6.orig/debian/control
+++ apt-spacewalk-1.0.6/debian/control
@@ -0,0 +1,23 @@
+Source: apt-spacewalk
+Section: admin
+Priority: extra
+Maintainer: Miroslav Suchý <miroslav@suchy.cz>
+Uploaders: Bernd Zeimetz <bzed@debian.org>
+Build-Depends: debhelper (>= 7.0.50~), python (>= 2.6.6-3~)
+Standards-Version: 3.9.3
+Homepage: https://fedorahosted.org/spacewalk
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/spacewalk/apt-spacewalk.git
+Vcs-Git: git://anonscm.debian.org/collab-maint/spacewalk/apt-spacewalk.git
+
+Package: apt-transport-spacewalk
+Architecture: all
+Depends: ${misc:Depends}, ${python:Depends}, apt, python-apt,
+ rhn-client-tools
+Provides: ${python:Provides}
+Recommends: rhnsd
+Description: APT transport for communicating with Spacewalk servers
+ makes it possible to use
+ 'deb spacewalk://your-spacewalk-server/XMLRPC channels: channel1 channel2'
+ type lines in your sources.list. Also it provides the necessary hooks to
+ update your sources.list automatically according to the settings on
+ your Spacewalk server.
--- apt-spacewalk-1.0.6.orig/debian/preinst
+++ apt-spacewalk-1.0.6/debian/preinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+hook=/etc/apt/apt.conf.d/50spacewalk
+if test -f $hook.disabled
+then
+    mv $hook.disabled $hook
+fi
+
+#DEBHELPER#
+
+exit 0 
--- apt-spacewalk-1.0.6.orig/debian/watch
+++ apt-spacewalk-1.0.6/debian/watch
@@ -0,0 +1,2 @@
+version=3
+https://fedorahosted.org/releases/s/p/spacewalk/apt-spacewalk-(.*)\.tar\.gz
--- apt-spacewalk-1.0.6.orig/debian/source/format
+++ apt-spacewalk-1.0.6/debian/source/format
@@ -0,0 +1 @@
+1.0
