[packages/galternatives] new, version 0.13.4

glen glen at pld-linux.org
Tue Feb 2 19:08:25 CET 2016


commit f43ae8ac162510a5ac2ff8fdda8c5c948560d12f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Feb 2 20:07:54 2016 +0200

    new, version 0.13.4
    
    based on fedora package, 57a8dbc

 galternatives-desktop.patch                       | 19 +++++
 galternatives-fedora.patch                        | 93 +++++++++++++++++++++
 galternatives.pamd                                |  8 ++
 galternatives.spec                                | 98 +++++++++++++++++++++++
 org.fedoraproject.pkexec.run-galternatives.policy | 20 +++++
 5 files changed, 238 insertions(+)
---
diff --git a/galternatives.spec b/galternatives.spec
new file mode 100644
index 0000000..ae1066a
--- /dev/null
+++ b/galternatives.spec
@@ -0,0 +1,98 @@
+Summary:	Alternatives Configurator
+Name:		galternatives
+Version:	0.13.4
+Release:	0.1
+License:	GPL+
+Group:		Applications/System
+#Source0:	http://ftp.debian.org/debian/pool/main/g/galternatives/%{name}_%{version}.tar.gz
+Source0:	http://pkgs.fedoraproject.org/repo/pkgs/galternatives/%{name}_%{version}.tar.gz/6148901a78623e85e3265a63588a2d23/galternatives_%{version}.tar.gz
+# Source0-md5:	6148901a78623e85e3265a63588a2d23
+Source1:	org.fedoraproject.pkexec.run-%{name}.policy
+Source2:	%{name}.pamd
+Patch0:		%{name}-desktop.patch
+Patch1:		%{name}-fedora.patch
+URL:		http://packages.qa.debian.org/g/galternatives.html
+BuildRequires:	desktop-file-utils
+BuildRequires:	gettext
+BuildRequires:	intltool
+BuildRequires:	python-devel
+BuildRequires:	python-pygtk-devel
+BuildRequires:	python-pygtk-glade
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	/usr/sbin/update-alternatives
+Requires:	python-pygtk-glade
+Requires:	python-pygtk-gtk
+Requires:	usermode
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Graphical setup tool for the alternatives system. A GUI to help the
+system administrator to choose what program should provide a given
+service
+
+%prep
+%setup -q
+%patch0 -p0
+%patch1 -p0
+
+# To silence rpmlint
+sed -i '/^#!\%{_prefix}\/bin\/python/ d' galternatives/*.py
+
+%build
+%py_build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%py_install
+%py_postclean
+
+desktop-file-install --delete-original	\
+	--dir $RPM_BUILD_ROOT%{_desktopdir}	\
+	--mode 0644					\
+	galternatives.desktop
+
+# polkit/pkexec wrapper
+install -d $RPM_BUILD_ROOT%{_sbindir}
+mv $RPM_BUILD_ROOT%{_bindir}/galternatives $RPM_BUILD_ROOT%{_sbindir}
+cat << 'EOF' > $RPM_BUILD_ROOT%{_bindir}/galternatives
+#!/bin/sh
+pkexec --disable-internal-agent %{_sbindir}/galternatives "$@"
+EOF
+chmod a+rx $RPM_BUILD_ROOT%{_bindir}/galternatives
+
+# polkit policy
+install -d $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions
+cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/polkit-1/actions
+
+install -d $RPM_BUILD_ROOT/etc/pam.d
+cp -p %{SOURCE2}  $RPM_BUILD_ROOT/etc/pam.d/galternatives
+
+cd translations
+LANGS=$(find -name '*.po' | cut -d '.' -f 2 | tr -d '/')
+for lang in ${LANGS}; do
+	echo ${lang}:
+	install -d $RPM_BUILD_ROOT%{_localedir}/${lang}/LC_MESSAGES
+	cp -p ${lang}.mo $RPM_BUILD_ROOT%{_localedir}/${lang}/LC_MESSAGES/galternatives.mo
+done
+cd -
+
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc debian/copyright
+%doc TODO debian/changelog
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/galternatives
+%attr(755,root,root) %{_bindir}/galternatives
+%attr(755,root,root) %{_sbindir}/galternatives
+%{_datadir}/polkit-1/actions/org.fedoraproject.pkexec.run-galternatives.policy
+%{_datadir}/galternatives
+%{py_sitescriptdir}/galternatives
+%{py_sitescriptdir}/galternatives*.egg-info
+%{_desktopdir}/galternatives.desktop
+%{_pixmapsdir}/galternatives.png
diff --git a/galternatives-desktop.patch b/galternatives-desktop.patch
new file mode 100644
index 0000000..ff0134c
--- /dev/null
+++ b/galternatives-desktop.patch
@@ -0,0 +1,19 @@
+--- galternatives.desktop.in	2004-06-14 18:04:11.000000000 -0400
++++ galternatives.desktop.in.new	2005-11-10 15:02:14.000000000 -0500
+@@ -1,13 +1,10 @@
+ [Desktop Entry]
+-Version=1.0
+ Encoding=UTF-8
+ _Name=Alternatives Configurator
+ _Comment=Configure the system default alternatives
+ Type=Application
+-Exec=/usr/sbin/galternatives
+-TryExec=
+-Icon=/usr/share/pixmaps/galternatives.png
+-X-GNOME-DocPath=
++Exec=/usr/bin/galternatives
++Icon=galternatives.png
+ Terminal=false
+-Categories=GTK;Application;System;
++Categories=GTK;System;
+ StartupNotify=true
diff --git a/galternatives-fedora.patch b/galternatives-fedora.patch
new file mode 100644
index 0000000..1d8eff1
--- /dev/null
+++ b/galternatives-fedora.patch
@@ -0,0 +1,93 @@
+--- setup.py	2004-06-14 18:04:11.000000000 -0400
++++ setup.py.new	2006-12-27 20:28:20.000000000 -0500
+@@ -16,14 +16,6 @@
+     os.chdir ('%s/translations' % (curdir))
+     os.system ('./update-translations.sh')
+ 
+-    pipe = os.popen ('./list-mos.sh')
+-    while True:
+-        line = pipe.readline ().strip ()
+-        if line == '':
+-            break
+-        data.append (('share/locale/%s/LC_MESSAGES' % (line), ['translations/%s/galternatives.mo' % (line)]))
+-    pipe.close ()
+-    print data
+     os.chdir (curdir)
+ 
+ if __name__ == '__main__' :
+--- galternatives/main.py	2005-08-17 21:21:04.000000000 -0400
++++ galternatives/main.py.new	2006-12-27 22:30:19.000000000 -0500
+@@ -1,8 +1,11 @@
+ #!/usr/bin/python
+ import pygtk
+ pygtk.require ('2.0')
+-import gtk, gobject
+-from gtk import glade
++try:
++   import gtk, gobject
++   from gtk import glade
++except RuntimeError:
++   pass
+ 
+ from common import PACKAGE
+ import sys, os, gettext
+--- galternatives/alternative.py	2004-11-21 23:02:33.000000000 -0500
++++ galternatives/alternative.py.new	2005-11-10 01:00:25.000000000 -0500
+@@ -64,7 +64,7 @@
+             pass
+ 
+         # now get the real information!
+-        altfile = open ('/var/lib/dpkg/alternatives/%s' % (unixname))
++        altfile = open ('/var/lib/alternatives/%s' % (unixname))
+ 
+         # parsing file
+         self.option_status = altfile.readline ().strip ()
+@@ -99,7 +99,18 @@
+ 
+             odict = {}
+             odict['path'] = line
+-            odict['priority'] = altfile.readline ().strip ()
++
++        # Here is an altercation to the upstream code to cater for the
++        # Redhat specific --initscript option
++            line = altfile.readline ().strip ()
++            ls = line.split()
++            if len(ls) == 2:
++               odict['priority'] = ls[0]
++               odict['service'] = ls[1]
++            else:
++               odict['priority'] = line
++               odict['service'] = ''
++
+             print_debug (odict)
+             optslaves = []
+             for count in range(len (self.slaves)):
+--- galternatives/main.py	2005-08-17 21:21:04.000000000 -0400
++++ galternatives/main.py.new	2005-11-10 01:01:12.000000000 -0500
+@@ -282,8 +282,16 @@
+         alt = self.alternative
+         unixname = alt.get_unixname ()
+         option = self.options_model.get_value (iter, self.OPTIONS)
++        # Here is an altercation to the upstream code to cater for the
++        # Redhat specific --initscript option
++        for opt in alt.get_options ():
++            inits = opt['service']
+ 
+-        result = os.system ('/usr/sbin/update-alternatives --set %s %s  > /dev/null 2>&1' % (unixname, option))
++        if inits == '':
++            result = os.system ('/usr/sbin/update-alternatives --set %s %s  > /dev/null 2>&1' % (unixname, option))
++        else:
++            result = os.system ('/usr/sbin/update-alternatives --set %s %s  > /dev/null 2>&1' % (unixname, option))
++            result2 = os.system ('/sbin/chkconfig %s on > /dev/null 2>&1' % (inits))
+ 
+         print_debug ('/usr/sbin/update-alternatives --set %s %s > /dev/null 2>&1' % (unixname, option))
+         print_debug ('Result: %d' % (result))
+@@ -347,7 +353,7 @@
+                                      text=self.SLAVEPATH)
+         self.slaves_tv.append_column (column)
+ 
+-    def update_alternatives (self, directory='/var/lib/dpkg/alternatives/'):
++    def update_alternatives (self, directory='/var/lib/alternatives/'):
+         self.alternatives_model.clear ()
+         alternatives = os.listdir (directory)
+         alternatives.sort ()
diff --git a/galternatives.pamd b/galternatives.pamd
new file mode 100644
index 0000000..f8a817b
--- /dev/null
+++ b/galternatives.pamd
@@ -0,0 +1,8 @@
+#%PAM-1.0
+auth	sufficient	pam_rootok.so
+auth	sufficient	pam_timestamp.so
+auth	include		system-auth
+session	required	pam_permit.so
+session	optional	pam_xauth.so
+session	optional	pam_timestamp.so
+account	required	pam_permit.so
diff --git a/org.fedoraproject.pkexec.run-galternatives.policy b/org.fedoraproject.pkexec.run-galternatives.policy
new file mode 100644
index 0000000..7c4238f
--- /dev/null
+++ b/org.fedoraproject.pkexec.run-galternatives.policy
@@ -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>
+
+  <action id="org.fedoraproject.pkexec.run-galternatives">
+    <description>Run the galternatives program</description>
+    <message>Authentication is required to run galternatives</message>
+    <icon_name>galternatives</icon_name>
+    <defaults>
+      <allow_any>auth_admin</allow_any>
+      <allow_inactive>auth_admin</allow_inactive>
+      <allow_active>auth_admin</allow_active>
+    </defaults>
+    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/galternatives</annotate>
+    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+  </action>
+
+</policyconfig>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/galternatives.git/commitdiff/f43ae8ac162510a5ac2ff8fdda8c5c948560d12f



More information about the pld-cvs-commit mailing list