#!/usr/bin/ruby # # Ruby script to build the P4Ruby distribution. # require "ftools" # # Relative path to P4Ruby relnotes. We need to copy them over when we're # building the distribution # RELNOTES_PATH = "../p4-doc/user/p4rubynotes.txt" # # Extract the P4Ruby version # def get_version v = nil p = nil n = nil File.open( "Version" ) do |f| f.each do |line| if ( line =~ /^RELEASE\s*=\s*(\d+) (\d+) ?(.*) ;/ ) v = "#{$1}.#{$2}" n = $3 elsif ( line =~ /^PATCHLEVEL\s*=\s*(\d+)/ ) p = $1 end end end if ( ! v ) raise( RuntimeError, "Can't figure out the version of P4Ruby!" ) end v += ".#{p}" if p v += ".#{n}" if n return v end # Copy a file into a directory - creating the target directories as # required # def filecopy( srcpath, topdir ) dstpath = topdir + "/" + srcpath dstdir = File.dirname( dstpath ) File.makedirs( dstdir ) File.copy( srcpath, dstpath ) end # # Remove a directory recursively. # def cleanup( path ) if File.directory?( path ) Dir.foreach( path ) do |ent| next if ent == '.' or ent == '..' p = path + '/' + ent cleanup( p ) end Dir.rmdir( path ) else File.safe_unlink( path ) end end # # Populate the distribution directory # def populate( build_dir ) Dir.mkdir( build_dir ) or raise( RuntimeError, "Can't create #{build_dir}" ) # # Copy the release notes into 'RELNOTES.txt'. This is ugly, but we need # a way to include the release notes in the distribution, but still store # them in the standard place # File.copy( RELNOTES_PATH, "RELNOTES.txt" ) mfest = File.open( "MANIFEST" ) files = mfest.readlines() mfest.close files.each do |file| file.sub!( /\r?\n/, "" ) filecopy( file, build_dir ) end end # # Build the tarball # def build_tarball( tarball, build_dir ) system( "tar -cvf #{tarball} #{build_dir}" ) system( "gzip -vf #{tarball}" ) end version = get_version() build_dir = "p4ruby-" + version tarball = 'p4ruby.tar' cleanup( build_dir ) populate( build_dir ) build_tarball( tarball, build_dir ) cleanup( build_dir ) cleanup( "RELNOTES.txt" )
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#9 | 14683 | tjuricek |
2014.2.0.pre1 Reorganization to support ruby Gem builds. The gem may not be immediately available since the rubygems.org credentials seem to be lost due to a hardware failure. In the meantime, this source should be testable against Linux and OS X. Precompiled builds will not be made available until Windows can be supported, which requires MinGW-w64 builds. (Note: this is a *fork* of MinGW, and not the same project, our MinGW builds are incompatible.) Once available it should be relatively straightfoward to use the rake-compile system to create crosscompiled builds for Windows, OS X, and Linux on the same build machine. Most tasks should be completed via rake in the future. There may be remnants of the old build system in here, no longer in use. Imported from Git Author: Tristan Juricek <tjuricek@perforce.com> 1415835954 -0800 Committer: Tristan Juricek <tjuricek@perforce.com> 1415836357 -0800 sha1: ad052c71a568ef12165e143a6866ad9ceffbb4a1 push-state: complete parent-branch: None@960958 parent-changes: 005052ae424bd69f426f7209e741ca1c8c3253c7=[960958] |
||
#8 | 14604 | jmistry |
Remove extra print statements Follow-on to change 333292, where I accidently left some debug statements in 'makedist'. This change removes them and should clean up the output. |
||
#7 | 14603 | jmistry |
Rewrite 'makedist' to support Ruby 1.9 When building P4Ruby with 'jam', 'makedist' will fail because it contains 1.8 specific modules and methods. This change separates this out, moving non-version specific methods to the module P4RubyCommon (makemodule.rb). Version specific stuff has been moved to two separate classes; P4Ruby18 (make1.8.rb) and P4Ruby19 (make1.9.rb). 'makedist' now checks RUBY_VERSION and creates an instance of the appropriate class depending on the version of Ruby used. |
||
#6 | 14588 | noahf | (get_version): Replace spaces in supplemental RELEASE parameters with `.'. | ||
#5 | 14587 | tony |
Standardize p4ruby tarball directory to: p4ruby-<major>.<minor>.<changelist>[.<tag>..] Where tag might be beta, main, etc. Build change not documented anywhere. |
||
#4 | 14567 | tony |
Pull latest changes from p09.2 branch back home to main Integration-only change |
||
#3 | 14529 | tony |
Pull 2007.3 p4-ruby changes back to main. Integration only change |
||
#2 | 14509 | tony |
Update MANIFEST and makedist to build tarball using new Version file. |
||
#1 | 14480 | tony |
Add P4Ruby 1.5944 to main as start-point for the first productized release of P4Ruby |