You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(3) |
Feb
(15) |
Mar
|
Apr
(9) |
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
(23) |
Oct
(25) |
Nov
(44) |
Dec
(9) |
2010 |
Jan
(14) |
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
(4) |
Sep
|
Oct
(10) |
Nov
(4) |
Dec
(22) |
2011 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
(7) |
May
(16) |
Jun
(4) |
Jul
(6) |
Aug
(3) |
Sep
|
Oct
(4) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(10) |
Apr
(24) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <jh...@us...> - 2009-11-14 22:08:20
|
Revision: 168 http://etch.svn.sourceforge.net/etch/?rev=168&view=rev Author: jheiss Date: 2009-11-14 22:08:11 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Tag 3.13 release Modified Paths: -------------- Rakefile tags/release-3.13/VERSION Added Paths: ----------- tags/release-3.13/ tags/release-3.13/client/Portfile tags/release-3.13/client/Rakefile Removed Paths: ------------- tags/release-3.13/client/Portfile tags/release-3.13/client/Rakefile Modified: Rakefile =================================================================== --- Rakefile 2009-11-14 22:06:33 UTC (rev 167) +++ Rakefile 2009-11-14 22:08:11 UTC (rev 168) @@ -1,4 +1,4 @@ -ETCHVER = '3.12' +ETCHVER = '3.13' TAGNAME = "release-#{ETCHVER}" TAGDIR = "tags/#{TAGNAME}" DIST = "etch-#{ETCHVER}" Modified: tags/release-3.13/VERSION =================================================================== --- trunk/VERSION 2009-11-14 19:20:11 UTC (rev 165) +++ tags/release-3.13/VERSION 2009-11-14 22:08:11 UTC (rev 168) @@ -1 +1 @@ -trunk +3.13 Deleted: tags/release-3.13/client/Portfile =================================================================== --- trunk/client/Portfile 2009-11-14 19:20:11 UTC (rev 165) +++ tags/release-3.13/client/Portfile 2009-11-14 22:08:11 UTC (rev 168) @@ -1,50 +0,0 @@ -# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -# $Id$ - -PortSystem 1.0 - -name etch -version %VER% -categories sysutils -maintainers aput.net:jheiss openmaintainer - -description Etch is a system configuration management tool. - -long_description Etch is a tool for managing the configuration of \ - Unix systems. Etch can manage text or binary \ - files, links and directories. The contents of \ - files can be supplied from static files or \ - generated on the fly by scripts or templates. \ - Permissions and ownership as well as any pre or \ - post commands to run when updating the file are \ - configured in simple XML files. - -homepage http://etch.sourceforge.net/ -platforms darwin - -master_sites sourceforge - -checksums md5 e462d44552ce628b2a2e121eb5825b62 \ - sha1 0cee484b291e89adaa46b1fccc763e14ccb41f90 \ - rmd160 5221532a9bba2b93274a8fd419dc4da6ec965e5e - -depends_build port:rb-rake -depends_run port:ruby \ - port:facter - -PortGroup ruby 1.0 - -# fetch -# extract -# patch -# configure -# build -# destroot - -use_configure no -build {} -test.run no -destroot.cmd cd client && rake -destroot.target install\[${destroot}\] -destroot.destdir "" - Copied: tags/release-3.13/client/Portfile (from rev 166, trunk/client/Portfile) =================================================================== --- tags/release-3.13/client/Portfile (rev 0) +++ tags/release-3.13/client/Portfile 2009-11-14 22:08:11 UTC (rev 168) @@ -0,0 +1,50 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 + +name etch +version %VER% +categories sysutils +maintainers aput.net:jheiss openmaintainer + +description Etch is a system configuration management tool. + +long_description Etch is a tool for managing the configuration of \ + Unix systems. Etch can manage text or binary \ + files, links and directories. The contents of \ + files can be supplied from static files or \ + generated on the fly by scripts or templates. \ + Permissions and ownership as well as any pre or \ + post commands to run when updating the file are \ + configured in simple XML files. + +homepage http://etch.sourceforge.net/ +platforms darwin + +master_sites sourceforge + +checksums md5 %MD5% \ + sha1 %SHA1% \ + rmd160 %RMD160% + +depends_build port:rb-rake +depends_run port:ruby \ + port:facter + +PortGroup ruby 1.0 + +# fetch +# extract +# patch +# configure +# build +# destroot + +use_configure no +build {} +test.run no +destroot.cmd cd client && rake +destroot.target install\[${destroot}\] +destroot.destdir "" + Deleted: tags/release-3.13/client/Rakefile =================================================================== --- trunk/client/Rakefile 2009-11-14 19:20:11 UTC (rev 165) +++ tags/release-3.13/client/Rakefile 2009-11-14 22:08:11 UTC (rev 168) @@ -1,439 +0,0 @@ -require 'rbconfig' -require 'tempfile' -require 'tmpdir' - -ETCHVER = IO.read('../VERSION').chomp - -BUILDROOT = '/var/tmp/etch-client-buildroot' - -# Copies the etch client files to destdir. Appropriate subdirectories will be -# composed unless specified via options. -# options: -# :bindir -# :libdir -# :etcdir -# :mandir -# :crondir (note no default here, crontab will not be copied if not specified) -# :ruby (#! lines in scripts will be changed to specified ruby) -# :installbase (base directory where files will end up) -def copy_etch_files(destdir, options={}) - bindir = nil - if options[:bindir] - bindir = File.join(destdir, options[:bindir]) - else - bindir = File.join(destdir, 'bin') - end - mkdir_p(bindir) - binapps = ['etch', 'etch_to_trunk', 'etch_cron_wrapper'] - binapps.each do |binapp| - if options[:ruby] - # Change #! line - File.open(File.join(bindir, binapp), 'w') do |newfile| - File.open(binapp) do |oldfile| - # Modify the first line - firstline = oldfile.gets - # Preserve any options. I.e. #!/usr/bin/ruby -w - shebang, shebangopts = firstline.split(' ', 2) - newfile.puts "#!#{options[:ruby]} #{shebangopts}" - # Then dump in the rest of the file - newfile.write(oldfile.read) - end - end - else - cp(binapp, bindir, :preserve => true) - end - chmod(0555, File.join(bindir, binapp)) - end - - libdir = nil - if options[:libdir] - libdir = File.join(destdir, options[:libdir]) - else - libdir = File.join(destdir, 'lib') - end - mkdir_p(libdir) - clientlibs = ['etchclient.rb'] - clientlibs.each do |clientlib| - cp(clientlib, libdir, :preserve => true) - end - serverlibs = ['etch.rb', 'versiontype.rb'] - serverlibs.each do |serverlib| - cp(File.join('..', 'server', 'lib', serverlib), libdir, :preserve => true) - end - clientlibs + serverlibs.each do |lib| - chmod(0444, File.join(libdir, lib)) - end - - mandir = nil - if options[:mandir] - mandir = File.join(destdir, options[:mandir]) - else - mandir = File.join(destdir, 'man') - end - man8dir = File.join(mandir, 'man8') - mkdir_p(man8dir) - cp('etch.8', man8dir, :preserve => true) - chmod(0444, File.join(man8dir, 'etch.8')) - - etcdir = nil - realetcdir = nil - if options[:etcdir] - realetcdir = options[:etcdir] - else - realetcdir = '/etc' - end - etcdir = File.join(destdir, realetcdir) - mkdir_p(etcdir) - etcfiles = ['ca.pem', 'dhparams'] - etcfiles.each do |etcfile| - cp(etcfile, etcdir, :preserve => true) - chmod(0644, File.join(etcdir, etcfile)) - end - - if options[:crondir] - crondir = File.join(destdir, options[:crondir]) - mkdir_p(crondir) - # Note file renamed to 'etch' here. Filename is different in the repo for - # clarity and to avoid conflict with the main executable. - cp('etch_cron', File.join(crondir, 'etch'), :preserve => true) - chmod(0444, File.join(crondir, 'etch')) - end - - # Substitute ETCHVER into etchclient.rb - # Substitute proper path into CONFIGDIR in etchclient.rb if appropriate - newetchclient = File.join(libdir, 'etchclient.rb.new') - etchclient = File.join(libdir, 'etchclient.rb') - File.open(newetchclient, 'w') do |newfile| - IO.foreach(etchclient) do |line| - if line =~ /^\s*VERSION/ - line.sub!(/=.*/, "= '#{ETCHVER}'") - end - if options[:installbase] && line =~ /^\s*CONFIGDIR/ - line.sub!(/=.*/, "= #{realetcdir}") - end - newfile.write(line) - end - end - mv(newetchclient, etchclient) - chmod(0444, etchclient) -end - -desc 'Build an etch client RPM on a Red Hat box' -task :redhat => [:redhatprep, :rpm] -desc 'Prep a Red Hat box for building an RPM' -task :redhatprep do - # Install the package which contains the rpmbuild command - system('rpm --quiet -q rpm-build || sudo yum install rpm-build') -end -desc 'Build an etch client RPM' -task :rpm do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - sbindir = File.join('usr', 'sbin') - libdir = File.join('usr', 'lib', 'ruby', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - crondir = File.join('etc', 'cron.d') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, :crondir => crondir, - :installbase => '/') - - # - # Prep spec file - # - - spec = Tempfile.new('etchrpm') - IO.foreach('etch-client.spec') do |line| - line.sub!('%VER%', ETCHVER) - spec.puts(line) - end - - # - # Build the package - # - - system("rpmbuild -bb --buildroot #{BUILDROOT} #{spec.path}") - - # - # Cleanup - # - - rm_rf(BUILDROOT) -end - -desc 'Build an etch client deb' -task :deb do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - mkdir_p(File.join(BUILDROOT, 'DEBIAN')) - File.open(File.join(BUILDROOT, 'DEBIAN', 'control'), 'w') do |control| - IO.foreach('control') do |line| - next if line =~ /^\s*#/ # Remove comments - line.sub!('%VER%', ETCHVER) - control.puts(line) - end - end - - sbindir = File.join('usr', 'sbin') - libdir = File.join('usr', 'local', 'lib', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - crondir = File.join('etc', 'cron.d') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, :crondir => crondir, - :installbase => '/') - - # - # Set permissions - # - - system("sudo chown -R 0:0 #{BUILDROOT}") - - # - # Build the package - # - - system("dpkg --build #{BUILDROOT} etch-client-#{ETCHVER}.deb") - - # - # Cleanup - # - - rm_rf(BUILDROOT) -end - -desc 'Build etch client SysV packages for Solaris' -task :solaris => [:sysvpkg, :sysvpkgsparc] -desc 'Build an etch client SysV package' -task :sysvpkg do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - sbindir = File.join('usr', 'sbin') - libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, - :ruby => '/opt/csw/bin/ruby', :installbase => '/') - - # - # Prep packaging files - # - - rm_rf('solbuild') - mkdir('solbuild') - File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| - IO.foreach('pkginfo') do |line| - line.sub!('%VER%', ETCHVER) - pkginfo.puts(line) - end - end - File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| - prototype.puts("i pkginfo=./pkginfo") - cp('depend', 'solbuild/depend') - prototype.puts("i depend=./depend") - cp('postinstall', 'solbuild/postinstall') - prototype.puts("i postinstall=./postinstall") - cp('postremove', 'solbuild/postremove') - prototype.puts("i postremove=./postremove") - # The tail +2 removes the first line, which is the base directory - # and doesn't need to be included in the package. - IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| - pipe.each do |line| - # Clean up the directory names - line.sub!(BUILDROOT, '') - # Don't force our permissions on directories - if line =~ /^d/ - line.sub!(/\S+ \S+ \S+$/, '? ? ?') - end - prototype.write(line) - end - end - end - - # - # Build the package - # - - system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") - system("pkgtrans solbuild ../YPCetch-#{ETCHVER}.pkg YPCetch") - - # - # Cleanup - # - - rm_rf('solbuild') - rm_rf(BUILDROOT) -end - -# On Sparc systems we're having problems with the CSW/Blastwave ruby core -# dumping when running etch. The Sunfreeware ruby seems to work. Sunfreeware -# doesn't play well with pkg-get, so we create a bit of a hybrid. We still -# express all the dependencies against CSW, and put our library file -# (etchclient.rb) into /opt/csw. We modify etch to use the Sunfreeware ruby -# in /usr/local/bin, but then tell it to also look in the /opt/csw directory -# for libraries. Users will have to manually install the Sunfreeware ruby -# package. -desc 'Build an etch client SysV package with hybrid CSW/Sunfreeware dependencies' -task :sysvpkgsparc do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - sbindir = File.join('usr', 'sbin') - libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, - :ruby => '/usr/local/bin/ruby', :installbase => '/') - - # Since we're using the Sunfreeware ruby but CSW libraries we need to add - # the CSW ruby library directory to the search path - newetch = File.join(BUILDROOT, 'usr', 'sbin', 'etch.new') - etch = File.join(BUILDROOT, 'usr', 'sbin', 'etch') - File.open(newetch, 'w') do |newfile| - IO.foreach(etch) do |line| - if line =~ /unshift.*__FILE__/ - line << "$:.unshift('/opt/csw/lib/ruby/site_ruby/1.8')\n" - end - newfile.write(line) - end - end - mv(newetch, etch) - chmod(0555, etch) - - # - # Prep packaging files - # - - rm_rf('solbuild') - mkdir('solbuild') - File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| - IO.foreach('pkginfo') do |line| - line.sub!('%VER%', ETCHVER) - pkginfo.puts(line) - end - end - File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| - prototype.puts("i pkginfo=./pkginfo") - cp('depend', 'solbuild/depend') - prototype.puts("i depend=./depend") - cp('postinstall', 'solbuild/postinstall') - prototype.puts("i postinstall=./postinstall") - cp('postremove', 'solbuild/postremove') - prototype.puts("i postremove=./postremove") - # The tail +2 removes the first line, which is the base directory - # and doesn't need to be included in the package. - IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| - pipe.each do |line| - # Clean up the directory names - line.sub!(BUILDROOT, '') - # Don't force our permissions on directories - if line =~ /^d/ - line.sub!(/\S+ \S+ \S+$/, '? ? ?') - end - prototype.write(line) - end - end - end - - # - # Build the package - # - - system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") - system("pkgtrans solbuild ../YPCetch-#{ETCHVER}-sparc.pkg YPCetch") - - # - # Cleanup - # - - rm_rf('solbuild') - rm_rf(BUILDROOT) -end - -# Install based on Config::CONFIG paths -task :install, :destdir do |t, args| - destdir = nil - if args.destdir - destdir = args.destdir - else - destdir = '/' - end - copy_etch_files(destdir, - :bindir => Config::CONFIG['sbindir'], - :libdir => Config::CONFIG['sitelibdir'], - :mandir => Config::CONFIG['mandir'], - :etcdir => Config::CONFIG['sysconfdir'], - # Can't find a better way to get the path to the current ruby - :ruby => File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']), - :installbase => '/') -end - -desc 'Prepare portfile for submission to MacPorts' -task :macport do - portfile = File.join(Dir.tmpdir, 'Portfile') - rm_f(portfile) - File.open(portfile, 'w') do |newfile| - IO.foreach('Portfile') do |line| - line.sub!('%VER%', ETCHVER) - newfile.puts(line) - end - end - puts "Portfile is #{portfile}" -end - -task :gem do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - copy_etch_files(BUILDROOT) - - # - # Prep gemspec - # - File.open(File.join(BUILDROOT, 'Rakefile'), 'w') do |gemspec| - IO.foreach('gemspec') do |line| - line.sub!('%VER%', ETCHVER) - gemspec.puts(line) - end - end - - # - # Build the package - # - - system("cd #{BUILDROOT} && rake gem") - gemglob = File.join(BUILDROOT, 'pkg', '*.gem') - gemfile = Dir.glob(gemglob).first - if gemfile - mv(gemfile, Dir.tmpdir) - puts "Gem is #{File.join(Dir.tmpdir, File.basename(gemfile))}" - else - warn "Gem file #{gemglob} not found!" - end - - # - # Cleanup - # - - rm_rf(BUILDROOT) -end - Copied: tags/release-3.13/client/Rakefile (from rev 166, trunk/client/Rakefile) =================================================================== --- tags/release-3.13/client/Rakefile (rev 0) +++ tags/release-3.13/client/Rakefile 2009-11-14 22:08:11 UTC (rev 168) @@ -0,0 +1,462 @@ +require 'rbconfig' +require 'tempfile' +require 'tmpdir' +require 'open-uri' + +ETCHVER = IO.read('../VERSION').chomp +TARBALLFILE = "etch-#{ETCHVER}.tar.gz" +TARBALL = File.expand_path(TARBALLFILE) + +BUILDROOT = '/var/tmp/etch-client-buildroot' + +# Copies the etch client files to destdir. Appropriate subdirectories will be +# composed unless specified via options. +# options: +# :bindir +# :libdir +# :etcdir +# :mandir +# :crondir (note no default here, crontab will not be copied if not specified) +# :ruby (#! lines in scripts will be changed to specified ruby) +# :installbase (base directory where files will end up) +def copy_etch_files(destdir, options={}) + bindir = nil + if options[:bindir] + bindir = File.join(destdir, options[:bindir]) + else + bindir = File.join(destdir, 'bin') + end + mkdir_p(bindir) + binapps = ['etch', 'etch_to_trunk', 'etch_cron_wrapper'] + binapps.each do |binapp| + if options[:ruby] + # Change #! line + File.open(File.join(bindir, binapp), 'w') do |newfile| + File.open(binapp) do |oldfile| + # Modify the first line + firstline = oldfile.gets + # Preserve any options. I.e. #!/usr/bin/ruby -w + shebang, shebangopts = firstline.split(' ', 2) + newfile.puts "#!#{options[:ruby]} #{shebangopts}" + # Then dump in the rest of the file + newfile.write(oldfile.read) + end + end + else + cp(binapp, bindir, :preserve => true) + end + chmod(0555, File.join(bindir, binapp)) + end + + libdir = nil + if options[:libdir] + libdir = File.join(destdir, options[:libdir]) + else + libdir = File.join(destdir, 'lib') + end + mkdir_p(libdir) + clientlibs = ['etchclient.rb'] + clientlibs.each do |clientlib| + cp(clientlib, libdir, :preserve => true) + end + serverlibs = ['etch.rb', 'versiontype.rb'] + serverlibs.each do |serverlib| + cp(File.join('..', 'server', 'lib', serverlib), libdir, :preserve => true) + end + clientlibs + serverlibs.each do |lib| + chmod(0444, File.join(libdir, lib)) + end + + mandir = nil + if options[:mandir] + mandir = File.join(destdir, options[:mandir]) + else + mandir = File.join(destdir, 'man') + end + man8dir = File.join(mandir, 'man8') + mkdir_p(man8dir) + cp('etch.8', man8dir, :preserve => true) + chmod(0444, File.join(man8dir, 'etch.8')) + + etcdir = nil + realetcdir = nil + if options[:etcdir] + realetcdir = options[:etcdir] + else + realetcdir = '/etc' + end + etcdir = File.join(destdir, realetcdir) + mkdir_p(etcdir) + etcfiles = ['ca.pem', 'dhparams'] + etcfiles.each do |etcfile| + cp(etcfile, etcdir, :preserve => true) + chmod(0644, File.join(etcdir, etcfile)) + end + + if options[:crondir] + crondir = File.join(destdir, options[:crondir]) + mkdir_p(crondir) + # Note file renamed to 'etch' here. Filename is different in the repo for + # clarity and to avoid conflict with the main executable. + cp('etch_cron', File.join(crondir, 'etch'), :preserve => true) + chmod(0444, File.join(crondir, 'etch')) + end + + # Substitute ETCHVER into etchclient.rb + # Substitute proper path into CONFIGDIR in etchclient.rb if appropriate + newetchclient = File.join(libdir, 'etchclient.rb.new') + etchclient = File.join(libdir, 'etchclient.rb') + File.open(newetchclient, 'w') do |newfile| + IO.foreach(etchclient) do |line| + if line =~ /^\s*VERSION/ + line.sub!(/=.*/, "= '#{ETCHVER}'") + end + if options[:installbase] && line =~ /^\s*CONFIGDIR/ + line.sub!(/=.*/, "= #{realetcdir}") + end + newfile.write(line) + end + end + mv(newetchclient, etchclient) + chmod(0444, etchclient) +end + +desc 'Build an etch client RPM on a Red Hat box' +task :redhat => [:redhatprep, :rpm] +desc 'Prep a Red Hat box for building an RPM' +task :redhatprep do + # Install the package which contains the rpmbuild command + system('rpm --quiet -q rpm-build || sudo yum install rpm-build') +end +desc 'Build an etch client RPM' +task :rpm do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('usr', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + crondir = File.join('etc', 'cron.d') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, :crondir => crondir, + :installbase => '/') + + # + # Prep spec file + # + + spec = Tempfile.new('etchrpm') + IO.foreach('etch-client.spec') do |line| + line.sub!('%VER%', ETCHVER) + spec.puts(line) + end + + # + # Build the package + # + + system("rpmbuild -bb --buildroot #{BUILDROOT} #{spec.path}") + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + +desc 'Build an etch client deb' +task :deb do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + mkdir_p(File.join(BUILDROOT, 'DEBIAN')) + File.open(File.join(BUILDROOT, 'DEBIAN', 'control'), 'w') do |control| + IO.foreach('control') do |line| + next if line =~ /^\s*#/ # Remove comments + line.sub!('%VER%', ETCHVER) + control.puts(line) + end + end + + sbindir = File.join('usr', 'sbin') + libdir = File.join('usr', 'local', 'lib', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + crondir = File.join('etc', 'cron.d') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, :crondir => crondir, + :installbase => '/') + + # + # Set permissions + # + + system("sudo chown -R 0:0 #{BUILDROOT}") + + # + # Build the package + # + + system("dpkg --build #{BUILDROOT} etch-client-#{ETCHVER}.deb") + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + +desc 'Build etch client SysV packages for Solaris' +task :solaris => [:sysvpkg, :sysvpkgsparc] +desc 'Build an etch client SysV package' +task :sysvpkg do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, + :ruby => '/opt/csw/bin/ruby', :installbase => '/') + + # + # Prep packaging files + # + + rm_rf('solbuild') + mkdir('solbuild') + File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| + IO.foreach('pkginfo') do |line| + line.sub!('%VER%', ETCHVER) + pkginfo.puts(line) + end + end + File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| + prototype.puts("i pkginfo=./pkginfo") + cp('depend', 'solbuild/depend') + prototype.puts("i depend=./depend") + cp('postinstall', 'solbuild/postinstall') + prototype.puts("i postinstall=./postinstall") + cp('postremove', 'solbuild/postremove') + prototype.puts("i postremove=./postremove") + # The tail +2 removes the first line, which is the base directory + # and doesn't need to be included in the package. + IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| + pipe.each do |line| + # Clean up the directory names + line.sub!(BUILDROOT, '') + # Don't force our permissions on directories + if line =~ /^d/ + line.sub!(/\S+ \S+ \S+$/, '? ? ?') + end + prototype.write(line) + end + end + end + + # + # Build the package + # + + system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") + system("pkgtrans solbuild ../YPCetch-#{ETCHVER}.pkg YPCetch") + + # + # Cleanup + # + + rm_rf('solbuild') + rm_rf(BUILDROOT) +end + +# On Sparc systems we're having problems with the CSW/Blastwave ruby core +# dumping when running etch. The Sunfreeware ruby seems to work. Sunfreeware +# doesn't play well with pkg-get, so we create a bit of a hybrid. We still +# express all the dependencies against CSW, and put our library file +# (etchclient.rb) into /opt/csw. We modify etch to use the Sunfreeware ruby +# in /usr/local/bin, but then tell it to also look in the /opt/csw directory +# for libraries. Users will have to manually install the Sunfreeware ruby +# package. +desc 'Build an etch client SysV package with hybrid CSW/Sunfreeware dependencies' +task :sysvpkgsparc do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, + :ruby => '/usr/local/bin/ruby', :installbase => '/') + + # Since we're using the Sunfreeware ruby but CSW libraries we need to add + # the CSW ruby library directory to the search path + newetch = File.join(BUILDROOT, 'usr', 'sbin', 'etch.new') + etch = File.join(BUILDROOT, 'usr', 'sbin', 'etch') + File.open(newetch, 'w') do |newfile| + IO.foreach(etch) do |line| + if line =~ /unshift.*__FILE__/ + line << "$:.unshift('/opt/csw/lib/ruby/site_ruby/1.8')\n" + end + newfile.write(line) + end + end + mv(newetch, etch) + chmod(0555, etch) + + # + # Prep packaging files + # + + rm_rf('solbuild') + mkdir('solbuild') + File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| + IO.foreach('pkginfo') do |line| + line.sub!('%VER%', ETCHVER) + pkginfo.puts(line) + end + end + File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| + prototype.puts("i pkginfo=./pkginfo") + cp('depend', 'solbuild/depend') + prototype.puts("i depend=./depend") + cp('postinstall', 'solbuild/postinstall') + prototype.puts("i postinstall=./postinstall") + cp('postremove', 'solbuild/postremove') + prototype.puts("i postremove=./postremove") + # The tail +2 removes the first line, which is the base directory + # and doesn't need to be included in the package. + IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| + pipe.each do |line| + # Clean up the directory names + line.sub!(BUILDROOT, '') + # Don't force our permissions on directories + if line =~ /^d/ + line.sub!(/\S+ \S+ \S+$/, '? ? ?') + end + prototype.write(line) + end + end + end + + # + # Build the package + # + + system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") + system("pkgtrans solbuild ../YPCetch-#{ETCHVER}-sparc.pkg YPCetch") + + # + # Cleanup + # + + rm_rf('solbuild') + rm_rf(BUILDROOT) +end + +# Install based on Config::CONFIG paths +task :install, :destdir do |t, args| + destdir = nil + if args.destdir + destdir = args.destdir + else + destdir = '/' + end + copy_etch_files(destdir, + :bindir => Config::CONFIG['sbindir'], + :libdir => Config::CONFIG['sitelibdir'], + :mandir => Config::CONFIG['mandir'], + :etcdir => Config::CONFIG['sysconfdir'], + # Can't find a better way to get the path to the current ruby + :ruby => File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']), + :installbase => '/') +end + +desc 'Fetch tarball from sourceforge' +task :fetch do + if !File.exist?(TARBALL) + url = "http://downloads.sourceforge.net/project/etch/etch/#{ETCHVER}/#{TARBALLFILE}?use_mirror=autoselect" + puts "Fetching tarball from #{url}" + open(url) do |df| + open(TARBALL, 'w') do |lf| + lf.write(df.read) + end + end + end +end + +desc 'Prepare portfile for submission to MacPorts' +task :macport => :fetch do + md5 = `openssl md5 #{TARBALL}`.chomp.split.last + sha1 = `openssl sha1 #{TARBALL}`.chomp.split.last + rmd160 = `openssl rmd160 #{TARBALL}`.chomp.split.last + + portfile = File.join(Dir.tmpdir, 'Portfile') + rm_f(portfile) + File.open(portfile, 'w') do |newfile| + IO.foreach('Portfile') do |line| + line.sub!('%VER%', ETCHVER) + line.sub!('%MD5%', md5) + line.sub!('%SHA1%', sha1) + line.sub!('%RMD160%', rmd160) + newfile.puts(line) + end + end + puts "Portfile is #{portfile}" +end + +task :gem do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + copy_etch_files(BUILDROOT) + + # + # Prep gemspec + # + File.open(File.join(BUILDROOT, 'Rakefile'), 'w') do |gemspec| + IO.foreach('gemspec') do |line| + line.sub!('%VER%', ETCHVER) + gemspec.puts(line) + end + end + + # + # Build the package + # + + system("cd #{BUILDROOT} && rake gem") + gemglob = File.join(BUILDROOT, 'pkg', '*.gem') + gemfile = Dir.glob(gemglob).first + if gemfile + mv(gemfile, Dir.tmpdir) + puts "Gem is #{File.join(Dir.tmpdir, File.basename(gemfile))}" + else + warn "Gem file #{gemglob} not found!" + end + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 22:06:41
|
Revision: 167 http://etch.svn.sourceforge.net/etch/?rev=167&view=rev Author: jheiss Date: 2009-11-14 22:06:33 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Include VERSION file in distribution. Modified Paths: -------------- Rakefile Modified: Rakefile =================================================================== --- Rakefile 2009-11-14 21:42:41 UTC (rev 166) +++ Rakefile 2009-11-14 22:06:33 UTC (rev 167) @@ -18,7 +18,7 @@ task :dist do rm_rf(DIST) mkdir(DIST) - system("(cd #{TAGDIR} && find client server test etchserver-* README | grep -v '\.svn' | cpio -pdum ../../#{DIST})") + system("(cd #{TAGDIR} && find client server test etchserver-* README VERSION | grep -v '\.svn' | cpio -pdum ../../#{DIST})") system("tar czf #{DIST}.tar.gz #{DIST}") rm_rf(DIST) system("openssl md5 #{DIST}.tar.gz > #{DIST}.tar.gz.md5") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 21:42:50
|
Revision: 166 http://etch.svn.sourceforge.net/etch/?rev=166&view=rev Author: jheiss Date: 2009-11-14 21:42:41 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Update macport task to set checksums in portfile. Modified Paths: -------------- trunk/client/Portfile trunk/client/Rakefile Modified: trunk/client/Portfile =================================================================== --- trunk/client/Portfile 2009-11-14 19:20:11 UTC (rev 165) +++ trunk/client/Portfile 2009-11-14 21:42:41 UTC (rev 166) @@ -24,9 +24,9 @@ master_sites sourceforge -checksums md5 e462d44552ce628b2a2e121eb5825b62 \ - sha1 0cee484b291e89adaa46b1fccc763e14ccb41f90 \ - rmd160 5221532a9bba2b93274a8fd419dc4da6ec965e5e +checksums md5 %MD5% \ + sha1 %SHA1% \ + rmd160 %RMD160% depends_build port:rb-rake depends_run port:ruby \ Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2009-11-14 19:20:11 UTC (rev 165) +++ trunk/client/Rakefile 2009-11-14 21:42:41 UTC (rev 166) @@ -1,8 +1,11 @@ require 'rbconfig' require 'tempfile' require 'tmpdir' +require 'open-uri' ETCHVER = IO.read('../VERSION').chomp +TARBALLFILE = "etch-#{ETCHVER}.tar.gz" +TARBALL = File.expand_path(TARBALLFILE) BUILDROOT = '/var/tmp/etch-client-buildroot' @@ -385,13 +388,33 @@ :installbase => '/') end +desc 'Fetch tarball from sourceforge' +task :fetch do + if !File.exist?(TARBALL) + url = "http://downloads.sourceforge.net/project/etch/etch/#{ETCHVER}/#{TARBALLFILE}?use_mirror=autoselect" + puts "Fetching tarball from #{url}" + open(url) do |df| + open(TARBALL, 'w') do |lf| + lf.write(df.read) + end + end + end +end + desc 'Prepare portfile for submission to MacPorts' -task :macport do +task :macport => :fetch do + md5 = `openssl md5 #{TARBALL}`.chomp.split.last + sha1 = `openssl sha1 #{TARBALL}`.chomp.split.last + rmd160 = `openssl rmd160 #{TARBALL}`.chomp.split.last + portfile = File.join(Dir.tmpdir, 'Portfile') rm_f(portfile) File.open(portfile, 'w') do |newfile| IO.foreach('Portfile') do |line| line.sub!('%VER%', ETCHVER) + line.sub!('%MD5%', md5) + line.sub!('%SHA1%', sha1) + line.sub!('%RMD160%', rmd160) newfile.puts(line) end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 19:20:23
|
Revision: 165 http://etch.svn.sourceforge.net/etch/?rev=165&view=rev Author: jheiss Date: 2009-11-14 19:20:11 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Add rubyforge_project now that we have one (just for getting the gem into the main distribution). Modified Paths: -------------- trunk/client/gemspec Modified: trunk/client/gemspec =================================================================== --- trunk/client/gemspec 2009-11-14 18:19:58 UTC (rev 164) +++ trunk/client/gemspec 2009-11-14 19:20:11 UTC (rev 165) @@ -7,6 +7,7 @@ s.author = 'Jason Heiss' s.email = 'etc...@li...' s.homepage = 'http://etch.sourceforge.net' + s.rubyforge_project = 'etchsyscm' s.platform = Gem::Platform::RUBY s.required_ruby_version = '>=1.8' s.files = Dir['**/**'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 18:20:06
|
Revision: 164 http://etch.svn.sourceforge.net/etch/?rev=164&view=rev Author: jheiss Date: 2009-11-14 18:19:58 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Re-tagging 3.12 release Modified Paths: -------------- tags/release-3.12/VERSION Added Paths: ----------- tags/release-3.12/ tags/release-3.12/client/Portfile tags/release-3.12/client/Rakefile Removed Paths: ------------- tags/release-3.12/client/Portfile tags/release-3.12/client/Rakefile Modified: tags/release-3.12/VERSION =================================================================== --- trunk/VERSION 2009-11-14 17:58:54 UTC (rev 159) +++ tags/release-3.12/VERSION 2009-11-14 18:19:58 UTC (rev 164) @@ -1 +1 @@ -trunk +3.12 Deleted: tags/release-3.12/client/Portfile =================================================================== --- trunk/client/Portfile 2009-11-14 17:58:54 UTC (rev 159) +++ tags/release-3.12/client/Portfile 2009-11-14 18:19:58 UTC (rev 164) @@ -1,50 +0,0 @@ -# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -# $Id$ - -PortSystem 1.0 - -name etch -version 3.11 -categories sysutils -maintainers aput.net:jheiss openmaintainer - -description Etch is a system configuration management tool. - -long_description Etch is a tool for managing the configuration of \ - Unix systems. Etch can manage text or binary \ - files, links and directories. The contents of \ - files can be supplied from static files or \ - generated on the fly by scripts or templates. \ - Permissions and ownership as well as any pre or \ - post commands to run when updating the file are \ - configured in simple XML files. - -homepage http://etch.sourceforge.net/ -platforms darwin - -master_sites sourceforge - -checksums md5 e462d44552ce628b2a2e121eb5825b62 \ - sha1 0cee484b291e89adaa46b1fccc763e14ccb41f90 \ - rmd160 5221532a9bba2b93274a8fd419dc4da6ec965e5e - -depends_build port:rb-rake -depends_run port:ruby \ - port:facter - -PortGroup ruby 1.0 - -# fetch -# extract -# patch -# configure -# build -# destroot - -use_configure no -build {} -test.run no -destroot.cmd cd client && rake -destroot.target install\[${destroot}\] -destroot.destdir "" - Copied: tags/release-3.12/client/Portfile (from rev 161, trunk/client/Portfile) =================================================================== --- tags/release-3.12/client/Portfile (rev 0) +++ tags/release-3.12/client/Portfile 2009-11-14 18:19:58 UTC (rev 164) @@ -0,0 +1,50 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 + +name etch +version %VER% +categories sysutils +maintainers aput.net:jheiss openmaintainer + +description Etch is a system configuration management tool. + +long_description Etch is a tool for managing the configuration of \ + Unix systems. Etch can manage text or binary \ + files, links and directories. The contents of \ + files can be supplied from static files or \ + generated on the fly by scripts or templates. \ + Permissions and ownership as well as any pre or \ + post commands to run when updating the file are \ + configured in simple XML files. + +homepage http://etch.sourceforge.net/ +platforms darwin + +master_sites sourceforge + +checksums md5 e462d44552ce628b2a2e121eb5825b62 \ + sha1 0cee484b291e89adaa46b1fccc763e14ccb41f90 \ + rmd160 5221532a9bba2b93274a8fd419dc4da6ec965e5e + +depends_build port:rb-rake +depends_run port:ruby \ + port:facter + +PortGroup ruby 1.0 + +# fetch +# extract +# patch +# configure +# build +# destroot + +use_configure no +build {} +test.run no +destroot.cmd cd client && rake +destroot.target install\[${destroot}\] +destroot.destdir "" + Deleted: tags/release-3.12/client/Rakefile =================================================================== --- trunk/client/Rakefile 2009-11-14 17:58:54 UTC (rev 159) +++ tags/release-3.12/client/Rakefile 2009-11-14 18:19:58 UTC (rev 164) @@ -1,426 +0,0 @@ -require 'rbconfig' -require 'tempfile' -require 'tmpdir' - -ETCHVER = IO.read('../VERSION').chomp - -BUILDROOT = '/var/tmp/etch-client-buildroot' - -# Copies the etch client files to destdir. Appropriate subdirectories will be -# composed unless specified via options. -# options: -# :bindir -# :libdir -# :etcdir -# :mandir -# :crondir (note no default here, crontab will not be copied if not specified) -# :ruby (#! lines in scripts will be changed to specified ruby) -# :installbase (base directory where files will end up) -def copy_etch_files(destdir, options={}) - bindir = nil - if options[:bindir] - bindir = File.join(destdir, options[:bindir]) - else - bindir = File.join(destdir, 'bin') - end - mkdir_p(bindir) - binapps = ['etch', 'etch_to_trunk', 'etch_cron_wrapper'] - binapps.each do |binapp| - if options[:ruby] - # Change #! line - File.open(File.join(bindir, binapp), 'w') do |newfile| - File.open(binapp) do |oldfile| - # Modify the first line - firstline = oldfile.gets - # Preserve any options. I.e. #!/usr/bin/ruby -w - shebang, shebangopts = firstline.split(' ', 2) - newfile.puts "#!#{options[:ruby]} #{shebangopts}" - # Then dump in the rest of the file - newfile.write(oldfile.read) - end - end - else - cp(binapp, bindir, :preserve => true) - end - chmod(0555, File.join(bindir, binapp)) - end - - libdir = nil - if options[:libdir] - libdir = File.join(destdir, options[:libdir]) - else - libdir = File.join(destdir, 'lib') - end - mkdir_p(libdir) - clientlibs = ['etchclient.rb'] - clientlibs.each do |clientlib| - cp(clientlib, libdir, :preserve => true) - end - serverlibs = ['etch.rb', 'versiontype.rb'] - serverlibs.each do |serverlib| - cp(File.join('..', 'server', 'lib', serverlib), libdir, :preserve => true) - end - clientlibs + serverlibs.each do |lib| - chmod(0444, File.join(libdir, lib)) - end - - mandir = nil - if options[:mandir] - mandir = File.join(destdir, options[:mandir]) - else - mandir = File.join(destdir, 'man') - end - man8dir = File.join(mandir, 'man8') - mkdir_p(man8dir) - cp('etch.8', man8dir, :preserve => true) - chmod(0444, File.join(man8dir, 'etch.8')) - - etcdir = nil - realetcdir = nil - if options[:etcdir] - realetcdir = options[:etcdir] - else - realetcdir = '/etc' - end - etcdir = File.join(destdir, realetcdir) - mkdir_p(etcdir) - etcfiles = ['ca.pem', 'dhparams'] - etcfiles.each do |etcfile| - cp(etcfile, etcdir, :preserve => true) - chmod(0644, File.join(etcdir, etcfile)) - end - - if options[:crondir] - crondir = File.join(destdir, options[:crondir]) - mkdir_p(crondir) - # Note file renamed to 'etch' here. Filename is different in the repo for - # clarity and to avoid conflict with the main executable. - cp('etch_cron', File.join(crondir, 'etch'), :preserve => true) - chmod(0444, File.join(crondir, 'etch')) - end - - # Substitute ETCHVER into etchclient.rb - # Substitute proper path into CONFIGDIR in etchclient.rb if appropriate - newetchclient = File.join(libdir, 'etchclient.rb.new') - etchclient = File.join(libdir, 'etchclient.rb') - File.open(newetchclient, 'w') do |newfile| - IO.foreach(etchclient) do |line| - if line =~ /^\s*VERSION/ - line.sub!(/=.*/, "= '#{ETCHVER}'") - end - if options[:installbase] && line =~ /^\s*CONFIGDIR/ - line.sub!(/=.*/, "= #{realetcdir}") - end - newfile.write(line) - end - end - mv(newetchclient, etchclient) - chmod(0444, etchclient) -end - -desc 'Build an etch client RPM on a Red Hat box' -task :redhat => [:redhatprep, :rpm] -desc 'Prep a Red Hat box for building an RPM' -task :redhatprep do - # Install the package which contains the rpmbuild command - system('rpm --quiet -q rpm-build || sudo yum install rpm-build') -end -desc 'Build an etch client RPM' -task :rpm do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - sbindir = File.join('usr', 'sbin') - libdir = File.join('usr', 'lib', 'ruby', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - crondir = File.join('etc', 'cron.d') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, :crondir => crondir, - :installbase => '/') - - # - # Prep spec file - # - - spec = Tempfile.new('etchrpm') - IO.foreach('etch-client.spec') do |line| - line.sub!('%VER%', ETCHVER) - spec.puts(line) - end - - # - # Build the package - # - - system("rpmbuild -bb --buildroot #{BUILDROOT} #{spec.path}") - - # - # Cleanup - # - - rm_rf(BUILDROOT) -end - -desc 'Build an etch client deb' -task :deb do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - mkdir_p(File.join(BUILDROOT, 'DEBIAN')) - File.open(File.join(BUILDROOT, 'DEBIAN', 'control'), 'w') do |control| - IO.foreach('control') do |line| - next if line =~ /^\s*#/ # Remove comments - line.sub!('%VER%', ETCHVER) - control.puts(line) - end - end - - sbindir = File.join('usr', 'sbin') - libdir = File.join('usr', 'local', 'lib', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - crondir = File.join('etc', 'cron.d') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, :crondir => crondir, - :installbase => '/') - - # - # Set permissions - # - - system("sudo chown -R 0:0 #{BUILDROOT}") - - # - # Build the package - # - - system("dpkg --build #{BUILDROOT} etch-client-#{ETCHVER}.deb") - - # - # Cleanup - # - - rm_rf(BUILDROOT) -end - -desc 'Build etch client SysV packages for Solaris' -task :solaris => [:sysvpkg, :sysvpkgsparc] -desc 'Build an etch client SysV package' -task :sysvpkg do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - sbindir = File.join('usr', 'sbin') - libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, - :ruby => '/opt/csw/bin/ruby', :installbase => '/') - - # - # Prep packaging files - # - - rm_rf('solbuild') - mkdir('solbuild') - File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| - IO.foreach('pkginfo') do |line| - line.sub!('%VER%', ETCHVER) - pkginfo.puts(line) - end - end - File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| - prototype.puts("i pkginfo=./pkginfo") - cp('depend', 'solbuild/depend') - prototype.puts("i depend=./depend") - cp('postinstall', 'solbuild/postinstall') - prototype.puts("i postinstall=./postinstall") - cp('postremove', 'solbuild/postremove') - prototype.puts("i postremove=./postremove") - # The tail +2 removes the first line, which is the base directory - # and doesn't need to be included in the package. - IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| - pipe.each do |line| - # Clean up the directory names - line.sub!(BUILDROOT, '') - # Don't force our permissions on directories - if line =~ /^d/ - line.sub!(/\S+ \S+ \S+$/, '? ? ?') - end - prototype.write(line) - end - end - end - - # - # Build the package - # - - system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") - system("pkgtrans solbuild ../YPCetch-#{ETCHVER}.pkg YPCetch") - - # - # Cleanup - # - - rm_rf('solbuild') - rm_rf(BUILDROOT) -end - -# On Sparc systems we're having problems with the CSW/Blastwave ruby core -# dumping when running etch. The Sunfreeware ruby seems to work. Sunfreeware -# doesn't play well with pkg-get, so we create a bit of a hybrid. We still -# express all the dependencies against CSW, and put our library file -# (etchclient.rb) into /opt/csw. We modify etch to use the Sunfreeware ruby -# in /usr/local/bin, but then tell it to also look in the /opt/csw directory -# for libraries. Users will have to manually install the Sunfreeware ruby -# package. -desc 'Build an etch client SysV package with hybrid CSW/Sunfreeware dependencies' -task :sysvpkgsparc do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - - sbindir = File.join('usr', 'sbin') - libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') - mandir = File.join('usr', 'share', 'man') - etcdir = File.join('etc', 'etch') - copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, - :mandir => mandir, :etcdir => etcdir, - :ruby => '/usr/local/bin/ruby', :installbase => '/') - - # Since we're using the Sunfreeware ruby but CSW libraries we need to add - # the CSW ruby library directory to the search path - newetch = File.join(BUILDROOT, 'usr', 'sbin', 'etch.new') - etch = File.join(BUILDROOT, 'usr', 'sbin', 'etch') - File.open(newetch, 'w') do |newfile| - IO.foreach(etch) do |line| - if line =~ /unshift.*__FILE__/ - line << "$:.unshift('/opt/csw/lib/ruby/site_ruby/1.8')\n" - end - newfile.write(line) - end - end - mv(newetch, etch) - chmod(0555, etch) - - # - # Prep packaging files - # - - rm_rf('solbuild') - mkdir('solbuild') - File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| - IO.foreach('pkginfo') do |line| - line.sub!('%VER%', ETCHVER) - pkginfo.puts(line) - end - end - File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| - prototype.puts("i pkginfo=./pkginfo") - cp('depend', 'solbuild/depend') - prototype.puts("i depend=./depend") - cp('postinstall', 'solbuild/postinstall') - prototype.puts("i postinstall=./postinstall") - cp('postremove', 'solbuild/postremove') - prototype.puts("i postremove=./postremove") - # The tail +2 removes the first line, which is the base directory - # and doesn't need to be included in the package. - IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| - pipe.each do |line| - # Clean up the directory names - line.sub!(BUILDROOT, '') - # Don't force our permissions on directories - if line =~ /^d/ - line.sub!(/\S+ \S+ \S+$/, '? ? ?') - end - prototype.write(line) - end - end - end - - # - # Build the package - # - - system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") - system("pkgtrans solbuild ../YPCetch-#{ETCHVER}-sparc.pkg YPCetch") - - # - # Cleanup - # - - rm_rf('solbuild') - rm_rf(BUILDROOT) -end - -# Install based on Config::CONFIG paths -task :install, :destdir do |t, args| - destdir = nil - if args.destdir - destdir = args.destdir - else - destdir = '/' - end - copy_etch_files(destdir, - :bindir => Config::CONFIG['sbindir'], - :libdir => Config::CONFIG['sitelibdir'], - :mandir => Config::CONFIG['mandir'], - :etcdir => Config::CONFIG['sysconfdir'], - # Can't find a better way to get the path to the current ruby - :ruby => File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']), - :installbase => '/') -end - -task :gem do - # - # Create package file structure in build root - # - - rm_rf(BUILDROOT) - copy_etch_files(BUILDROOT) - - # - # Prep gemspec - # - File.open(File.join(BUILDROOT, 'Rakefile'), 'w') do |gemspec| - IO.foreach('gemspec') do |line| - line.sub!('%VER%', ETCHVER) - gemspec.puts(line) - end - end - - # - # Build the package - # - - system("cd #{BUILDROOT} && rake gem") - gemglob = File.join(BUILDROOT, 'pkg', '*.gem') - gemfile = Dir.glob(gemglob).first - if gemfile - mv(gemfile, Dir.tmpdir) - puts "Gem is #{File.join(Dir.tmpdir, File.basename(gemfile))}" - else - warn "Gem file #{gemglob} not found!" - end - - # - # Cleanup - # - - rm_rf(BUILDROOT) -end - Copied: tags/release-3.12/client/Rakefile (from rev 161, trunk/client/Rakefile) =================================================================== --- tags/release-3.12/client/Rakefile (rev 0) +++ tags/release-3.12/client/Rakefile 2009-11-14 18:19:58 UTC (rev 164) @@ -0,0 +1,439 @@ +require 'rbconfig' +require 'tempfile' +require 'tmpdir' + +ETCHVER = IO.read('../VERSION').chomp + +BUILDROOT = '/var/tmp/etch-client-buildroot' + +# Copies the etch client files to destdir. Appropriate subdirectories will be +# composed unless specified via options. +# options: +# :bindir +# :libdir +# :etcdir +# :mandir +# :crondir (note no default here, crontab will not be copied if not specified) +# :ruby (#! lines in scripts will be changed to specified ruby) +# :installbase (base directory where files will end up) +def copy_etch_files(destdir, options={}) + bindir = nil + if options[:bindir] + bindir = File.join(destdir, options[:bindir]) + else + bindir = File.join(destdir, 'bin') + end + mkdir_p(bindir) + binapps = ['etch', 'etch_to_trunk', 'etch_cron_wrapper'] + binapps.each do |binapp| + if options[:ruby] + # Change #! line + File.open(File.join(bindir, binapp), 'w') do |newfile| + File.open(binapp) do |oldfile| + # Modify the first line + firstline = oldfile.gets + # Preserve any options. I.e. #!/usr/bin/ruby -w + shebang, shebangopts = firstline.split(' ', 2) + newfile.puts "#!#{options[:ruby]} #{shebangopts}" + # Then dump in the rest of the file + newfile.write(oldfile.read) + end + end + else + cp(binapp, bindir, :preserve => true) + end + chmod(0555, File.join(bindir, binapp)) + end + + libdir = nil + if options[:libdir] + libdir = File.join(destdir, options[:libdir]) + else + libdir = File.join(destdir, 'lib') + end + mkdir_p(libdir) + clientlibs = ['etchclient.rb'] + clientlibs.each do |clientlib| + cp(clientlib, libdir, :preserve => true) + end + serverlibs = ['etch.rb', 'versiontype.rb'] + serverlibs.each do |serverlib| + cp(File.join('..', 'server', 'lib', serverlib), libdir, :preserve => true) + end + clientlibs + serverlibs.each do |lib| + chmod(0444, File.join(libdir, lib)) + end + + mandir = nil + if options[:mandir] + mandir = File.join(destdir, options[:mandir]) + else + mandir = File.join(destdir, 'man') + end + man8dir = File.join(mandir, 'man8') + mkdir_p(man8dir) + cp('etch.8', man8dir, :preserve => true) + chmod(0444, File.join(man8dir, 'etch.8')) + + etcdir = nil + realetcdir = nil + if options[:etcdir] + realetcdir = options[:etcdir] + else + realetcdir = '/etc' + end + etcdir = File.join(destdir, realetcdir) + mkdir_p(etcdir) + etcfiles = ['ca.pem', 'dhparams'] + etcfiles.each do |etcfile| + cp(etcfile, etcdir, :preserve => true) + chmod(0644, File.join(etcdir, etcfile)) + end + + if options[:crondir] + crondir = File.join(destdir, options[:crondir]) + mkdir_p(crondir) + # Note file renamed to 'etch' here. Filename is different in the repo for + # clarity and to avoid conflict with the main executable. + cp('etch_cron', File.join(crondir, 'etch'), :preserve => true) + chmod(0444, File.join(crondir, 'etch')) + end + + # Substitute ETCHVER into etchclient.rb + # Substitute proper path into CONFIGDIR in etchclient.rb if appropriate + newetchclient = File.join(libdir, 'etchclient.rb.new') + etchclient = File.join(libdir, 'etchclient.rb') + File.open(newetchclient, 'w') do |newfile| + IO.foreach(etchclient) do |line| + if line =~ /^\s*VERSION/ + line.sub!(/=.*/, "= '#{ETCHVER}'") + end + if options[:installbase] && line =~ /^\s*CONFIGDIR/ + line.sub!(/=.*/, "= #{realetcdir}") + end + newfile.write(line) + end + end + mv(newetchclient, etchclient) + chmod(0444, etchclient) +end + +desc 'Build an etch client RPM on a Red Hat box' +task :redhat => [:redhatprep, :rpm] +desc 'Prep a Red Hat box for building an RPM' +task :redhatprep do + # Install the package which contains the rpmbuild command + system('rpm --quiet -q rpm-build || sudo yum install rpm-build') +end +desc 'Build an etch client RPM' +task :rpm do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('usr', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + crondir = File.join('etc', 'cron.d') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, :crondir => crondir, + :installbase => '/') + + # + # Prep spec file + # + + spec = Tempfile.new('etchrpm') + IO.foreach('etch-client.spec') do |line| + line.sub!('%VER%', ETCHVER) + spec.puts(line) + end + + # + # Build the package + # + + system("rpmbuild -bb --buildroot #{BUILDROOT} #{spec.path}") + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + +desc 'Build an etch client deb' +task :deb do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + mkdir_p(File.join(BUILDROOT, 'DEBIAN')) + File.open(File.join(BUILDROOT, 'DEBIAN', 'control'), 'w') do |control| + IO.foreach('control') do |line| + next if line =~ /^\s*#/ # Remove comments + line.sub!('%VER%', ETCHVER) + control.puts(line) + end + end + + sbindir = File.join('usr', 'sbin') + libdir = File.join('usr', 'local', 'lib', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + crondir = File.join('etc', 'cron.d') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, :crondir => crondir, + :installbase => '/') + + # + # Set permissions + # + + system("sudo chown -R 0:0 #{BUILDROOT}") + + # + # Build the package + # + + system("dpkg --build #{BUILDROOT} etch-client-#{ETCHVER}.deb") + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + +desc 'Build etch client SysV packages for Solaris' +task :solaris => [:sysvpkg, :sysvpkgsparc] +desc 'Build an etch client SysV package' +task :sysvpkg do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, + :ruby => '/opt/csw/bin/ruby', :installbase => '/') + + # + # Prep packaging files + # + + rm_rf('solbuild') + mkdir('solbuild') + File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| + IO.foreach('pkginfo') do |line| + line.sub!('%VER%', ETCHVER) + pkginfo.puts(line) + end + end + File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| + prototype.puts("i pkginfo=./pkginfo") + cp('depend', 'solbuild/depend') + prototype.puts("i depend=./depend") + cp('postinstall', 'solbuild/postinstall') + prototype.puts("i postinstall=./postinstall") + cp('postremove', 'solbuild/postremove') + prototype.puts("i postremove=./postremove") + # The tail +2 removes the first line, which is the base directory + # and doesn't need to be included in the package. + IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| + pipe.each do |line| + # Clean up the directory names + line.sub!(BUILDROOT, '') + # Don't force our permissions on directories + if line =~ /^d/ + line.sub!(/\S+ \S+ \S+$/, '? ? ?') + end + prototype.write(line) + end + end + end + + # + # Build the package + # + + system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") + system("pkgtrans solbuild ../YPCetch-#{ETCHVER}.pkg YPCetch") + + # + # Cleanup + # + + rm_rf('solbuild') + rm_rf(BUILDROOT) +end + +# On Sparc systems we're having problems with the CSW/Blastwave ruby core +# dumping when running etch. The Sunfreeware ruby seems to work. Sunfreeware +# doesn't play well with pkg-get, so we create a bit of a hybrid. We still +# express all the dependencies against CSW, and put our library file +# (etchclient.rb) into /opt/csw. We modify etch to use the Sunfreeware ruby +# in /usr/local/bin, but then tell it to also look in the /opt/csw directory +# for libraries. Users will have to manually install the Sunfreeware ruby +# package. +desc 'Build an etch client SysV package with hybrid CSW/Sunfreeware dependencies' +task :sysvpkgsparc do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, + :ruby => '/usr/local/bin/ruby', :installbase => '/') + + # Since we're using the Sunfreeware ruby but CSW libraries we need to add + # the CSW ruby library directory to the search path + newetch = File.join(BUILDROOT, 'usr', 'sbin', 'etch.new') + etch = File.join(BUILDROOT, 'usr', 'sbin', 'etch') + File.open(newetch, 'w') do |newfile| + IO.foreach(etch) do |line| + if line =~ /unshift.*__FILE__/ + line << "$:.unshift('/opt/csw/lib/ruby/site_ruby/1.8')\n" + end + newfile.write(line) + end + end + mv(newetch, etch) + chmod(0555, etch) + + # + # Prep packaging files + # + + rm_rf('solbuild') + mkdir('solbuild') + File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| + IO.foreach('pkginfo') do |line| + line.sub!('%VER%', ETCHVER) + pkginfo.puts(line) + end + end + File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| + prototype.puts("i pkginfo=./pkginfo") + cp('depend', 'solbuild/depend') + prototype.puts("i depend=./depend") + cp('postinstall', 'solbuild/postinstall') + prototype.puts("i postinstall=./postinstall") + cp('postremove', 'solbuild/postremove') + prototype.puts("i postremove=./postremove") + # The tail +2 removes the first line, which is the base directory + # and doesn't need to be included in the package. + IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| + pipe.each do |line| + # Clean up the directory names + line.sub!(BUILDROOT, '') + # Don't force our permissions on directories + if line =~ /^d/ + line.sub!(/\S+ \S+ \S+$/, '? ? ?') + end + prototype.write(line) + end + end + end + + # + # Build the package + # + + system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") + system("pkgtrans solbuild ../YPCetch-#{ETCHVER}-sparc.pkg YPCetch") + + # + # Cleanup + # + + rm_rf('solbuild') + rm_rf(BUILDROOT) +end + +# Install based on Config::CONFIG paths +task :install, :destdir do |t, args| + destdir = nil + if args.destdir + destdir = args.destdir + else + destdir = '/' + end + copy_etch_files(destdir, + :bindir => Config::CONFIG['sbindir'], + :libdir => Config::CONFIG['sitelibdir'], + :mandir => Config::CONFIG['mandir'], + :etcdir => Config::CONFIG['sysconfdir'], + # Can't find a better way to get the path to the current ruby + :ruby => File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']), + :installbase => '/') +end + +desc 'Prepare portfile for submission to MacPorts' +task :macport do + portfile = File.join(Dir.tmpdir, 'Portfile') + rm_f(portfile) + File.open(portfile, 'w') do |newfile| + IO.foreach('Portfile') do |line| + line.sub!('%VER%', ETCHVER) + newfile.puts(line) + end + end + puts "Portfile is #{portfile}" +end + +task :gem do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + copy_etch_files(BUILDROOT) + + # + # Prep gemspec + # + File.open(File.join(BUILDROOT, 'Rakefile'), 'w') do |gemspec| + IO.foreach('gemspec') do |line| + line.sub!('%VER%', ETCHVER) + gemspec.puts(line) + end + end + + # + # Build the package + # + + system("cd #{BUILDROOT} && rake gem") + gemglob = File.join(BUILDROOT, 'pkg', '*.gem') + gemfile = Dir.glob(gemglob).first + if gemfile + mv(gemfile, Dir.tmpdir) + puts "Gem is #{File.join(Dir.tmpdir, File.basename(gemfile))}" + else + warn "Gem file #{gemglob} not found!" + end + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 18:19:29
|
Revision: 163 http://etch.svn.sourceforge.net/etch/?rev=163&view=rev Author: jheiss Date: 2009-11-14 18:19:23 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Re-tagging 3.12 release Removed Paths: ------------- tags/release-3.12/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 18:19:00
|
Revision: 162 http://etch.svn.sourceforge.net/etch/?rev=162&view=rev Author: jheiss Date: 2009-11-14 18:18:52 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Don't make dist dependent on test for now, tests take a long time to run and require a bunch of prerequisites that might not be set up on the box used to build the distribution files. Assume the user has run the test suite themselves. Modified Paths: -------------- Rakefile Modified: Rakefile =================================================================== --- Rakefile 2009-11-14 18:15:24 UTC (rev 161) +++ Rakefile 2009-11-14 18:18:52 UTC (rev 162) @@ -14,7 +14,8 @@ end desc 'Build distribution files for new release' -task :dist => :test do +#task :dist => :test_tag do +task :dist do rm_rf(DIST) mkdir(DIST) system("(cd #{TAGDIR} && find client server test etchserver-* README | grep -v '\.svn' | cpio -pdum ../../#{DIST})") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 18:15:34
|
Revision: 161 http://etch.svn.sourceforge.net/etch/?rev=161&view=rev Author: jheiss Date: 2009-11-14 18:15:24 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Add rake task to substitute version into macports portfile. Modified Paths: -------------- trunk/client/Portfile trunk/client/Rakefile Modified: trunk/client/Portfile =================================================================== --- trunk/client/Portfile 2009-11-14 18:05:29 UTC (rev 160) +++ trunk/client/Portfile 2009-11-14 18:15:24 UTC (rev 161) @@ -4,7 +4,7 @@ PortSystem 1.0 name etch -version 3.11 +version %VER% categories sysutils maintainers aput.net:jheiss openmaintainer Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2009-11-14 18:05:29 UTC (rev 160) +++ trunk/client/Rakefile 2009-11-14 18:15:24 UTC (rev 161) @@ -385,6 +385,19 @@ :installbase => '/') end +desc 'Prepare portfile for submission to MacPorts' +task :macport do + portfile = File.join(Dir.tmpdir, 'Portfile') + rm_f(portfile) + File.open(portfile, 'w') do |newfile| + IO.foreach('Portfile') do |line| + line.sub!('%VER%', ETCHVER) + newfile.puts(line) + end + end + puts "Portfile is #{portfile}" +end + task :gem do # # Create package file structure in build root This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 18:05:45
|
Revision: 160 http://etch.svn.sourceforge.net/etch/?rev=160&view=rev Author: jheiss Date: 2009-11-14 18:05:29 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Tag 3.12 release. Fix typo in top-level rakefile. Modified Paths: -------------- Rakefile tags/release-3.12/VERSION Added Paths: ----------- tags/release-3.12/ Modified: Rakefile =================================================================== --- Rakefile 2009-11-14 17:58:54 UTC (rev 159) +++ Rakefile 2009-11-14 18:05:29 UTC (rev 160) @@ -1,4 +1,4 @@ -ETCHVER = '3.11' +ETCHVER = '3.12' TAGNAME = "release-#{ETCHVER}" TAGDIR = "tags/#{TAGNAME}" DIST = "etch-#{ETCHVER}" @@ -27,7 +27,7 @@ desc 'Tag a new release' task :tag do - if !File.exist(TAGDIR) + if !File.exist?(TAGDIR) system("svn copy trunk #{TAGDIR}") # Remove files that aren't in svn system("svn status #{TAGDIR} | grep '^?' | awk '{print $2}' | xargs rm -rf") Modified: tags/release-3.12/VERSION =================================================================== --- trunk/VERSION 2009-11-14 17:58:54 UTC (rev 159) +++ tags/release-3.12/VERSION 2009-11-14 18:05:29 UTC (rev 160) @@ -1 +1 @@ -trunk +3.12 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 17:59:02
|
Revision: 159 http://etch.svn.sourceforge.net/etch/?rev=159&view=rev Author: jheiss Date: 2009-11-14 17:58:54 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Deprecate makefile in favor of new rakefile. Modified Paths: -------------- Makefile Added Paths: ----------- Rakefile Modified: Makefile =================================================================== --- Makefile 2009-11-14 17:25:34 UTC (rev 158) +++ Makefile 2009-11-14 17:58:54 UTC (rev 159) @@ -1,3 +1,5 @@ +# Deprecated, see Rakefile + VER=3.11 TAGNAME=release-$(VER) Added: Rakefile =================================================================== --- Rakefile (rev 0) +++ Rakefile 2009-11-14 17:58:54 UTC (rev 159) @@ -0,0 +1,49 @@ +ETCHVER = '3.11' +TAGNAME = "release-#{ETCHVER}" +TAGDIR = "tags/#{TAGNAME}" +DIST = "etch-#{ETCHVER}" + +desc 'Run test suite in trunk' +task :test_trunk do + system('./trunk/test/alltests.rb') +end + +desc 'Run test suite in current tag' +task :test_tag do + system("./#{TAGDIR}/test/alltests.rb") +end + +desc 'Build distribution files for new release' +task :dist => :test do + rm_rf(DIST) + mkdir(DIST) + system("(cd #{TAGDIR} && find client server test etchserver-* README | grep -v '\.svn' | cpio -pdum ../../#{DIST})") + system("tar czf #{DIST}.tar.gz #{DIST}") + rm_rf(DIST) + system("openssl md5 #{DIST}.tar.gz > #{DIST}.tar.gz.md5") + system("openssl sha1 #{DIST}.tar.gz > #{DIST}.tar.gz.sha1") + system("gpg --detach --armor #{DIST}.tar.gz") +end + +desc 'Tag a new release' +task :tag do + if !File.exist(TAGDIR) + system("svn copy trunk #{TAGDIR}") + # Remove files that aren't in svn + system("svn status #{TAGDIR} | grep '^?' | awk '{print $2}' | xargs rm -rf") + # Put the version in a file there + File.open("#{TAGDIR}/VERSION", 'w') do |verfile| + verfile.puts(ETCHVER) + end + puts "Remember to commit #{TAGDIR}" + else + warn "Tag #{TAGDIR} already exists" + end +end + +desc 'Clean up distribution files and work directories' +task :clean do + rm(Dir.glob('etch-*.tar.gz*')) + rm_rf(DIST) +end + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 17:25:41
|
Revision: 158 http://etch.svn.sourceforge.net/etch/?rev=158&view=rev Author: jheiss Date: 2009-11-14 17:25:34 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Need to cd to client directory before running rake install Modified Paths: -------------- trunk/client/Portfile Modified: trunk/client/Portfile =================================================================== --- trunk/client/Portfile 2009-11-14 17:25:15 UTC (rev 157) +++ trunk/client/Portfile 2009-11-14 17:25:34 UTC (rev 158) @@ -44,7 +44,7 @@ use_configure no build {} test.run no -destroot.cmd rake +destroot.cmd cd client && rake destroot.target install\[${destroot}\] destroot.destdir "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 17:25:22
|
Revision: 157 http://etch.svn.sourceforge.net/etch/?rev=157&view=rev Author: jheiss Date: 2009-11-14 17:25:15 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Fix bad quote character Modified Paths: -------------- trunk/client/Rakefile Modified: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile 2009-11-14 06:37:45 UTC (rev 156) +++ trunk/client/Rakefile 2009-11-14 17:25:15 UTC (rev 157) @@ -210,7 +210,7 @@ rm_rf(BUILDROOT) end -desc 'Build etch client SysV packages for Solaris" +desc 'Build etch client SysV packages for Solaris' task :solaris => [:sysvpkg, :sysvpkgsparc] desc 'Build an etch client SysV package' task :sysvpkg do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 06:37:51
|
Revision: 156 http://etch.svn.sourceforge.net/etch/?rev=156&view=rev Author: jheiss Date: 2009-11-14 06:37:45 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Config file for rake to replace makefile. Besides the rpm, deb and sysv packages supported by the makefile this adds a generic "rake install" task that installs to appropriate directories based on the current ruby config, and a task to build a gem. Added Paths: ----------- trunk/client/Rakefile Added: trunk/client/Rakefile =================================================================== --- trunk/client/Rakefile (rev 0) +++ trunk/client/Rakefile 2009-11-14 06:37:45 UTC (rev 156) @@ -0,0 +1,426 @@ +require 'rbconfig' +require 'tempfile' +require 'tmpdir' + +ETCHVER = IO.read('../VERSION').chomp + +BUILDROOT = '/var/tmp/etch-client-buildroot' + +# Copies the etch client files to destdir. Appropriate subdirectories will be +# composed unless specified via options. +# options: +# :bindir +# :libdir +# :etcdir +# :mandir +# :crondir (note no default here, crontab will not be copied if not specified) +# :ruby (#! lines in scripts will be changed to specified ruby) +# :installbase (base directory where files will end up) +def copy_etch_files(destdir, options={}) + bindir = nil + if options[:bindir] + bindir = File.join(destdir, options[:bindir]) + else + bindir = File.join(destdir, 'bin') + end + mkdir_p(bindir) + binapps = ['etch', 'etch_to_trunk', 'etch_cron_wrapper'] + binapps.each do |binapp| + if options[:ruby] + # Change #! line + File.open(File.join(bindir, binapp), 'w') do |newfile| + File.open(binapp) do |oldfile| + # Modify the first line + firstline = oldfile.gets + # Preserve any options. I.e. #!/usr/bin/ruby -w + shebang, shebangopts = firstline.split(' ', 2) + newfile.puts "#!#{options[:ruby]} #{shebangopts}" + # Then dump in the rest of the file + newfile.write(oldfile.read) + end + end + else + cp(binapp, bindir, :preserve => true) + end + chmod(0555, File.join(bindir, binapp)) + end + + libdir = nil + if options[:libdir] + libdir = File.join(destdir, options[:libdir]) + else + libdir = File.join(destdir, 'lib') + end + mkdir_p(libdir) + clientlibs = ['etchclient.rb'] + clientlibs.each do |clientlib| + cp(clientlib, libdir, :preserve => true) + end + serverlibs = ['etch.rb', 'versiontype.rb'] + serverlibs.each do |serverlib| + cp(File.join('..', 'server', 'lib', serverlib), libdir, :preserve => true) + end + clientlibs + serverlibs.each do |lib| + chmod(0444, File.join(libdir, lib)) + end + + mandir = nil + if options[:mandir] + mandir = File.join(destdir, options[:mandir]) + else + mandir = File.join(destdir, 'man') + end + man8dir = File.join(mandir, 'man8') + mkdir_p(man8dir) + cp('etch.8', man8dir, :preserve => true) + chmod(0444, File.join(man8dir, 'etch.8')) + + etcdir = nil + realetcdir = nil + if options[:etcdir] + realetcdir = options[:etcdir] + else + realetcdir = '/etc' + end + etcdir = File.join(destdir, realetcdir) + mkdir_p(etcdir) + etcfiles = ['ca.pem', 'dhparams'] + etcfiles.each do |etcfile| + cp(etcfile, etcdir, :preserve => true) + chmod(0644, File.join(etcdir, etcfile)) + end + + if options[:crondir] + crondir = File.join(destdir, options[:crondir]) + mkdir_p(crondir) + # Note file renamed to 'etch' here. Filename is different in the repo for + # clarity and to avoid conflict with the main executable. + cp('etch_cron', File.join(crondir, 'etch'), :preserve => true) + chmod(0444, File.join(crondir, 'etch')) + end + + # Substitute ETCHVER into etchclient.rb + # Substitute proper path into CONFIGDIR in etchclient.rb if appropriate + newetchclient = File.join(libdir, 'etchclient.rb.new') + etchclient = File.join(libdir, 'etchclient.rb') + File.open(newetchclient, 'w') do |newfile| + IO.foreach(etchclient) do |line| + if line =~ /^\s*VERSION/ + line.sub!(/=.*/, "= '#{ETCHVER}'") + end + if options[:installbase] && line =~ /^\s*CONFIGDIR/ + line.sub!(/=.*/, "= #{realetcdir}") + end + newfile.write(line) + end + end + mv(newetchclient, etchclient) + chmod(0444, etchclient) +end + +desc 'Build an etch client RPM on a Red Hat box' +task :redhat => [:redhatprep, :rpm] +desc 'Prep a Red Hat box for building an RPM' +task :redhatprep do + # Install the package which contains the rpmbuild command + system('rpm --quiet -q rpm-build || sudo yum install rpm-build') +end +desc 'Build an etch client RPM' +task :rpm do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('usr', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + crondir = File.join('etc', 'cron.d') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, :crondir => crondir, + :installbase => '/') + + # + # Prep spec file + # + + spec = Tempfile.new('etchrpm') + IO.foreach('etch-client.spec') do |line| + line.sub!('%VER%', ETCHVER) + spec.puts(line) + end + + # + # Build the package + # + + system("rpmbuild -bb --buildroot #{BUILDROOT} #{spec.path}") + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + +desc 'Build an etch client deb' +task :deb do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + mkdir_p(File.join(BUILDROOT, 'DEBIAN')) + File.open(File.join(BUILDROOT, 'DEBIAN', 'control'), 'w') do |control| + IO.foreach('control') do |line| + next if line =~ /^\s*#/ # Remove comments + line.sub!('%VER%', ETCHVER) + control.puts(line) + end + end + + sbindir = File.join('usr', 'sbin') + libdir = File.join('usr', 'local', 'lib', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + crondir = File.join('etc', 'cron.d') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, :crondir => crondir, + :installbase => '/') + + # + # Set permissions + # + + system("sudo chown -R 0:0 #{BUILDROOT}") + + # + # Build the package + # + + system("dpkg --build #{BUILDROOT} etch-client-#{ETCHVER}.deb") + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + +desc 'Build etch client SysV packages for Solaris" +task :solaris => [:sysvpkg, :sysvpkgsparc] +desc 'Build an etch client SysV package' +task :sysvpkg do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, + :ruby => '/opt/csw/bin/ruby', :installbase => '/') + + # + # Prep packaging files + # + + rm_rf('solbuild') + mkdir('solbuild') + File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| + IO.foreach('pkginfo') do |line| + line.sub!('%VER%', ETCHVER) + pkginfo.puts(line) + end + end + File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| + prototype.puts("i pkginfo=./pkginfo") + cp('depend', 'solbuild/depend') + prototype.puts("i depend=./depend") + cp('postinstall', 'solbuild/postinstall') + prototype.puts("i postinstall=./postinstall") + cp('postremove', 'solbuild/postremove') + prototype.puts("i postremove=./postremove") + # The tail +2 removes the first line, which is the base directory + # and doesn't need to be included in the package. + IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| + pipe.each do |line| + # Clean up the directory names + line.sub!(BUILDROOT, '') + # Don't force our permissions on directories + if line =~ /^d/ + line.sub!(/\S+ \S+ \S+$/, '? ? ?') + end + prototype.write(line) + end + end + end + + # + # Build the package + # + + system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") + system("pkgtrans solbuild ../YPCetch-#{ETCHVER}.pkg YPCetch") + + # + # Cleanup + # + + rm_rf('solbuild') + rm_rf(BUILDROOT) +end + +# On Sparc systems we're having problems with the CSW/Blastwave ruby core +# dumping when running etch. The Sunfreeware ruby seems to work. Sunfreeware +# doesn't play well with pkg-get, so we create a bit of a hybrid. We still +# express all the dependencies against CSW, and put our library file +# (etchclient.rb) into /opt/csw. We modify etch to use the Sunfreeware ruby +# in /usr/local/bin, but then tell it to also look in the /opt/csw directory +# for libraries. Users will have to manually install the Sunfreeware ruby +# package. +desc 'Build an etch client SysV package with hybrid CSW/Sunfreeware dependencies' +task :sysvpkgsparc do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + + sbindir = File.join('usr', 'sbin') + libdir = File.join('opt', 'csw', 'lib', 'ruby', 'site_ruby', '1.8') + mandir = File.join('usr', 'share', 'man') + etcdir = File.join('etc', 'etch') + copy_etch_files(BUILDROOT, :bindir => sbindir, :libdir => libdir, + :mandir => mandir, :etcdir => etcdir, + :ruby => '/usr/local/bin/ruby', :installbase => '/') + + # Since we're using the Sunfreeware ruby but CSW libraries we need to add + # the CSW ruby library directory to the search path + newetch = File.join(BUILDROOT, 'usr', 'sbin', 'etch.new') + etch = File.join(BUILDROOT, 'usr', 'sbin', 'etch') + File.open(newetch, 'w') do |newfile| + IO.foreach(etch) do |line| + if line =~ /unshift.*__FILE__/ + line << "$:.unshift('/opt/csw/lib/ruby/site_ruby/1.8')\n" + end + newfile.write(line) + end + end + mv(newetch, etch) + chmod(0555, etch) + + # + # Prep packaging files + # + + rm_rf('solbuild') + mkdir('solbuild') + File.open(File.join('solbuild', 'pkginfo'), 'w') do |pkginfo| + IO.foreach('pkginfo') do |line| + line.sub!('%VER%', ETCHVER) + pkginfo.puts(line) + end + end + File.open(File.join('solbuild', 'prototype'), 'w') do |prototype| + prototype.puts("i pkginfo=./pkginfo") + cp('depend', 'solbuild/depend') + prototype.puts("i depend=./depend") + cp('postinstall', 'solbuild/postinstall') + prototype.puts("i postinstall=./postinstall") + cp('postremove', 'solbuild/postremove') + prototype.puts("i postremove=./postremove") + # The tail +2 removes the first line, which is the base directory + # and doesn't need to be included in the package. + IO.popen("find #{BUILDROOT} | tail +2 | pkgproto") do |pipe| + pipe.each do |line| + # Clean up the directory names + line.sub!(BUILDROOT, '') + # Don't force our permissions on directories + if line =~ /^d/ + line.sub!(/\S+ \S+ \S+$/, '? ? ?') + end + prototype.write(line) + end + end + end + + # + # Build the package + # + + system("cd solbuild && pkgmk -r #{BUILDROOT} -d $PWD/solbuild") + system("pkgtrans solbuild ../YPCetch-#{ETCHVER}-sparc.pkg YPCetch") + + # + # Cleanup + # + + rm_rf('solbuild') + rm_rf(BUILDROOT) +end + +# Install based on Config::CONFIG paths +task :install, :destdir do |t, args| + destdir = nil + if args.destdir + destdir = args.destdir + else + destdir = '/' + end + copy_etch_files(destdir, + :bindir => Config::CONFIG['sbindir'], + :libdir => Config::CONFIG['sitelibdir'], + :mandir => Config::CONFIG['mandir'], + :etcdir => Config::CONFIG['sysconfdir'], + # Can't find a better way to get the path to the current ruby + :ruby => File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']), + :installbase => '/') +end + +task :gem do + # + # Create package file structure in build root + # + + rm_rf(BUILDROOT) + copy_etch_files(BUILDROOT) + + # + # Prep gemspec + # + File.open(File.join(BUILDROOT, 'Rakefile'), 'w') do |gemspec| + IO.foreach('gemspec') do |line| + line.sub!('%VER%', ETCHVER) + gemspec.puts(line) + end + end + + # + # Build the package + # + + system("cd #{BUILDROOT} && rake gem") + gemglob = File.join(BUILDROOT, 'pkg', '*.gem') + gemfile = Dir.glob(gemglob).first + if gemfile + mv(gemfile, Dir.tmpdir) + puts "Gem is #{File.join(Dir.tmpdir, File.basename(gemfile))}" + else + warn "Gem file #{gemglob} not found!" + end + + # + # Cleanup + # + + rm_rf(BUILDROOT) +end + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 06:35:57
|
Revision: 155 http://etch.svn.sourceforge.net/etch/?rev=155&view=rev Author: jheiss Date: 2009-11-14 06:35:51 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Config file for MacPorts Added Paths: ----------- trunk/client/Portfile Added: trunk/client/Portfile =================================================================== --- trunk/client/Portfile (rev 0) +++ trunk/client/Portfile 2009-11-14 06:35:51 UTC (rev 155) @@ -0,0 +1,50 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id$ + +PortSystem 1.0 + +name etch +version 3.11 +categories sysutils +maintainers aput.net:jheiss openmaintainer + +description Etch is a system configuration management tool. + +long_description Etch is a tool for managing the configuration of \ + Unix systems. Etch can manage text or binary \ + files, links and directories. The contents of \ + files can be supplied from static files or \ + generated on the fly by scripts or templates. \ + Permissions and ownership as well as any pre or \ + post commands to run when updating the file are \ + configured in simple XML files. + +homepage http://etch.sourceforge.net/ +platforms darwin + +master_sites sourceforge + +checksums md5 e462d44552ce628b2a2e121eb5825b62 \ + sha1 0cee484b291e89adaa46b1fccc763e14ccb41f90 \ + rmd160 5221532a9bba2b93274a8fd419dc4da6ec965e5e + +depends_build port:rb-rake +depends_run port:ruby \ + port:facter + +PortGroup ruby 1.0 + +# fetch +# extract +# patch +# configure +# build +# destroot + +use_configure no +build {} +test.run no +destroot.cmd rake +destroot.target install\[${destroot}\] +destroot.destdir "" + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 04:26:47
|
Revision: 154 http://etch.svn.sourceforge.net/etch/?rev=154&view=rev Author: jheiss Date: 2009-11-14 04:26:36 +0000 (Sat, 14 Nov 2009) Log Message: ----------- A rakefile/gem spec Added Paths: ----------- trunk/client/gemspec Added: trunk/client/gemspec =================================================================== --- trunk/client/gemspec (rev 0) +++ trunk/client/gemspec 2009-11-14 04:26:36 UTC (rev 154) @@ -0,0 +1,16 @@ +require 'rake/gempackagetask' +spec = Gem::Specification.new do |s| + s.name = 'etch' + s.summary = 'Etch system configuration management client' + s.add_dependency('facter') + s.version = '%VER%' + s.author = 'Jason Heiss' + s.email = 'etc...@li...' + s.homepage = 'http://etch.sourceforge.net' + s.platform = Gem::Platform::RUBY + s.required_ruby_version = '>=1.8' + s.files = Dir['**/**'] + s.executables = [ 'etch', 'etch_to_trunk', 'etch_cron_wrapper' ] +end +Rake::GemPackageTask.new(spec).define + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 04:26:13
|
Revision: 153 http://etch.svn.sourceforge.net/etch/?rev=153&view=rev Author: jheiss Date: 2009-11-14 04:26:04 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Unset the version here, the rake tasks will set it when building packages. Modified Paths: -------------- trunk/client/etchclient.rb Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2009-11-14 04:12:35 UTC (rev 152) +++ trunk/client/etchclient.rb 2009-11-14 04:26:04 UTC (rev 153) @@ -35,7 +35,7 @@ require 'etch' class Etch::Client - VERSION = '3.11' + VERSION = 'unset' CONFIRM_PROCEED = 1 CONFIRM_SKIP = 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 04:12:43
|
Revision: 152 http://etch.svn.sourceforge.net/etch/?rev=152&view=rev Author: jheiss Date: 2009-11-14 04:12:35 +0000 (Sat, 14 Nov 2009) Log Message: ----------- A file containing the current version. Will be updated by the rakefile in the parent directory when a new version is tagged. Added Paths: ----------- trunk/VERSION Added: trunk/VERSION =================================================================== --- trunk/VERSION (rev 0) +++ trunk/VERSION 2009-11-14 04:12:35 UTC (rev 152) @@ -0,0 +1 @@ +trunk This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 00:51:04
|
Revision: 151 http://etch.svn.sourceforge.net/etch/?rev=151&view=rev Author: jheiss Date: 2009-11-14 00:15:12 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Mark file as deprecated, moving build instructions to rake. Make, how do I hate thee? Let me count the ways... Modified Paths: -------------- trunk/client/Makefile Modified: trunk/client/Makefile =================================================================== --- trunk/client/Makefile 2009-11-14 00:14:00 UTC (rev 150) +++ trunk/client/Makefile 2009-11-14 00:15:12 UTC (rev 151) @@ -1,3 +1,5 @@ +# Deprecated, see Rakefile + BUILDROOT=/var/tmp/etch-client-buildroot # Grab the current version from the library VER=$(shell ruby -e "$$:.unshift('.'); require 'etchclient'; puts Etch::Client::VERSION") @@ -10,7 +12,6 @@ rpm --quiet -q ruby || sudo yum install ruby # And the package which contains the rpmbuild command rpm --quiet -q rpm-build || sudo yum install rpm-build -TMPSPEC = etch-client-temp.spec rpm: etch-client.spec # # Create package file structure in build root This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 00:50:51
|
Revision: 150 http://etch.svn.sourceforge.net/etch/?rev=150&view=rev Author: jheiss Date: 2009-11-14 00:14:00 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Make the directory where config files are stored a constant so that we can change it easily if etch is not installed in the standard location. Modified Paths: -------------- trunk/client/etchclient.rb Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2009-11-14 00:12:38 UTC (rev 149) +++ trunk/client/etchclient.rb 2009-11-14 00:14:00 UTC (rev 150) @@ -41,6 +41,7 @@ CONFIRM_SKIP = 2 CONFIRM_QUIT = 3 PRIVATE_KEY_PATHS = ["/etc/ssh/ssh_host_rsa_key", "/etc/ssh_host_rsa_key"] + CONFIGDIR = '/etc/etch' # We need these in relation to the output capturing ORIG_STDOUT = STDOUT.dup @@ -140,17 +141,17 @@ http = Net::HTTP.new(@filesuri.host, @filesuri.port) if @filesuri.scheme == "https" # Eliminate the OpenSSL "using default DH parameters" warning - if File.exist?('/etc/etch/dhparams') - dh = OpenSSL::PKey::DH.new(IO.read('/etc/etch/dhparams')) + if File.exist?(File.join(CONFIGDIR, 'dhparams')) + dh = OpenSSL::PKey::DH.new(IO.read(File.join(CONFIGDIR, 'dhparams'))) Net::HTTP.ssl_context_accessor(:tmp_dh_callback) http.tmp_dh_callback = proc { dh } end http.use_ssl = true - if File.exist?('/etc/etch/ca.pem') - http.ca_file = '/etc/etch/ca.pem' + if File.exist?(File.join(CONFIGDIR, 'ca.pem')) + http.ca_file = File.join(CONFIGDIR, 'ca.pem') http.verify_mode = OpenSSL::SSL::VERIFY_PEER - elsif File.directory?('/etc/etch/ca') - http.ca_path = '/etc/etch/ca' + elsif File.directory?(File.join(CONFIGDIR, 'ca')) + http.ca_path = File.join(CONFIGDIR, 'ca') http.verify_mode = OpenSSL::SSL::VERIFY_PEER end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 00:50:19
|
Revision: 149 http://etch.svn.sourceforge.net/etch/?rev=149&view=rev Author: jheiss Date: 2009-11-14 00:12:38 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Use %VER% instead of VER for the version template that is replaced with the real version when we make a package. The Solaris pkginfo was already using %VER%, so this makes all of the packages consistent and more resistent to accidently substituting the wrong thing. Modified Paths: -------------- trunk/client/control trunk/client/etch-client.spec Modified: trunk/client/control =================================================================== --- trunk/client/control 2009-11-14 00:08:06 UTC (rev 148) +++ trunk/client/control 2009-11-14 00:12:38 UTC (rev 149) @@ -1,5 +1,5 @@ Package: etch-client -Version: VER-1 +Version: %VER%-1 Maintainer: etc...@li... Architecture: all Depends: ruby facter rcs Modified: trunk/client/etch-client.spec =================================================================== --- trunk/client/etch-client.spec 2009-11-14 00:08:06 UTC (rev 148) +++ trunk/client/etch-client.spec 2009-11-14 00:12:38 UTC (rev 149) @@ -1,6 +1,6 @@ Name: etch-client Summary: Etch client -Version: VER +Version: %VER% Release: 1 Group: Applications/System License: MIT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-14 00:08:13
|
Revision: 148 http://etch.svn.sourceforge.net/etch/?rev=148&view=rev Author: jheiss Date: 2009-11-14 00:08:06 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Add CA stub file Added Paths: ----------- trunk/client/ca.pem Added: trunk/client/ca.pem =================================================================== --- trunk/client/ca.pem (rev 0) +++ trunk/client/ca.pem 2009-11-14 00:08:06 UTC (rev 148) @@ -0,0 +1 @@ +# Add your SSL certificate authority's cert(s) to this file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Jason H. <jh...@ap...> - 2009-11-11 21:25:59
|
A few misc. improvements and bug fixes in this release: Explicitly invoke user actions (setup/pre/post/test/etc.) via "sh -c" so that syntax like "FOO=bar myprogram" works Wrap exceptions from templates with a message indicating the template filename and associated file filename to help the user figure out where the error occurred. Errors from etch scripts were already subject to this treatment. The client version is now in sync with the overall package version, so with this release the client version jumps from 1.18 to 3.11. And some misc. bug fixes. |
From: <jh...@us...> - 2009-11-11 21:13:12
|
Revision: 147 http://etch.svn.sourceforge.net/etch/?rev=147&view=rev Author: jheiss Date: 2009-11-11 21:12:59 +0000 (Wed, 11 Nov 2009) Log Message: ----------- Tag 3.11 release Modified Paths: -------------- Makefile tags/release-3.11/client/etchclient.rb trunk/client/etchclient.rb Added Paths: ----------- tags/release-3.11/ Modified: Makefile =================================================================== --- Makefile 2009-11-11 00:59:11 UTC (rev 146) +++ Makefile 2009-11-11 21:12:59 UTC (rev 147) @@ -1,4 +1,4 @@ -VER=3.10 +VER=3.11 TAGNAME=release-$(VER) all: dist Modified: tags/release-3.11/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2009-11-11 00:59:11 UTC (rev 146) +++ tags/release-3.11/client/etchclient.rb 2009-11-11 21:12:59 UTC (rev 147) @@ -35,7 +35,7 @@ require 'etch' class Etch::Client - VERSION = '3.10' + VERSION = '3.11' CONFIRM_PROCEED = 1 CONFIRM_SKIP = 2 Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2009-11-11 00:59:11 UTC (rev 146) +++ trunk/client/etchclient.rb 2009-11-11 21:12:59 UTC (rev 147) @@ -35,7 +35,7 @@ require 'etch' class Etch::Client - VERSION = '3.10' + VERSION = '3.11' CONFIRM_PROCEED = 1 CONFIRM_SKIP = 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-11 00:59:18
|
Revision: 146 http://etch.svn.sourceforge.net/etch/?rev=146&view=rev Author: jheiss Date: 2009-11-11 00:59:11 +0000 (Wed, 11 Nov 2009) Log Message: ----------- Explicitly invoke user actions via "sh -c" so that syntax like "FOO=bar myprogram" works When generating commands remove any steps where the guard and command have been filtered out. Raise an exception if either the guard or command were filtered out but not both. Improve error message in all cases to try to help the user track down the offending entry. Modify check_for_inconsistency to allow for 0 elements. When preping a blank local request in the client set up the :commands hash if it will be needed. Modified Paths: -------------- trunk/client/etchclient.rb trunk/server/lib/etch.rb Modified: trunk/client/etchclient.rb =================================================================== --- trunk/client/etchclient.rb 2009-11-11 00:53:48 UTC (rev 145) +++ trunk/client/etchclient.rb 2009-11-11 00:59:11 UTC (rev 146) @@ -308,6 +308,9 @@ if !responsedata[:need_origs].empty? request[:files] = {} end + if !responsedata[:retrycommands].empty? + request[:commands] = {} + end else request = get_blank_request end @@ -2038,7 +2041,9 @@ end end - r = system(exec) + # Explicitly invoke using /bin/sh so that syntax like + # "FOO=bar myprogram" works. + r = system('/bin/sh', '-c', exec) if exectype == 'post' || exectype == 'command' if etch_priority != 0 Modified: trunk/server/lib/etch.rb =================================================================== --- trunk/server/lib/etch.rb 2009-11-11 00:53:48 UTC (rev 145) +++ trunk/server/lib/etch.rb 2009-11-11 00:59:11 UTC (rev 146) @@ -366,7 +366,9 @@ @dlogger.debug "Processing server setup commands" Etch.xmleach(config_xml, '/config/server_setup/exec') do |cmd| @dlogger.debug " Executing #{Etch.xmltext(cmd)}" - success = system(Etch.xmltext(cmd)) + # Explicitly invoke using /bin/sh so that syntax like + # "FOO=bar myprogram" works. + success = system('/bin/sh', '-c', Etch.xmltext(cmd)) if !success raise "Server setup command #{Etch.xmltext(cmd)} for file #{file} exited with non-zero value" end @@ -897,16 +899,33 @@ Dir::chdir "#{@commandsbase}/#{command}" # Check that the resulting document is consistent after filtering + remove = [] Etch.xmleach(commands_xml, '/commands/step') do |step| guard_exec_elements = Etch.xmlarray(step, 'guard/exec') if check_for_inconsistency(guard_exec_elements) - raise "Inconsistent guard 'exec' entries for #{command}" + raise "Inconsistent guard 'exec' entries for #{command}: " + + guard_exec_elements.collect {|elem| Etch.xmltext(elem)}.join(',') end command_exec_elements = Etch.xmlarray(step, 'command/exec') if check_for_inconsistency(command_exec_elements) - raise "Inconsistent command 'exec' entries for #{command}" + raise "Inconsistent command 'exec' entries for #{command}: " + + command_exec_elements.collect {|elem| Etch.xmltext(elem)}.join(',') end + # If filtering has removed both the guard and command elements + # we can remove this step. + if guard_exec_elements.empty? && command_exec_elements.empty? + remove << step + # If filtering has removed the guard but not the command or vice + # versa that's an error. + elsif guard_exec_elements.empty? + raise "Filtering removed guard, but left command: " + + Etch.xmltext(command_exec_elements.first) + elsif command_exec_elements.empty? + raise "Filtering removed command, but left guard: " + + Etch.xmltext(guard_exec_elements.first) + end end + remove.each { |elem| Etch.xmlremove(commands_xml, elem) } # I'm not sure if we'd benefit from further checking the XML for # validity. For now we declare success if we got this far. @@ -1050,7 +1069,7 @@ # contain the same value. Returns true if there is inconsistency. def check_for_inconsistency(elements) elements_as_text = elements.collect { |elem| Etch.xmltext(elem) } - if elements_as_text.uniq.length != 1 + if elements_as_text.uniq.length > 1 return true else return false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jh...@us...> - 2009-11-11 00:54:00
|
Revision: 145 http://etch.svn.sourceforge.net/etch/?rev=145&view=rev Author: jheiss Date: 2009-11-11 00:53:48 +0000 (Wed, 11 Nov 2009) Log Message: ----------- Add require of facter for systems where facter was installed via rubygems. Modified Paths: -------------- trunk/test/attributes.rb Modified: trunk/test/attributes.rb =================================================================== --- trunk/test/attributes.rb 2009-11-11 00:53:09 UTC (rev 144) +++ trunk/test/attributes.rb 2009-11-11 00:53:48 UTC (rev 145) @@ -8,6 +8,7 @@ require 'etchtest' require 'tempfile' require 'fileutils' +require 'rubygems' # Might be needed to find facter require 'facter' class EtchAttributeTests < Test::Unit::TestCase This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |