Changes to 'refs/tags/jabberd-selinux-workaround-1.0.2-1'
by Milan Zazrivec
Tag 'jabberd-selinux-workaround-1.0.2-1' created by Milan Zazrivec <mzazrivec(a)redhat.com> at 2011-01-31 13:19 +0000
Tagging package [jabberd-selinux-workaround] version [1.0.2-1] in directory [selinux/jabberd-selinux-workaround/].
Changes since rhn-client-tools-1.3.12-1:
Milan Zazrivec (2):
initial commit of jabberd-selinux-workaround
Automatic commit of package [jabberd-selinux-workaround] release [1.0.2-1].
---
rel-eng/packages/jabberd-selinux-workaround | 1
selinux/jabberd-selinux-workaround/jabberd-selinux-workaround-enable | 9
selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec | 94 ++++++++++
selinux/jabberd-selinux-workaround/jabberworkaround.if | 1
selinux/jabberd-selinux-workaround/jabberworkaround.te | 17 +
5 files changed, 122 insertions(+)
---
13 years, 2 months
rel-eng/packages selinux/jabberd-selinux-workaround
by Milan Zazrivec
rel-eng/packages/jabberd-selinux-workaround | 1 +
selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
New commits:
commit cbc9fe3721486c4c27a768df228a47cc0168fdd4
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Jan 31 14:19:23 2011 +0100
Automatic commit of package [jabberd-selinux-workaround] release [1.0.2-1].
diff --git a/rel-eng/packages/jabberd-selinux-workaround b/rel-eng/packages/jabberd-selinux-workaround
new file mode 100644
index 0000000..bc82aae
--- /dev/null
+++ b/rel-eng/packages/jabberd-selinux-workaround
@@ -0,0 +1 @@
+1.0.2-1 selinux/jabberd-selinux-workaround/
diff --git a/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec b/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec
index 0e04f4b..0ea6433 100644
--- a/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec
+++ b/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec
@@ -6,7 +6,7 @@
%global modulename jabberworkaround
Name: jabberd-selinux-workaround
-Version: 1.0.1
+Version: 1.0.2
Release: 1%{?dist}
Summary: SELinux policy module supporting jabberd on RHEL-6.0
@@ -89,3 +89,6 @@ fi
%attr(0755,root,root) %{_sbindir}/%{name}-enable
%changelog
+* Mon Jan 31 2011 Milan Zazrivec <mzazrivec(a)redhat.com> 1.0.2-1
+- initial packaging
+
13 years, 2 months
selinux/jabberd-selinux-workaround
by Milan Zazrivec
selinux/jabberd-selinux-workaround/jabberd-selinux-workaround-enable | 9
selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec | 91 ++++++++++
selinux/jabberd-selinux-workaround/jabberworkaround.if | 1
selinux/jabberd-selinux-workaround/jabberworkaround.te | 17 +
4 files changed, 118 insertions(+)
New commits:
commit 5ecfb5c0becfe85d7029a115cdf978073cafbe2d
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Jan 31 14:16:43 2011 +0100
initial commit of jabberd-selinux-workaround
This SELinux module is to allow jabberd to work with stock RHEL-6.0
selinux-policy-targeted in enforcing mode.
diff --git a/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround-enable b/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround-enable
new file mode 100644
index 0000000..6f0e3da
--- /dev/null
+++ b/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround-enable
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Install SELinux policy modules
+for selinuxvariant in mls strict targeted
+ do
+ /usr/sbin/semodule -s ${selinuxvariant} -l > /dev/null 2>&1 \
+ && /usr/sbin/semodule -s ${selinuxvariant} -i \
+ /usr/share/selinux/${selinuxvariant}/jabberworkaround.pp || :
+ done
diff --git a/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec b/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec
new file mode 100644
index 0000000..0e04f4b
--- /dev/null
+++ b/selinux/jabberd-selinux-workaround/jabberd-selinux-workaround.spec
@@ -0,0 +1,91 @@
+%global selinux_variants mls strict targeted
+%global selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2> /dev/null)
+%global POLICYCOREUTILSVER 1.33.12-1
+
+%global moduletype apps
+%global modulename jabberworkaround
+
+Name: jabberd-selinux-workaround
+Version: 1.0.1
+Release: 1%{?dist}
+Summary: SELinux policy module supporting jabberd on RHEL-6.0
+
+Group: System Environment/Base
+License: GPLv2+
+URL: http://fedorahosted.org/spacewalk
+Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: checkpolicy, selinux-policy-devel
+BuildRequires: policycoreutils >= %{POLICYCOREUTILSVER}
+BuildArch: noarch
+
+%if "%{selinux_policyver}" != ""
+Requires: selinux-policy >= %{selinux_policyver}
+%endif
+Requires(post): /usr/sbin/semodule, /sbin/restorecon, /usr/sbin/setsebool, /usr/sbin/selinuxenabled
+Requires(postun): /usr/sbin/semodule, /sbin/restorecon
+Requires: jabberd >= 2.2.8
+
+%description
+Workaround for jabberd to work with default RHEL-6.0 SELinux policy.
+
+%prep
+%setup -q
+
+%build
+# Build SELinux policy modules
+perl -i -pe 'BEGIN { $VER = join ".", grep /^\d+$/, split /\./, "%{version}.%{release}"; } s!\@\@VERSION\@\@!$VER!g;' %{modulename}.te
+for selinuxvariant in %{selinux_variants}
+do
+ make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
+ mv %{modulename}.pp %{modulename}.pp.${selinuxvariant}
+ make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
+done
+
+%install
+rm -rf %{buildroot}
+
+# Install SELinux policy modules
+for selinuxvariant in %{selinux_variants}
+ do
+ install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
+ install -p -m 644 %{modulename}.pp.${selinuxvariant} \
+ %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp
+ done
+
+# Install SELinux interfaces
+install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
+install -p -m 644 %{modulename}.if \
+ %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if
+
+# Install jabberd-selinux-enable which will be called in %posttrans
+install -d %{buildroot}%{_sbindir}
+install -p -m 755 %{name}-enable %{buildroot}%{_sbindir}/%{name}-enable
+
+%clean
+rm -rf %{buildroot}
+
+%post
+if /usr/sbin/selinuxenabled ; then
+ %{_sbindir}/%{name}-enable
+fi
+
+%postun
+# Clean up after package removal
+if [ $1 -eq 0 ]; then
+ for selinuxvariant in %{selinux_variants}
+ do
+ /usr/sbin/semodule -s ${selinuxvariant} -l > /dev/null 2>&1 \
+ && /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} || :
+ done
+fi
+
+%files
+%defattr(-,root,root,0755)
+%doc %{modulename}.fc %{modulename}.if %{modulename}.te
+%{_datadir}/selinux/*/%{modulename}.pp
+%{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if
+%attr(0755,root,root) %{_sbindir}/%{name}-enable
+
+%changelog
diff --git a/selinux/jabberd-selinux-workaround/jabberworkaround.fc b/selinux/jabberd-selinux-workaround/jabberworkaround.fc
new file mode 100644
index 0000000..e69de29
diff --git a/selinux/jabberd-selinux-workaround/jabberworkaround.if b/selinux/jabberd-selinux-workaround/jabberworkaround.if
new file mode 100644
index 0000000..3eb6a30
--- /dev/null
+++ b/selinux/jabberd-selinux-workaround/jabberworkaround.if
@@ -0,0 +1 @@
+## <summary></summary>
diff --git a/selinux/jabberd-selinux-workaround/jabberworkaround.te b/selinux/jabberd-selinux-workaround/jabberworkaround.te
new file mode 100644
index 0000000..9d721e1
--- /dev/null
+++ b/selinux/jabberd-selinux-workaround/jabberworkaround.te
@@ -0,0 +1,17 @@
+
+policy_module(jabberworkaround, @@VERSION@@)
+
+require {
+ type jabberd_t;
+ class process setfscreate;
+ class netlink_route_socket { write getattr read bind create nlmsg_read };
+}
+
+#============= jabberd_t ==============
+allow jabberd_t self:netlink_route_socket { write getattr read bind create nlmsg_read };
+allow jabberd_t self:process setfscreate;
+kerberos_use(jabberd_t)
+miscfiles_manage_cert_dirs(jabberd_t)
+miscfiles_manage_cert_files(jabberd_t)
+seutil_read_file_contexts(jabberd_t)
+seutil_search_default_contexts(jabberd_t)
13 years, 2 months
Changes to 'refs/tags/rhn-client-tools-1.3.12-1'
by Miroslav Suchý
Tag 'rhn-client-tools-1.3.12-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-01-31 12:03 +0000
Tagging package [rhn-client-tools] version [1.3.12-1] in directory [client/rhel/rhn-client-tools/].
Changes since rhn-client-tools-1.3.11-1:
Miroslav Suchý (3):
672471 - do not send info to rhnParent about removing packages if plugin is enabled, but machine is not registred - i.e. getSystemId() returns None
cp firstboot/rhn_choose_channel.py firstboot-legacy-rhel5/
Automatic commit of package [rhn-client-tools] release [1.3.12-1].
---
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile | 2
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_channel.py | 71 ++++++++++
client/rhel/yum-rhn-plugin/rhnplugin.py | 13 -
rel-eng/packages/rhn-client-tools | 2
5 files changed, 84 insertions(+), 9 deletions(-)
---
13 years, 2 months
2 commits - client/rhel rel-eng/packages
by Miroslav Suchý
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile | 2
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_channel.py | 71 ++++++++++
rel-eng/packages/rhn-client-tools | 2
4 files changed, 77 insertions(+), 3 deletions(-)
New commits:
commit 3e7cdec6f7db5209f4cb3206ecd16c55eaa1d022
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 31 13:03:39 2011 +0100
Automatic commit of package [rhn-client-tools] release [1.3.12-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 66e59a7..1a8bb10 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.3.11
+Version: 1.3.12
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -292,6 +292,9 @@ make -f Makefile.rhn-client-tools test
%endif
%changelog
+* Mon Jan 31 2011 Miroslav Suchý <msuchy(a)redhat.com> 1.3.12-1
+- cp firstboot/rhn_choose_channel.py firstboot-legacy-rhel5/
+
* Fri Jan 28 2011 Miroslav Suchý <msuchy(a)redhat.com> 1.3.11-1
- break circular import
- 580479 - put new submodule into package
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 97685ce..81aee16 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.3.11-1 client/rhel/rhn-client-tools/
+1.3.12-1 client/rhel/rhn-client-tools/
commit 7f07895855663fbf5a9a35fbf1eabcede5fb0970
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 31 13:02:56 2011 +0100
cp firstboot/rhn_choose_channel.py firstboot-legacy-rhel5/
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
index bbd6365..1de5aca 100644
--- a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile
@@ -6,7 +6,7 @@ MODULES = rhn_login_gui \
rhn_register_firstboot_gui_window \
rhn_start_gui rhn_choose_server_gui \
rhn_provide_certificate_gui rhn_create_profile_gui \
- rhn_review_gui rhn_finish_gui
+ rhn_review_gui rhn_finish_gui rhn_choose_channel
PYFILES = $(addsuffix .py, $(MODULES))
OBJECTS = $(PYFILES) $(addsuffix .pyc, $(MODULES))
diff --git a/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_channel.py b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_channel.py
new file mode 100644
index 0000000..f82921b
--- /dev/null
+++ b/client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_channel.py
@@ -0,0 +1,71 @@
+# Copyright 2011 Red Hat, Inc.
+# Copyright 2003 Brent Fox <bfox(a)redhat.com>
+#
+# 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; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Authors:
+# Miroslav Suchy <msuchy(a)redhat.com>
+
+import sys
+sys.path.append("/usr/share/rhn")
+from up2date_client import rhnreg, rhnregGui, rhnserver
+
+import gtk
+
+import gettext
+_ = lambda x: gettext.ldgettext("rhn-client-tools", x)
+
+gtk.glade.bindtextdomain("rhn-client-tools")
+
+from firstboot.module import Module
+from firstboot.constants import RESULT_SUCCESS, RESULT_FAILURE, RESULT_JUMP
+
+class moduleClass(Module):
+ def __init__(self):
+ Module.__init__(self)
+ self.priority = 108.6
+ self.sidebarTitle = _("Select operating system release")
+ self.title = _("Select operating system release")
+ self.chooseChannel = FirstbootChooseChannelPage()
+
+ def needsNetwork(self):
+ return True
+
+ def apply(self, interface, testing=False):
+ if testing:
+ return RESULT_SUCCESS
+
+ self.chooseChannel.chooseChannelPageApply()
+ return RESULT_SUCCESS
+
+ def createScreen(self):
+ self.vbox = gtk.VBox(spacing=5)
+ self.vbox.pack_start(self.chooseChannel.chooseChannelPageVbox(), True, True)
+
+ def initializeUI(self):
+ # populate capability - needef for EUSsupported
+ s = rhnserver.RhnServer()
+ s.capabilities.validate()
+
+ # this populate zstream channels as side effect
+ self.chooseChannel.chooseChannelShouldBeShown()
+
+ self.chooseChannel.chooseChannelPagePrepare()
+
+ def shouldAppear(self):
+ return not rhnreg.registered()
+
+class FirstbootChooseChannelPage(rhnregGui.ChooseChannelPage):
+ pass
13 years, 2 months
client/rhel
by Miroslav Suchý
client/rhel/yum-rhn-plugin/rhnplugin.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
New commits:
commit c9a057eda32efe4f02702b1e3e1ba163b693ae55
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 31 10:01:02 2011 +0100
672471 - do not send info to rhnParent about removing packages if plugin is enabled, but machine is not registred - i.e. getSystemId() returns None
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index cbc128c..6bc0e0d 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -186,12 +186,13 @@ def posttrans_hook(conduit):
ts_info = conduit.getTsInfo()
delta = make_package_delta(ts_info)
rhnPackageInfo.logDeltaPackages(delta)
- try:
- rhnPackageInfo.updatePackageProfile()
- except up2dateErrors.RhnServerException, e:
- conduit.error(0, COMMUNICATION_ERROR + "\n" +
- _("Package profile information could not be sent.") + "\n" +
- str(e))
+ if up2dateAuth.getSystemId(): # are we registred?
+ try:
+ rhnPackageInfo.updatePackageProfile()
+ except up2dateErrors.RhnServerException, e:
+ conduit.error(0, COMMUNICATION_ERROR + "\n" +
+ _("Package profile information could not be sent.") + "\n" +
+ str(e))
def rewordError(e):
#This is compensating for hosted/satellite returning back an error
13 years, 2 months
Branch 'debian' - 2 commits - client/apt-spacewalk DEBIAN-HOWTO
by Miroslav Suchý
DEBIAN-HOWTO | 17 +
client/apt-spacewalk/debian/apt-spacewalk.install | 1
client/apt-spacewalk/debian/changelog | 6
client/apt-spacewalk/debian/compat | 1
client/apt-spacewalk/debian/control | 15 +
client/apt-spacewalk/debian/copyright | 21 +
client/apt-spacewalk/debian/docs | 2
client/apt-spacewalk/debian/pycompat | 1
client/apt-spacewalk/debian/rules | 46 +++
client/apt-spacewalk/debian/source/format | 1
client/apt-spacewalk/debian/watch | 2
client/apt-spacewalk/spacewalk.py | 262 ++++++++++++++++++++++
12 files changed, 374 insertions(+), 1 deletion(-)
New commits:
commit 4239f043da4e457a8ade4f7771d0c17dea8e9cd4
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Sat Jan 29 19:58:06 2011 +0100
howto build apt-spacewalk debian package
diff --git a/DEBIAN-HOWTO b/DEBIAN-HOWTO
index 4b001d5..ed04f6a 100644
--- a/DEBIAN-HOWTO
+++ b/DEBIAN-HOWTO
@@ -3,10 +3,11 @@ HOW TO BUILD DEBIAN PACKAGES
python-rhnlib in client/rhel/rhnlib
-----------------------------------
git checkout master
-cd rhnlib
+cd client/rhel/rhnlib
tito build --tgz
copy rhnlib-2.5.27.tar.gz /tmp/python-rhnlib_2.5.27.orig.tar.gz
git checkout debian
+cd ..
cp -a rhnlib /tmp/python-rhnlib-2.5.27
cd /tmp/python-rhnlib-2.5.27
debuild -i -S
@@ -18,3 +19,17 @@ Similary for other packages.
All packages available:
python-rhnlib in client/rhel/rhnlib
python-ethtool-0.5 in spec-tree/python-ethtool-0.5
+apt-spacewalk
+
+
+apt-spacewalk is not in master, so the instructions is little differen:
+cd client/apt-spacewalk
+tar zcvf /tmp/apt-spacewalk_1.0.0.orig.tar.gz spacewalk.py
+cd ..
+cp -a apt-spacewalk /tmp/apt-spacewalk-1.0.0
+cd /tmp/apt-spacewalk-1.0.0
+#build source package
+debuild -i -S
+#or build binary package
+debuild -b
+
commit 5bb8d7698b7e7dbc61eb5243303b2a84c3a48b7f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Sat Jan 29 19:53:52 2011 +0100
add apt-spacewalk package
diff --git a/client/apt-spacewalk/debian/apt-spacewalk.install b/client/apt-spacewalk/debian/apt-spacewalk.install
new file mode 100644
index 0000000..6819a30
--- /dev/null
+++ b/client/apt-spacewalk/debian/apt-spacewalk.install
@@ -0,0 +1 @@
+spacewalk.py /usr/lib/apt/methods/
diff --git a/client/apt-spacewalk/debian/changelog b/client/apt-spacewalk/debian/changelog
new file mode 100644
index 0000000..8235644
--- /dev/null
+++ b/client/apt-spacewalk/debian/changelog
@@ -0,0 +1,6 @@
+apt-spacewalk (1.0.0-1) unstable; urgency=low
+
+ * Initial release Package was created.
+
+ -- Miroslav Suchý <miroslav(a)suchy.cz> Mon, 20 Sep 2010 10:38:44 +0200
+
diff --git a/client/apt-spacewalk/debian/compat b/client/apt-spacewalk/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/client/apt-spacewalk/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/client/apt-spacewalk/debian/control b/client/apt-spacewalk/debian/control
new file mode 100644
index 0000000..96b6a22
--- /dev/null
+++ b/client/apt-spacewalk/debian/control
@@ -0,0 +1,15 @@
+Source: apt-spacewalk
+Section: python
+Priority: extra
+Maintainer: Miroslav Suchý <miroslav(a)suchy.cz>
+Build-Depends: python, debhelper (>= 7.0.50~)
+Build-Depends-Indep: python-support (>= 0.8)
+Standards-Version: 3.9.1
+Homepage: https://fedorahosted.org/spacewalk
+
+Package: apt-spacewalk
+Architecture: all
+Depends: ${python:Depends}, ${misc:Depends}, rhn-client-tools
+Provides: ${python:Provides}
+Description: Spacewalk transport for apt-get.
+ This is used to connect to Spacewalk servers.
diff --git a/client/apt-spacewalk/debian/copyright b/client/apt-spacewalk/debian/copyright
new file mode 100644
index 0000000..98b52fb
--- /dev/null
+++ b/client/apt-spacewalk/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(a)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; either 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.
diff --git a/client/apt-spacewalk/debian/docs b/client/apt-spacewalk/debian/docs
new file mode 100644
index 0000000..a48c3b0
--- /dev/null
+++ b/client/apt-spacewalk/debian/docs
@@ -0,0 +1,2 @@
+ChangeLog
+copyright
diff --git a/client/apt-spacewalk/debian/pycompat b/client/apt-spacewalk/debian/pycompat
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/client/apt-spacewalk/debian/pycompat
@@ -0,0 +1 @@
+2
diff --git a/client/apt-spacewalk/debian/rules b/client/apt-spacewalk/debian/rules
new file mode 100755
index 0000000..e652103
--- /dev/null
+++ b/client/apt-spacewalk/debian/rules
@@ -0,0 +1,46 @@
+#!/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
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_installdirs -A $(CURDIR)/usr/lib/apt/methods/
+ dh_install
+
+build: build-stamp
+
+build-stamp:
+ dh_testdir
+ touch build-stamp
+
+clean:
+ rm -rf build
+
+binary: binary-indep binary-arch
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdebconf
+ dh_installdeb
+ dh_python
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+.PHONY: build clean binary-indep binary-arch binary install
+
diff --git a/client/apt-spacewalk/debian/source/format b/client/apt-spacewalk/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/client/apt-spacewalk/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/client/apt-spacewalk/debian/watch b/client/apt-spacewalk/debian/watch
new file mode 100644
index 0000000..c76ceee
--- /dev/null
+++ b/client/apt-spacewalk/debian/watch
@@ -0,0 +1,2 @@
+version=3
+https://fedorahosted.org/releases/s/p/spacewalk/rhnlib-(.*)\.tar\.gz
diff --git a/client/apt-spacewalk/spacewalk.py b/client/apt-spacewalk/spacewalk.py
new file mode 100644
index 0000000..989fed3
--- /dev/null
+++ b/client/apt-spacewalk/spacewalk.py
@@ -0,0 +1,262 @@
+#!/usr/bin/python -u
+#
+# Very early prototype of apt-transport-spacewalk
+#
+# Author: Simon Lukasik <xlukas08 [at] stud.fit.vutbr.cz>
+# Date: 2011-01-01
+# License: GPLv2
+#
+#
+
+import sys
+import hashlib
+
+import warnings
+warnings.filterwarnings("ignore", message="the md5 module is deprecated; use hashlib instead")
+sys.path.append("/usr/share/rhn/")
+
+from httplib import HTTPConnection, HTTPSConnection
+from up2date_client import config
+from up2date_client import rhnChannel
+from up2date_client import up2dateAuth
+from up2date_client import up2dateErrors
+
+
+
+class pkg_acquire_method:
+ """
+ This is slightly modified python variant of apt-pkg/acquire-method.
+ It is a skeleton class that implements only very basic of apt methods
+ functionality.
+ """
+ __eof = False
+
+ def __init__(self):
+ print "100 Capabilities\nVersion: 1.0\nSingle-Instance: true\n\n",
+
+ def __get_next_msg(self):
+ """
+ Apt uses for communication with its methods the text protocol similar
+ to http. This function parses the protocol messages from stdin.
+ """
+ if self.__eof:
+ return None
+ result = {};
+ line = sys.stdin.readline()
+ if not line:
+ self.__eof = True
+ return None
+ s = line.split(" ", 1)
+ result['_number'] = int(s[0])
+ result['_text'] = s[1].strip()
+
+ while not self.__eof:
+ line = sys.stdin.readline()
+ if not line:
+ self.__eof = True
+ return result
+ if line == '\n':
+ return result
+ s = line.split(":", 1)
+ result[s[0]] = s[1].strip()
+
+ def __dict2msg(self, msg):
+ """Convert dictionary to http like message"""
+ result = ""
+ for item in msg.keys():
+ if msg[item] != None:
+ result += item + ": " + msg[item] + "\n"
+ return result
+
+ def status(self, **kwargs):
+ print "102 Status\n%s\n" % self.__dict2msg(kwargs),
+
+ def uri_start(self, msg):
+ print "200 URI Start\n%s\n" % self.__dict2msg(msg),
+
+ def uri_done(self, msg):
+ print "201 URI Done\n%s\n" % self.__dict2msg(msg),
+
+ def uri_failure(self, msg):
+ print "400 URI Failure\n%s\n" % self.__dict2msg(msg),
+
+ def run(self):
+ """Loop through requests on stdin"""
+ while True:
+ msg = self.__get_next_msg()
+ if msg == None:
+ return 0
+ if msg['_number'] == 600:
+ # TODO: catch exceptions
+ self.fetch(msg)
+ else:
+ return 100
+
+
+
+
+def get_ssl_ca_cert(up2date_cfg):
+ if not (up2date_cfg.has_key('sslCACert') and up2date_cfg['sslCACert']):
+ raise BadSslCaCertConfig
+
+ ca_certs = up2date_cfg['sslCACert']
+ if type(ca_certs) == list:
+ return ca_certs
+
+
+
+class spacewalk_method(pkg_acquire_method):
+ """
+ Spacewalk acquire method
+ """
+ up2date_cfg = None
+ server_fqdn = None
+ login_info = None
+ current_url = None
+ svr_channels = None
+ http_headers = None
+ base_channel = None
+ conn = None
+
+ def fail(self, message = 'This system is not registered with the spacewalk server'):
+ self.uri_failure({'URI': self.uri,
+ 'Message': message})
+ return False
+
+
+ def __load_config(self):
+ if self.up2date_cfg == None:
+ self.up2date_cfg = config.initUp2dateConfig()
+ self.server_fqdn = self.up2date_cfg['serverURL'].split("/",3)[2]
+ # TODO: proxy settings
+
+
+ def __login(self):
+ if self.login_info == None:
+ self.status(URI = self.uri, Message = 'Logging into the spacewalk server')
+ self.login_info = up2dateAuth.getLoginInfo() # TODO: catch exceptions
+ if not self.login_info:
+ return self.fail()
+ self.status(URI = self.uri, Message = 'Logged in')
+ return True
+
+
+ def __init_channels(self):
+ if self.svr_channels == None:
+ self.svr_channels = rhnChannel.getChannelDetails() # TODO: catch exceptions
+ # TODO: some conduit magic here (or rather not)
+ # TODO CHANNELS
+ # sslcacert = get_ssl_ca_cert(self.up2date_cfg) # TODO: to remove or not to remove
+ for channel in self.svr_channels:
+ if channel['parent_channel'] == '':
+ self.base_channel = channel['label']
+ # TODO: Full RhnRepo
+
+
+ def __init_headers(self):
+ if self.http_headers == None:
+ rhn_needed_headers = ['X-RHN-Server-Id',
+ 'X-RHN-Auth-User-Id',
+ 'X-RHN-Auth',
+ 'X-RHN-Auth-Server-Time',
+ 'X-RHN-Auth-Expire-Offset']
+ self.http_headers = {};
+ for header in rhn_needed_headers:
+ if not self.login_info.has_key(header):
+ return self.fail("Missing required login information %s" % (header))
+ self.http_headers[header] = self.login_info[header]
+ self.http_headers['X-RHN-Transport-Capability'] = 'follow-redirects=3'
+ return True
+
+
+ def __make_conn(self):
+ # TODO: HTTPS + certificate verification
+ if self.conn == None:
+ self.conn = HTTPConnection(self.server_fqdn)
+
+
+ def __transform_document(self, document):
+ """Transform url given by apt to real spacewalk url"""
+ document = document.replace('dists/channels:/main/',
+ 'dists/channels:/' + self.base_channel + '/', 1)
+ document = document.replace('binary-i386', 'repodata', 1) # TODO
+ document = document.replace('dists/channels:/', '/XMLRPC/GET-REQ/', 1)
+ return document
+
+
+ def fetch(self, msg):
+ """
+ Fetch the content from spacewalk server to the file.
+
+ Acording to the apt protocol msg must contain: 'URI' and 'Filename'.
+ Other possible keys are: 'Last-Modified', 'Index-File', 'Fail-Ignore'
+ """
+ self.uri = msg['URI']
+ self.filename = msg['Filename']
+
+ self.__load_config()
+ server_fqdn, document = self.uri.split("/",3)[2:]
+ if server_fqdn != self.server_fqdn:
+ return self.fail()
+
+ if not self.__login():
+ return
+
+ self.__init_channels()
+
+ document = self.__transform_document(document)
+
+ if not self.__init_headers():
+ return
+
+ self.__make_conn()
+
+ self.conn.request("GET", "/" + document, headers = self.http_headers)
+ self.status(URI = self.uri, Message = 'Waiting for headers')
+
+ res = self.conn.getresponse()
+ if res.status != 200:
+ self.uri_failure({'URI': self.uri,
+ 'Message': str(res.status) + ' ' + res.reason,
+ 'FailReason': 'HttpError' + str(res.status)})
+ while True:
+ data = res.read(4096)
+ if not len(data): break
+ return
+
+ self.uri_start({'URI': self.uri,
+ 'Size': res.getheader('content-length'),
+ 'Last-Modified': res.getheader('last-modified')})
+
+ f = open(self.filename, "w")
+ hash_sha256 = hashlib.sha256()
+ hash_md5 = hashlib.md5()
+ while True:
+ data = res.read(4096)
+ if not len(data):
+ break
+ hash_sha256.update(data)
+ hash_md5.update(data)
+ f.write(data)
+ f.close()
+
+ self.uri_done({'URI': self.uri,
+ 'Filename': self.filename,
+ 'Size': res.getheader('content-length'),
+ 'Last-Modified': res.getheader('last-modified'),
+ 'MD5-Hash': hash_md5.hexdigest(),
+ 'MD5Sum-Hash': hash_md5.hexdigest(),
+ 'SHA256-Hash': hash_sha256.hexdigest()})
+
+
+ def __del__(self):
+ if self.conn:
+ self.conn.close()
+
+
+
+if __name__ == '__main__':
+ method = spacewalk_method()
+ ret = method.run()
+ sys.exit(ret)
+
13 years, 2 months
Changes to 'refs/tags/rhnpush-5.5.13-1'
by Miroslav Suchý
Tag 'rhnpush-5.5.13-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-01-28 21:54 +0000
Tagging package [rhnpush] version [5.5.13-1] in directory [client/tools/rhnpush/].
Changes since rhnlib-2.5.32-1:
Miroslav Suchý (1):
Automatic commit of package [rhnpush] release [5.5.13-1].
---
client/tools/rhnpush/rhnpush.spec | 9 ++++++++-
rel-eng/packages/rhnpush | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
---
13 years, 3 months
Changes to 'refs/tags/rhnlib-2.5.32-1'
by Miroslav Suchý
Tag 'rhnlib-2.5.32-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-01-28 21:53 +0000
Tagging package [rhnlib] version [2.5.32-1] in directory [client/rhel/rhnlib/].
Changes since rhncfg-5.9.47-1:
Miroslav Suchý (1):
Automatic commit of package [rhnlib] release [2.5.32-1].
---
client/rhel/rhnlib/rhnlib.spec | 7 ++++++-
rel-eng/packages/rhnlib | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
---
13 years, 3 months
Changes to 'refs/tags/rhncfg-5.9.47-1'
by Miroslav Suchý
Tag 'rhncfg-5.9.47-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-01-28 21:52 +0000
Tagging package [rhncfg] version [5.9.47-1] in directory [client/tools/rhncfg/].
Changes since osad-5.9.50-1:
Miroslav Suchý (1):
Automatic commit of package [rhncfg] release [5.9.47-1].
---
client/tools/rhncfg/rhncfg.spec | 6 +++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
---
13 years, 3 months