Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support Mac OS X

  • Loading branch information...
commit 5efa66a7db0d922bea7ab6f612d32c0dff12e267 1 parent 86b31c8
@teamon teamon authored
Showing with 16 additions and 8 deletions.
  1. +15 −7 ext/kindlegen/extconf.rb
  2. +1 −1  lib/kindlegen/version.rb
View
22 ext/kindlegen/extconf.rb
@@ -4,21 +4,30 @@
require 'rbconfig'
-File::open( 'Makefile', 'w' ) do |w|
+File::open('Makefile', 'w') do |w|
+ tarball = case RbConfig::CONFIG['host_os']
+ when /mac|darwin/i then "KindleGen_Mac_i386_v1.2.zip"
+ when /linux|cygwin/i then "kindlegen_linux_2.6_i386_v1.2.tar.gz"
+ else
+ STDERR.puts "Host OS unsupported!"
+ exit(1)
+ end
+
+ config = {"tarball" => tarball}
+
if Dir::pwd.include? 'gems'
- w.puts RbConfig.expand( DATA.read, { 'bindir' => '../../../../bin' } )
+ w.puts RbConfig.expand(DATA.read, config.merge('bindir' => '../../../../bin') )
else
- w.puts RbConfig.expand( DATA.read )
+ w.puts RbConfig.expand(DATA.read, config)
end
end
+
__END__
AMAZON = http://s3.amazonaws.com/kindlegen
TARGET = kindlegen
BINDIR = $(bindir)
-PLATFORM = linux_2.6_i386
-VERSION = 1.2
-TARBALL = $(TARGET)_$(PLATFORM)_v$(VERSION).tar.gz
+TARBALL = $(tarball)
CURL = curl
TARX = tar zxf
CP = cp
@@ -34,4 +43,3 @@
install: $(TARGET)
$(CP) $(TARGET) $(BINDIR)
-
View
2  lib/kindlegen/version.rb
@@ -1,3 +1,3 @@
module Kindlegen
- VERSION = "1.2.4"
+ VERSION = "1.2.5"
end
Please sign in to comment.
Something went wrong with that request. Please try again.