commit:     00117ca09fc8f3b3ee230e163c96b00eed3d5efd
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 16 10:17:13 2017 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Wed Aug 16 10:18:00 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00117ca0

dev-python/python-slip: version bump 0.6.1 → 0.6.5

Fix homepage, bug #617614.

Package-Manager: Portage-2.3.7, Repoman-2.3.3

 dev-python/python-slip/Manifest                    |  1 +
 .../files/python-slip-0.6.5-no-selinux.patch       | 93 ++++++++++++++++++++++
 dev-python/python-slip/python-slip-0.6.5.ebuild    | 44 ++++++++++
 3 files changed, 138 insertions(+)

diff --git a/dev-python/python-slip/Manifest b/dev-python/python-slip/Manifest
index c3454de6267..6947d9b2908 100644
--- a/dev-python/python-slip/Manifest
+++ b/dev-python/python-slip/Manifest
@@ -1,2 +1,3 @@
 DIST python-slip-0.6.0.tar.bz2 24930 SHA256 
f47361ec52b608309b83c71905e692b6b363eaf3b8a7afdeff866cd94463ad5c SHA512 
5787995521cce568d6569c15270bee63d9c42e85e21e652c9042c09d62d2c99bbee0b3efcaaa187e3f78d0d90a69ba4d9846b1182f0f366a6c75cb822b412164
 WHIRLPOOL 
30ede47ceafe7eef0c441504061cbfa1cddac80afb732030a8e27765f0a30b4b2b176061fe19d57001f39ed764b298f8bfc9d2e0d01b878ac0a0a7ae5c623a04
 DIST python-slip-0.6.1.tar.bz2 25000 SHA256 
bc897f1ab6f5b4989f85548799aaeb84fde67bbba18e40341bfe1d7885c2fd9a SHA512 
d7d79b8ee4468d3a3b5e2ff31dcc8af30f70591ba42f74af9787e5c883a137e85c39a6ffc7c36cd2383840aa4ca09cd1ca3d9e40fc4d266b37689a85f084a9ab
 WHIRLPOOL 
95595c7cc45bd403fa8ed1a5a36e32bbcce7aa621ff2d86503487174279e996e3839e7c3033a771274c944f46591f819a0ab1981e1301c4a13757f4787c2586b
+DIST python-slip-0.6.5.tar.bz2 25996 SHA256 
c726c086f0dd93a0ac7a0176f383a12af91b6657b78a301e3f5b25d9f8d4d10b SHA512 
84dfd4d74602e996797261aa4021fc1579a6aba554d2b3d497c0a7b8618366a9c0a6f12051b00c5653845dda923eedb58afdded37f2a1f31b5b0ce1a0532ccff
 WHIRLPOOL 
54f9d0663cbfada42ab1fee2372919dae7960326719bced4da2e31167a9a92894ec7a0e9ce439cc659fc7511c22d47fe25a6ccf83ffe84ff830b55ca153bdda0

