--- install.orig 2009-11-19 19:59:19 UTC +++ install @@ -182,55 +182,34 @@ sub installMenu { my $home = $ENV{HOME}; + my $prefix = @_; - if (-w '/usr/share/applications') - { - verbosePrint $lang{InstallCopyDesktop}, '/usr/share/applications'; - copy 'share/applications/gcstar.desktop', '/usr/share/applications'; - } - else - { - verbosePrint $lang{InstallCopyDesktop}, $home.'/.local/share/applications'; - copy 'share/applications/gcstar.desktop', $home.'/.local/share/applications'; - } - - copy 'share/gcstar/icons/gcstar_48x48.png', '/usr/share/pixmaps/gcstar.png' - if (-w '/usr/share/pixmaps'); - - copy 'share/gcstar/icons/gcstar_16x16.png', '/usr/share/icons/hicolor/16x16/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/16x16/apps'); - copy 'share/gcstar/icons/gcstar_22x22.png', '/usr/share/icons/hicolor/22x22/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/16x16/apps'); - copy 'share/gcstar/icons/gcstar_24x24.png', '/usr/share/icons/hicolor/24x24/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/24x24/apps'); - copy 'share/gcstar/icons/gcstar_32x32.png', '/usr/share/icons/hicolor/32x32/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/32x32/apps'); - copy 'share/gcstar/icons/gcstar_36x36.png', '/usr/share/icons/hicolor/36x36/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/36x36/apps'); - copy 'share/gcstar/icons/gcstar_48x48.png', '/usr/share/icons/hicolor/48x48/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/48x48/apps'); - copy 'share/gcstar/icons/gcstar_64x64.png', '/usr/share/icons/hicolor/64x64/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/64x64/apps'); - copy 'share/gcstar/icons/gcstar_72x72.png', '/usr/share/icons/hicolor/72x72/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/72x72/apps'); - copy 'share/gcstar/icons/gcstar_96x96.png', '/usr/share/icons/hicolor/96x96/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/96x96/apps'); - copy 'share/gcstar/icons/gcstar_128x128.png', '/usr/share/icons/hicolor/128x128/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/128x128/apps'); - copy 'share/gcstar/icons/gcstar_192x192.png', '/usr/share/icons/hicolor/192x192/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/192x192/apps'); - copy 'share/gcstar/icons/gcstar_256x256.png', '/usr/share/icons/hicolor/256x256/apps/gcstar.png' - if (-w '/usr/share/icons/hicolor/256x256/apps'); - copy 'share/gcstar/icons/gcstar_scalable.svg', '/usr/share/icons/hicolor/scalable/apps/gcstar.svg' - if (-w '/usr/share/icons/hicolor/scalable/apps'); - system 'gtk-update-icon-cache /usr/share/icons/hicolor'; - - copy 'share/applications/gcstar.xml', '/usr/share/mime/packages' - if (-w '/usr/share/mime/packages'); - - system 'update-desktop-database'; - system 'update-mime-database /usr/share/mime'; - + copy "share/gcstar/icons/gcstar_16x16.png", "$prefix/share/icons/hicolor/16x16/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/16x16/apps"); + copy "share/gcstar/icons/gcstar_22x22.png", "$prefix/share/icons/hicolor/22x22/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/16x16/apps"); + copy "share/gcstar/icons/gcstar_24x24.png", "$prefix/share/icons/hicolor/24x24/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/24x24/apps"); + copy "share/gcstar/icons/gcstar_32x32.png", "$prefix/share/icons/hicolor/32x32/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/32x32/apps"); + copy "share/gcstar/icons/gcstar_36x36.png", "$prefix/share/icons/hicolor/36x36/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/36x36/apps"); + copy "share/gcstar/icons/gcstar_48x48.png", "$prefix/share/icons/hicolor/48x48/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/48x48/apps"); + copy "share/gcstar/icons/gcstar_64x64.png", "$prefix/share/icons/hicolor/64x64/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/64x64/apps"); + copy "share/gcstar/icons/gcstar_72x72.png", "$prefix/share/icons/hicolor/72x72/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/72x72/apps"); + copy "share/gcstar/icons/gcstar_96x96.png", "$prefix/share/icons/hicolor/96x96/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/96x96/apps"); + copy "share/gcstar/icons/gcstar_128x128.png", "$prefix/share/icons/hicolor/128x128/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/128x128/apps"); + copy "share/gcstar/icons/gcstar_192x192.png", "$prefix/share/icons/hicolor/192x192/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/192x192/apps"); + copy "share/gcstar/icons/gcstar_256x256.png", "$prefix/share/icons/hicolor/256x256/apps/gcstar.png" + if (-w "$prefix/share/icons/hicolor/256x256/apps"); + copy "share/gcstar/icons/gcstar_scalable.svg", "$prefix/share/icons/hicolor/scalable/apps/gcstar.svg" + if (-w "$prefix/share/icons/hicolor/scalable/apps"); } @@ -343,7 +322,7 @@ if (-w $dir && !$dirError) { clean $dir unless ($withoutClean); - installMenu unless ($withoutMenu); + installMenu($dir) unless ($withoutMenu); doInstall $dir; $dir .= '/' if $dir !~ /\/$/; print "\n",$lang{InstallEnd},"\n",$lang{InstallNoError},"\n",$lang{InstallLaunch},$dir,"bin/",$binName,"\n"; @@ -455,7 +434,7 @@ clean($installDialog->{path}->get_text) if $installDialog->{clean}->get_active; - installMenu if $installDialog->{menu}->get_active; + installMenu($dir) if $installDialog->{menu}->get_active; doInstall($installDialog->{path}->get_text);