diff options
author | Aaron Bockover <abockover@novell.com> | 2009-12-28 23:45:48 +0300 |
---|---|---|
committer | Aaron Bockover <abockover@novell.com> | 2009-12-29 00:10:34 +0300 |
commit | 338d39749de9e4611ff4014e8c85124f453529ce (patch) | |
tree | 42a0d899efd83aeda90cc9db14e1521d3fab29e2 /packages | |
parent | 15eca63c2d01cd45cbace3df133e946a174f8523 (diff) |
[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.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/banshee.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/packages/banshee.py b/packages/banshee.py index f0d5eba..ee349ef 100644 --- a/packages/banshee.py +++ b/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 + ] } |