diff --git a/dev-python/python-slip/files/python-slip-0.6.5-no-selinux.patch 
b/dev-python/python-slip/files/python-slip-0.6.5-no-selinux.patch
new file mode 100644
index 00000000000..b957625f7ec
--- /dev/null
+++ b/dev-python/python-slip/files/python-slip-0.6.5-no-selinux.patch
@@ -0,0 +1,93 @@
+From 66480a1ee0222d9944f58af945959183b23c26f6 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetrom...@gentoo.org>
+Date: Wed, 16 Aug 2017 10:49:43 +0200
+Subject: [PATCH] Disable selinux
+
+Signed-off-by: Gilles Dartiguelongue <e...@gentoo.org>
+---
+ setup.py.in        |  2 +-
+ slip/util/files.py | 27 ++++++++++++++-------------
+ 2 files changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/setup.py.in b/setup.py.in
+index 9e7644b..fb276a7 100644
+--- a/setup.py.in
++++ b/setup.py.in
+@@ -8,7 +8,7 @@ setup(name="slip", version="@VERSION@",
+         py_modules=["slip.__init__", "slip.util.__init__",
+             "slip.util.hookable", "slip.util.files",
+             "slip._wrappers.__init__", "slip._wrappers._glib"],
+-        requires=["selinux"])
++        requires=[])
+ 
+ setup(name="slip.dbus", version="@VERSION@",
+         py_modules=["slip.dbus.__init__", "slip.dbus.bus",
+diff --git a/slip/util/files.py b/slip/util/files.py
+index 98faa7c..a0a3768 100644
+--- a/slip/util/files.py
++++ b/slip/util/files.py
+@@ -33,6 +33,7 @@ __all__ = ["issamefile", "linkfile", "copyfile", 
"linkorcopyfile",
+ 
+ import os
+ import selinux
++# import selinux
+ import tempfile
+ import errno
+ import stat
+@@ -140,8 +141,8 @@ def copyfile(srcpath, dstpath, copy_mode_from_dst=True, 
run_restorecon=True):
+ 
+     os.rename(dsttmpfile.name, dstpath)
+ 
+-    if run_restorecon and selinux.is_selinux_enabled() > 0:
+-        selinux.restorecon(dstpath)
++#    if run_restorecon and selinux.is_selinux_enabled() > 0:
++#        selinux.restorecon(dstpath)
+ 
+ 
+ def linkorcopyfile(
+@@ -247,8 +248,8 @@ def overwrite_safely(
+ 
+     exists = os.path.exists(path)
+ 
+-    if preserve_context and selinux.is_selinux_enabled() <= 0:
+-        preserve_context = False
++#    if preserve_context and selinux.is_selinux_enabled() <= 0:
++#        preserve_context = False
+ 
+     try:
+         fd, tmpname = tempfile.mkstemp(prefix=base + os.path.extsep,
+@@ -263,10 +264,10 @@ def overwrite_safely(
+             if preserve_mode:
+                 os.fchmod(fd, stat.S_IMODE(s.st_mode))
+ 
+-            if preserve_context:
+-                ret, ctx = selinux.getfilecon(path)
+-                if ret < 0:
+-                    raise RuntimeError("getfilecon(%r) failed" % path)
++#            if preserve_context:
++#                ret, ctx = selinux.getfilecon(path)
++#                if ret < 0:
++#                    raise RuntimeError("getfilecon(%r) failed" % path)
+ 
+         f = os.fdopen(fd, "w")
+         fd = None
+@@ -278,11 +279,11 @@ def overwrite_safely(
+ 
+         os.rename(tmpname, path)
+ 
+-        if preserve_context:
+-            if exists:
+-                selinux.setfilecon(path, ctx)
+-            else:
+-                selinux.restorecon(path)
++#        if preserve_context:
++#            if exists:
++#                selinux.setfilecon(path, ctx)
++#            else:
++#                selinux.restorecon(path)
+ 
+     finally:
+         if f:
+-- 
+2.14.0
+

diff --git a/dev-python/python-slip/python-slip-0.6.5.ebuild 
b/dev-python/python-slip/python-slip-0.6.5.ebuild
new file mode 100644
index 00000000000..58abc1ead8d
--- /dev/null
+++ b/dev-python/python-slip/python-slip-0.6.5.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_REQ_USE="xml"
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1 eutils
+
+DESCRIPTION="Miscellaneous convenience, extension and workaround code for 
Python"
+HOMEPAGE="https://github.com/nphilipp/python-slip";
+SRC_URI="https://github.com/nphilipp/${PN}/releases/download/${P}/${P}.tar.bz2";
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="dbus selinux"
+
+RDEPEND="
+       dbus? (
+               dev-python/dbus-python[${PYTHON_USEDEP}]
+               dev-python/pygobject:3[${PYTHON_USEDEP}]
+               dev-python/six[${PYTHON_USEDEP}]
+               sys-auth/polkit )
+"
+DEPEND=""
+
+python_prepare_all() {
+       use selinux || epatch "${FILESDIR}"/${PN}-0.6.5-no-selinux.patch
+
+       # hard-disable slip.gtk since it did not get ported to gtk3+ and the 
only user
+       # of slip (firewalld) does not use it (upstream disables it for py3 
already)
+       sed \
+               -e 's|sys.version_info.major == 2|False|' \
+               -e "s:@VERSION@:${PV}:" setup.py.in > setup.py || die "sed 
failed"
+
+       if ! use dbus; then
+               sed -e '/name="slip.dbus"/ s/\(.*\)/if 0:\n    \1/' \
+                       -i setup.py || die "sed 2 failed"
+       fi
+
+       distutils-r1_python_prepare_all
+}

Reply via email to