On installation, fix the prefix used in the script.
authorTilman Sauerbeck <tilman@code-monkey.de>
Mon, 27 Aug 2007 18:33:17 +0000 (20:33 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Mon, 27 Aug 2007 18:33:17 +0000 (20:33 +0200)
Rakefile
bin/embrace

index 9743143ccf6429ec3f1bda1681a13c701075e150..e06caf2ea4af69497c9cf7a356577ca336bb1901 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -15,6 +15,9 @@ task :install do
        FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
        FileUtils::Verbose.install("bin/embrace", ddir, :mode => 0755)
 
+       tmp = prefix.gsub("/", "\\/")
+       `sed -i -e 's/^PREFIX = nil$/PREFIX=\"#{tmp}\"/' #{ddir}/embrace`
+
        ddir = destdir + sitelibdir + "/#{PKG_NAME}"
 
        FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
index 7f59b72524a111acdb08b235a97b8f0f95740b9e..f6616ea70480a9fa8f8c07468c8c3516aa19367c 100755 (executable)
@@ -26,7 +26,8 @@ require "yaml"
 require "embrace/imap"
 
 PKG_NAME = "embrace"
-DATADIR = "/usr/local/share/#{PKG_NAME}/"
+PREFIX = nil
+DATADIR = "#{PREFIX || "/usr/local"}/share/#{PKG_NAME}/"
 
 module Embrace
        VERSION = "0.1.0"