From b5c6ec6bd2f63aac27978ff272a87d3131ab0a24 Mon Sep 17 00:00:00 2001
From: Dmitry Marakasov <amdmi3@FreeBSD.org>
Date: Wed, 17 Feb 2010 17:06:53 +0000
Subject: - Fix paths to icon and executable in .desktop file - Fix
 LOCALBASE/PREFIX misuse

PR:		143296
Submitted by:	Anatoly Borodin <anatoly.borodin@gmail.com>
Approved by:	Alexander Best <alexbestms@wwu.de> (maintainer)
Feature safe:	yes
---
 editors/py-room/Makefile                          |  4 ++--
 editors/py-room/files/patch-PyRoom-gui.py         |  2 +-
 editors/py-room/files/patch-PyRoom-preferences.py |  2 +-
 editors/py-room/files/patch-pyroom.desktop        | 14 ++++++++++++++
 editors/py-room/files/patch-setup.py              |  6 +++---
 5 files changed, 21 insertions(+), 7 deletions(-)
 create mode 100644 editors/py-room/files/patch-pyroom.desktop

(limited to 'editors/py-room')

diff --git a/editors/py-room/Makefile b/editors/py-room/Makefile
index 700175ace170..cb2593bdc8e3 100644
--- a/editors/py-room/Makefile
+++ b/editors/py-room/Makefile
@@ -27,8 +27,8 @@ PYDISTUTILS_PKGNAME=	PyRoom
 
 post-patch:
 	@${REINPLACE_CMD} -e \
-		's|%%LOCALBASE%%|${LOCALBASE}|g' \
+		's|%%PREFIX%%|${PREFIX}|g' \
 			${WRKSRC}/setup.py ${WRKSRC}/PyRoom/preferences.py \
-				${WRKSRC}/PyRoom/gui.py
+			${WRKSRC}/PyRoom/gui.py ${WRKSRC}/pyroom.desktop
 
 .include <bsd.port.mk>
diff --git a/editors/py-room/files/patch-PyRoom-gui.py b/editors/py-room/files/patch-PyRoom-gui.py
index 641a84a69041..fa252e31ec3f 100644
--- a/editors/py-room/files/patch-PyRoom-gui.py
+++ b/editors/py-room/files/patch-PyRoom-gui.py
@@ -5,7 +5,7 @@
          order of preference is homedir, global dir, source dir (if available)"""
          local_directory = os.path.join(data_home, 'pyroom', 'themes')
 -        global_directory = '/usr/share/pyroom/themes' # FIXME: platform
-+        global_directory = '%%LOCALBASE%%/share/pyroom/themes' # FIXME: platform
++        global_directory = '%%PREFIX%%/share/pyroom/themes' # FIXME: platform
          # in case PyRoom is run without installation
          fallback_directory = os.path.join(
              os.path.dirname(os.path.abspath(__file__)),
diff --git a/editors/py-room/files/patch-PyRoom-preferences.py b/editors/py-room/files/patch-PyRoom-preferences.py
index c7bb321cabed..d41da08f9f12 100644
--- a/editors/py-room/files/patch-PyRoom-preferences.py
+++ b/editors/py-room/files/patch-PyRoom-preferences.py
@@ -5,7 +5,7 @@
          self.data_dir = os.path.join(data_home, 'pyroom')
          self.themes_dir  = os.path.join(self.data_dir, 'themes')
 -        self.global_themes_dir = '/usr/share/pyroom/themes'
-+        self.global_themes_dir = '%%LOCALBASE%%/share/pyroom/themes'
++        self.global_themes_dir = '%%PREFIX%%/share/pyroom/themes'
          # if we are not using a global installation,
          # take the themes directly from sources
          if not os.path.isdir(self.global_themes_dir) :
diff --git a/editors/py-room/files/patch-pyroom.desktop b/editors/py-room/files/patch-pyroom.desktop
new file mode 100644
index 000000000000..9e4f13e56735
--- /dev/null
+++ b/editors/py-room/files/patch-pyroom.desktop
@@ -0,0 +1,14 @@
+--- pyroom.desktop	2009-04-06 10:32:56.000000000 +0200
++++ pyroom.desktop	2009-04-06 10:32:56.000000000 +0200
+@@ -1,9 +1,9 @@
+ [Desktop Entry]
+ Version=1.0
+ Name=PyRoom
+-Icon=/usr/share/pyroom/pyroom.png
++Icon=%%PREFIX%%/share/pyroom/pyroom.png
+ Comment=Distraction free full-screen text editor
+-Exec=/usr/bin/pyroom %F
++Exec=%%PREFIX%%/bin/pyroom %F
+ Terminal=false
+ Type=Application
+ Categories=GNOME;GTK;Office;
diff --git a/editors/py-room/files/patch-setup.py b/editors/py-room/files/patch-setup.py
index 93d4646bd2f0..c0b23047f440 100644
--- a/editors/py-room/files/patch-setup.py
+++ b/editors/py-room/files/patch-setup.py
@@ -7,9 +7,9 @@
 -    ('/usr/share/pyroom/themes', glob.glob('themes/*.theme')),
 -    ('/usr/share/pyroom', ['pyroom.png']),
 -    ('/usr/share/applications', ['pyroom.desktop'])
-+    ('%%LOCALBASE%%/share/pyroom/themes', glob.glob('themes/*.theme')),
-+    ('%%LOCALBASE%%/share/pyroom', ['pyroom.png']),
-+    ('%%LOCALBASE%%/share/applications', ['pyroom.desktop'])
++    ('%%PREFIX%%/share/pyroom/themes', glob.glob('themes/*.theme')),
++    ('%%PREFIX%%/share/pyroom', ['pyroom.png']),
++    ('%%PREFIX%%/share/applications', ['pyroom.desktop'])
      ],
    scripts=['pyroom',],
    cmdclass={'install_data': InstallData},
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0