Sha256: f3f1757d0cfd34d56f27d25a5bb98f880fc1ef39592f2bbccb56f363bc283cf6

Contents?: true

Size: 1020 Bytes

Versions: 2

Compression:

Stored size: 1020 Bytes

Contents

#
# making Makefile getting kindlegen from Amazon.com
#

require 'rbconfig'
File::open('Makefile', 'w') do |w|
  tarball = case RbConfig::CONFIG['host_os']
  when /mac|darwin/i
    unzip = 'unzip'
	 "KindleGen_Mac_i386_v2_9.zip"
  when /linux|cygwin/i
    unzip = 'tar zxf'
	 "kindlegen_linux_2.6_i386_v2_9.tar.gz"
  else
    STDERR.puts "Host OS unsupported!"
    exit(1)
  end

  config = RbConfig::CONFIG.merge({
    "unzip" => unzip,
    "tarball" => tarball
  })

  bindir = File.join(File.expand_path('../../..', __FILE__), "bin")
  w.puts RbConfig.expand(DATA.read, config.merge('bindir' => bindir))
end


__END__
AMAZON = http://s3.amazonaws.com/kindlegen
TARGET = kindlegen
BINDIR = $(bindir)
TARBALL = $(tarball)
CURL = curl
UNZIP = $(unzip)
CP = cp -a
MKDIR = mkdir -p

all:

$(TARGET): $(TARBALL)
	$(UNZIP) $(TARBALL)
	$(CP) */$(TARGET) $(TARGET)
	touch $(TARGET)
	chmod +x $(TARGET)

$(TARBALL):
	$(CURL) $(AMAZON)/$(TARBALL) -o $(TARBALL)

install: $(TARGET)
	$(MKDIR) $(BINDIR)
	$(CP) $(TARGET) $(BINDIR)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kindlegen-2.9.2 ext/kindlegen/extconf.rb
kindlegen-2.9.1 ext/kindlegen/extconf.rb