Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 30 lines (25 sloc) 0.774 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
# install RMagick documentation

require 'ftools'
require 'find'

$docdir = nil

# Where to install the documentation
def docdir
    return $docdir if $docdir
    dir = get_config('doc-dir')+File::SEPARATOR
    dir.sub!(/\A$prefix/, get_config('prefix'))
    $docdir = dir
end

puts "\npost-install.rb: installing documentation..."

Find.find('doc') do |file|
    next if FileTest.directory? file
    target = file.sub(/^doc\//,docdir())
    unless FileTest.exists? File.dirname(target)
        File.makedirs(File.dirname(target), true)
        # Mark this directory as one we created so
        # that uninstall.rb knows it's okay to delete
        f = File.new("#{File.dirname(target)}/.rmagick", "w")
        f.close
    end
    File.install(file, target, 0644)
end
exit
Something went wrong with that request. Please try again.