[scanmem] Git fixes + improve pkexec

Igor Gnatenko ignatenkobrain at fedoraproject.org
Sun Dec 1 19:15:20 UTC 2013


commit f3e1ba1b0270743db64099d0876fee26f300f571
Author: Igor Gnatenko <i.gnatenko.brain at gmail.com>
Date:   Sun Dec 1 23:01:46 2013 +0400

    Git fixes + improve pkexec
    
    Signed-off-by: Igor Gnatenko <i.gnatenko.brain at gmail.com>

 .gitignore                                         |    1 +
 ...do-not-free-variables-allocated-by-alloca.patch |   43 ---------
 0001-gui-drop-deprecated-groups.patch              |   28 ++++++
 0001-gui-improve-pkexec.patch                      |   99 ++++++++++++++++++++
 scanmem.spec                                       |   49 ++++++-----
 sources                                            |    2 +-
 6 files changed, 156 insertions(+), 66 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4994e4e..8e6a765 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 scanmem-0.07.tar.gz
 /scanmem-0.13_.tar.gz
+/scanmem-0.14-3e65b13.tar.gz
diff --git a/0001-gui-drop-deprecated-groups.patch b/0001-gui-drop-deprecated-groups.patch
new file mode 100644
index 0000000..052d1eb
--- /dev/null
+++ b/0001-gui-drop-deprecated-groups.patch
@@ -0,0 +1,28 @@
+From 98ab96d0b1a405a8f04d3275fb2e7fbfba3bfd54 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <i.gnatenko.brain at gmail.com>
+Date: Sun, 1 Dec 2013 22:57:21 +0400
+Subject: [PATCH] gui: drop deprecated groups
+
+$ desktop-file-validate gui/GameConqueror.desktop
+gui/GameConqueror.desktop: hint: value item "GNOME" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: GTK
+gui/GameConqueror.desktop: warning: value "GNOME;Application;Game;" for key "Categories" in group "Desktop Entry" contains a deprecated value "Application"
+
+Signed-off-by: Igor Gnatenko <i.gnatenko.brain at gmail.com>
+---
+ gui/GameConqueror.desktop | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gui/GameConqueror.desktop b/gui/GameConqueror.desktop
+index c0b86af..cf00f26 100644
+--- a/gui/GameConqueror.desktop
++++ b/gui/GameConqueror.desktop
+@@ -6,5 +6,5 @@ Exec=gameconqueror
+ Terminal=false
+ Type=Application
+ Icon=GameConqueror
+-Categories=GNOME;Application;Game;
++Categories=Game;
+ StartupNotify=true
+-- 
+1.8.4.2
+
diff --git a/0001-gui-improve-pkexec.patch b/0001-gui-improve-pkexec.patch
new file mode 100644
index 0000000..9ec5174
--- /dev/null
+++ b/0001-gui-improve-pkexec.patch
@@ -0,0 +1,99 @@
+From dba03490e5c06907ac7e469d9a9b20d738a845f6 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <i.gnatenko.brain at gmail.com>
+Date: Sun, 1 Dec 2013 20:41:30 +0400
+Subject: [PATCH] gui: improve pkexec
+
+Signed-off-by: Igor Gnatenko <i.gnatenko.brain at gmail.com>
+---
+ configure.ac                                |  1 +
+ gui/Makefile.am                             |  7 +++++--
+ gui/gameconqueror.in                        | 12 +++++-------
+ gui/org.freedesktop.gameconqueror.policy.in | 20 ++++++++++++++++++++
+ 4 files changed, 31 insertions(+), 9 deletions(-)
+ create mode 100644 gui/org.freedesktop.gameconqueror.policy.in
+
+diff --git a/configure.ac b/configure.ac
+index b6790b9..515b4c8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -127,6 +127,7 @@ AC_ARG_ENABLE(gui, [AS_HELP_STRING([--enable-gui],
+                  gui/icons/Makefile
+                  gui/consts.py
+                  gui/gameconqueror
++                 gui/org.freedesktop.gameconqueror.policy
+                  ])],
+                  [enable_gui=false]
+                  )
+diff --git a/gui/Makefile.am b/gui/Makefile.am
+index 10d8169..c85d793 100644
+--- a/gui/Makefile.am
++++ b/gui/Makefile.am
+@@ -2,11 +2,14 @@ SUBDIRS = icons
+ 
+ dist_bin_SCRIPTS = gameconqueror
+ dist_gameconqueror_DATA = GameConqueror.xml GameConqueror_128x128.png GameConqueror_72x72.png
+-dist_gameconqueror_DATA += backend.py consts.py misc.py hexview.py GameConqueror.py
++dist_gameconqueror_DATA += backend.py consts.py misc.py hexview.py
++dist_gameconqueror_SCRIPTS = GameConqueror.py
+ dist_desktop_DATA = GameConqueror.desktop
++dist_polkit_DATA = org.freedesktop.gameconqueror.policy
+ dist_man_MANS = gameconqueror.1
+ dist_doc_DATA = README TODO COPYING
+-EXTRA_DIST = gameconqueror.in consts.py.in
++EXTRA_DIST = gameconqueror.in consts.py.in org.freedesktop.gameconqueror.policy.in
+ 
+ gameconquerordir=$(datadir)/gameconqueror
+ desktopdir=$(datadir)/applications
++polkitdir=$(datadir)/polkit-1/actions
+diff --git a/gui/gameconqueror.in b/gui/gameconqueror.in
+index 020bcad..929f32a 100644
+--- a/gui/gameconqueror.in
++++ b/gui/gameconqueror.in
+@@ -3,13 +3,11 @@
+ DATADIR=@PKGDATADIR@
+ 
+ if [[ "$(id -u)" != "0" ]]; then
+-    if [ -e "/usr/bin/gksu" ]; then
+-        exec gksu --sudo-mode --preserve-env --description "GameConqueror" "python -OO $DATADIR/GameConqueror.py"
+-    elif [ -e "/usr/bin/kdesu" ]; then
+-        exec kdesu -c "python -OO $DATADIR/GameConqueror.py"
+-    else
+-        exec beesu - "python -OO $DATADIR/GameConqueror.py"
++    if [ -e "/usr/bin/pkexec" ]; then
++        exec /usr/bin/pkexec $DATADIR/GameConqueror.py
+     fi
++    else
++        echo "install polkit!"
+ else
+-    exec python -OO "$DATADIR/GameConqueror.py"
++    exec $DATADIR/GameConqueror.py
+ fi
+diff --git a/gui/org.freedesktop.gameconqueror.policy.in b/gui/org.freedesktop.gameconqueror.policy.in
+new file mode 100644
+index 0000000..249d011
+--- /dev/null
++++ b/gui/org.freedesktop.gameconqueror.policy.in
+@@ -0,0 +1,20 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE policyconfig PUBLIC
++"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
++"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
++<policyconfig>
++ <vendor>Scanmem</vendor>
++ <vendor_url>http://code.google.com/p/scanmem/</vendor_url>
++ <action id="org.freedesktop.gameconqueror.pkexec.run">
++    <description>Run Game Conqueror</description>
++    <message>Authentication is required to run Game Conqueror</message>
++    <icon_name>GameConqueror</icon_name>
++    <defaults>
++     <allow_any>auth_admin_keep</allow_any>
++     <allow_inactive>auth_admin_keep</allow_inactive>
++     <allow_active>auth_admin_keep</allow_active>
++    </defaults>
++    <annotate key="org.freedesktop.policykit.exec.path">@PKGDATADIR@/GameConqueror.py</annotate>
++    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
++ </action>
++</policyconfig>
+-- 
+1.8.4.2
+
diff --git a/scanmem.spec b/scanmem.spec
index b821856..e5b1ff2 100644
--- a/scanmem.spec
+++ b/scanmem.spec
@@ -1,15 +1,23 @@
+%global commit      3e65b1366c841e62d1cc7453407244dcfea910e4
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
 Summary:  Simple interactive debugging utility
 Name:     scanmem
