def produce(epubfile, basedir, tmpdir)
      produce_write_common(basedir, tmpdir)

      File.open("#{tmpdir}/OEBPS/#{@producer.config['bookname']}.ncx", 'w') do |f|
        @producer.ncx(f, @producer.config['epubmaker']['ncxindent'])
      end
      if @producer.config['mytoc']
        File.open("#{tmpdir}/OEBPS/#{@producer.config['bookname']}-toc.#{@producer.config['htmlext']}", 'w') do |f|
          @producer.mytoc(f)
        end
      end

      @producer.call_hook(@producer.config['epubmaker']['hook_prepack'], tmpdir)
      expoter = EPUBMaker::ZipExporter.new(tmpdir, @producer.config)
      expoter.export_zip(epubfile)
    end
def produce(epubfile, basedir, tmpdir)
      produce_write_common(basedir, tmpdir)

      File.open("#{tmpdir}/OEBPS/#{@producer.config['bookname']}.ncx", 'w') do |f|
        @producer.ncx(f, @producer.config['epubmaker']['ncxindent'])
      end
      if @producer.config['mytoc']
        File.open("#{tmpdir}/OEBPS/#{@producer.config['bookname']}-toc.#{@producer.config['htmlext']}", 'w') do |f|
          @producer.mytoc(f)
        end
      end

      @producer.call_hook(@producer.config['epubmaker']['hook_prepack'], tmpdir)
      expoter = EPUBMaker::ZipExporter.new(tmpdir, @producer.config)
      expoter.export_zip(epubfile)
    end
Produce EPUB file +epubfile+.
 +basedir+ points the directory has contents.
 +tmpdir+ defines temporary directory.