Cross package maker. DEB/RPM generation or conversion. Derived from jordansissel/fpm.

⌈⌋ ⎇ branch:  cross package maker


Check-in [0e56b40574]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Introduce `--phar-x` flag to make output .phar file executable right away. Remove extra .unlink() after renaming target package.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0e56b405749270e5c09766463ee954479882a0ca
User & Date: mario 2015-01-28 12:50:35
Context
2015-01-28
12:51
Fix pkg.provides += [] addition. Strip any VCS #hashversionsuffixes from version strings. check-in: e08478f4fe user: mario tags: trunk
12:50
Introduce `--phar-x` flag to make output .phar file executable right away. Remove extra .unlink() after renaming target package. check-in: 0e56b40574 user: mario tags: trunk
2015-01-22
20:18
Do not prepend staging_dir for --phar-stub, as it might not be staged as literal file. check-in: a386da2c8f user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/fpm/package/phar.rb.

57
58
59
60
61
62
63

64
65
66
67
68
69
70
# Phar creation (output only)
class FPM::Package::Phar < FPM::Package

  option "--format", "PHAR.gz/TGZ/ZIP", "Phar package type and compression (append .gz/.bz2 for method)", :default=>"PHAR.GZ"
  option "--stub", "STUB.php", "Apply initialization/stub file", :default=>""
  #option "--nocase", :flag, "Lowercase filenames / implicit `-u lcase=*`", :default=>false
  option "--sign", "PEM_FILE", "Sign package with OpenSSL and key from .pem file", :default=>""


  # Invoke PHP for actual packaging process
  def output(output_path)
    output_check(output_path)

    # Build flags
    p = {







>







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Phar creation (output only)
class FPM::Package::Phar < FPM::Package

  option "--format", "PHAR.gz/TGZ/ZIP", "Phar package type and compression (append .gz/.bz2 for method)", :default=>"PHAR.GZ"
  option "--stub", "STUB.php", "Apply initialization/stub file", :default=>""
  #option "--nocase", :flag, "Lowercase filenames / implicit `-u lcase=*`", :default=>false
  option "--sign", "PEM_FILE", "Sign package with OpenSSL and key from .pem file", :default=>""
  option "--x", :flag, "Set executable bit on phar package", :default=>false, :hidden=>true

  # Invoke PHP for actual packaging process
  def output(output_path)
    output_check(output_path)

    # Build flags
    p = {
119
120
121
122
123
124
125
126
127
128
129
    # Have PHP generate the package
    p[:tmpf] = ::Dir::Tmpname.create(['_\$fpm_phar_', p[:stdext]]) {}
    phargen = template_dir + "/phar.php"
    safesystem("php", "-dphar.readonly=0", "-derror_reporting=~0", "-ddisplay_errors=1", phargen, JSON.generate(p))

    #-- but might end up with suffix, for whole-archive ->compress()ion
    FileUtils.mv(p[:tmpf] + p[:extout], output_path)
    File.unlink(p[:tmpf]) if File.exists?(p[:tmpf])
  end

end # class FPM::Package::Phar







|



120
121
122
123
124
125
126
127
128
129
130
    # Have PHP generate the package
    p[:tmpf] = ::Dir::Tmpname.create(['_\$fpm_phar_', p[:stdext]]) {}
    phargen = template_dir + "/phar.php"
    safesystem("php", "-dphar.readonly=0", "-derror_reporting=~0", "-ddisplay_errors=1", phargen, JSON.generate(p))

    #-- but might end up with suffix, for whole-archive ->compress()ion
    FileUtils.mv(p[:tmpf] + p[:extout], output_path)
    FileUtils.chmod("a+x", output_path) if attributes[:phar_x_given?]
  end

end # class FPM::Package::Phar