-Version:  0.13
-Release:  7%{?dist}
+Version:  0.14
+Release:  1.%{shortcommit}%{?dist}
 License:  GPLv2+
 #Source0:  https://scanmem.googlecode.com/files/scanmem-%{version}.tar.gz
 # 0.13 version has another filename
-Source0:  https://scanmem.googlecode.com/files/scanmem-0.13_.tar.gz
-# https://code.google.com/p/scanmem/issues/update.do?id=67
-Patch0:   0001-do-not-free-variables-allocated-by-alloca.patch
+#Source0:  https://scanmem.googlecode.com/files/scanmem-0.13_.tar.gz
+#Temporary use git version
+Source0:  https://github.com/coolwanglu/scanmem/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
+# https://github.com/coolwanglu/scanmem/pull/11
+Patch0:   0001-gui-improve-pkexec.patch
+Patch1:   0001-gui-drop-deprecated-groups.patch
+VCS:      https://github.com/coolwanglu/scanmem.git
 URL:      https://code.google.com/p/scanmem/
 
+BuildRequires: intltool libtool
 BuildRequires: readline-devel
 
 %description
@@ -21,17 +29,19 @@ engineering, or as a "pokefinder" to cheat at video games.
 %package -n gameconqueror
 Summary:  CheatEngline-alike interface for scanmem
 Requires: %{name}%{?_isa} = %{version}-%{release}
