From: Mike Hall Date: 2002-02-07T02:22:07+09:00 Subject: Added a 'dist' rule to mkmf.rb Makefile Is there any thought of adding a 'dist' rule (to the Makefile generated by mkmf.rb + extconf.rb pair) to make a distribution archive for us? I put this into 'mkmf.rb' last night: ======= site-install: $(sitearchdir)$(target_prefix)/$(DLLIB) + dist: all + @$(RUBY) -r mktar -e 'mktar' $(archdir)$(target_prefix)/$(DLLIB): $(DLLIB) ======= And added this file (mktar.rb) to the Ruby library directory: ======= # # Make a tar.gz distribution file # Used from the Makefile generated by mkmf.rb # def mktar (rev = "0.1") # get the current version open("VERSION") {|f| rev = f.read.chomp} # prepend our directory to the MANIFEST files dir = Dir.pwd.split("/")[-1] files = [] open("MANIFEST") {|f| files = f.readlines} files.collect! {|f| dir + "/" + f.chomp} # stupid chomp # go up one level, make the tar file Dir.chdir ".." system( "tar", "czf", "#{dir}-#{rev}.tgz", *files ) end ================= It lets us 'make dist' to create a tar-gz file in the parent directory, using the files listed in the MANIFEST file. -- Mike Hall http://www.enteract.com/~mghall