Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support for Mac OS X #1

Merged
merged 1 commit into from

3 participants

@teamon

No description provided.

@tdtds tdtds merged commit fd1d595 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 22, 2011
  1. @teamon

    Support Mac OS X

    teamon authored
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.