[banshee] [build] use some internal functions as build phase steps



commit 440b1ea86481daaa4b50d8d54e5c01f4fd70ae2b
Author: Aaron Bockover <abockover novell com>
Date:   Mon Dec 28 15:45:48 2009 -0500

    [build] use some internal functions as build phase steps
    
    change_to_gitdir will locate the git directory properly
    and change to it instead of a crazy hard-coded cd ../../..
    and so on.
    
    overwrite_launcher_script will generate the OS X version
    of the launcher in the install prefix.

 build/bundle/packages/banshee.py |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/build/bundle/packages/banshee.py b/build/bundle/packages/banshee.py
index f0d5eba..ee349ef 100644
--- a/build/bundle/packages/banshee.py
+++ b/build/bundle/packages/banshee.py
@@ -8,12 +8,31 @@ configure_flags = [
 	'--enable-osx'
 ]
 
+def change_to_gitdir (*args):
+	last_pwd = ''
+	while not os.path.isdir ('.git'):
+		os.chdir ('..')
+		if last_pwd == os.getcwd ():
+			break
+		last_pwd = os.getcwd ()
+
+def overwrite_launcher_script (package):
+	install_bin_path = os.path.join (package['_prefix'], 'bin')
+	install_lib_path = os.path.join (package['_prefix'], 'lib')
+
+	fp = open (os.path.join (install_bin_path, 'banshee-1'), 'w')
+	fp.write ('#!/usr/bin/env bash\n')
+	fp.write ('export LD_LIBRARY_PATH="%s"\n' % install_lib_path)
+	fp.write ('%s %s' % (os.path.join (install_bin_path, 'mono'),
+		os.path.join (install_lib_path, 'banshee-1', 'Nereid.exe')))
+	fp.close ()
+
 package = {
 	'name':    'banshee-1',
 	'version': '1.5.2',
 	'sources': [],
 	'prep': [
-		'cd ../../../../..',
+		change_to_gitdir
 	],
 	'build': [
 		'cp configure.ac configure.ac.orig',
@@ -22,5 +41,8 @@ package = {
 		'mv configure.ac.orig configure.ac',
 		'%{__make}'
 	],
-	'install': []
+	'install': [
+		'%{__makeinstall}',
+		overwrite_launcher_script
+	]
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]