-Requires: beesu
+Requires: polkit
 Requires: pygtk2
-BuildRequires: desktop-file-utils
+BuildRequires: desktop-file-utils gettext
 
 %description -n gameconqueror
 GameConqueror aims to provide a CheatEngline-alike interface for scanmem, it's
 user-friendly and easy to use. GameConqueror is written in PyGTK.
 
 %prep
-%setup -q
-%patch0 -p1 -b .shell-crash
+%setup -q -n %{name}-%{commit}
+%patch0 -p1
+%patch1 -p1
+./autogen.sh
 
 %build
 %configure --enable-gui
@@ -44,18 +54,8 @@ make %{?_smp_mflags}
 %if 0%{?fedora} <= 19
   rm -rf %{buildroot}%{_docdir}/scanmem/
 %endif
-# https://code.google.com/p/scanmem/issues/detail?id=68
-for i in 72 128; do
-  mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
-  mv -f %{buildroot}%{_datadir}/pixmaps/GameConqueror_${i}x${i}.png \
-        %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/GameConqueror.png
-done
-desktop-file-install --set-key=Terminal --set-value=true \
-                     --remove-category=GNOME --remove-category=Application \
-                     --delete-original --set-icon=GameConqueror \
-                     --dir=%{buildroot}%{_datadir}/applications \
-                     %{buildroot}%{_datadir}/applications/GameConqueror.desktop
-
+rm -f %{buildroot}/%{_libdir}/*.{a,la}
+%find_lang GameConqueror
 
 %check
 make check
@@ -77,15 +77,20 @@ fi
 %doc ChangeLog README TODO COPYING
 %{_mandir}/man1/scanmem.1*
 %{_bindir}/scanmem
+%{_libdir}/*.so*
 
-%files -n gameconqueror
+%files -n gameconqueror -f GameConqueror.lang
 %{_datadir}/applications/GameConqueror.desktop
 %{_mandir}/man1/gameconqueror.1*
 %{_datadir}/gameconqueror/
 %{_datadir}/icons/hicolor/*/apps/GameConqueror.png
 %{_bindir}/gameconqueror
+%{_datadir}/polkit-1/actions/org.freedesktop.gameconqueror.policy
 
 %changelog
+* Sun Dec 01 2013 Igor Gnatenko <i.gnatenko.brain at gmail.com> - 0.14-1.3e65b13
+- Git fixes + improve pkexec
+
 * Wed Sep  4 2013 Igor Gnatenko <i.gnatenko.brain at gmail.com> - 0.13-7
 - Add patch as downstream for fix shell command crash
 
diff --git a/sources b/sources
index 3e7be36..5ce152a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c0e0e1de6b7d07325c077e23f01f2269  scanmem-0.13_.tar.gz
+ae0a72c0b8c3cb616276f7ddf6a48fa4  scanmem-0.14-3e65b13.tar.gz


More information about the scm-commits mailing list