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

⌈⌋ ⎇ branch:  cross package maker


Check-in [e08478f4fe]

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

Overview
Comment:Fix pkg.provides += [] addition. Strip any VCS #hashversionsuffixes from version strings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e08478f4fe91f62be9e2124acc72b1c23cce5eff
User & Date: mario 2015-01-28 12:51:50
Context
2015-02-06
18:07
Basic inheritance for =target specifiers. Make meta extractor not consume mixed *|#|// comment prefixes. Clean up pack list from empty elements. Move copying logic out of main function. check-in: d1be6d8c51 user: mario tags: trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
      @name_prefix = "php-"
    end

    # add dependencies
    pkg.name = "#{@name_prefix}#{@name}"
    pkg.version = version_rewrite(pkg.version, typ)
    if typ == :rpm
      pkg.provides = "php-composer(#{@in_bundle}) = #{pkg.version}"
    end
    unless attributes[:no_depends_given?]
      pkg.dependencies += dependency_map(:require, typ)
      pkg.provides +=    dependency_map(:provide,  typ)
      pkg.replaces +=    dependency_map(:replace,  typ)
      pkg.conflicts +=   dependency_map(:conflict, typ)
      #pkg.suggests +=    dependency_map(:suggest,  typ)  if typ == :deb







|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
      @name_prefix = "php-"
    end

    # add dependencies
    pkg.name = "#{@name_prefix}#{@name}"
    pkg.version = version_rewrite(pkg.version, typ)
    if typ == :rpm
      pkg.provides += ["php-composer(#{@in_bundle}) = #{pkg.version}"]
    end
    unless attributes[:no_depends_given?]
      pkg.dependencies += dependency_map(:require, typ)
      pkg.provides +=    dependency_map(:provide,  typ)
      pkg.replaces +=    dependency_map(:replace,  typ)
      pkg.conflicts +=   dependency_map(:conflict, typ)
      #pkg.suggests +=    dependency_map(:suggest,  typ)  if typ == :deb
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
        k + v
      }.join(" | ")
    }
  end
  
  # Normalize version strings to packaging system
  def version_rewrite(v, typ)
    v = v.gsub(/ ^.+ \sAS\s (.+)$ /unix, "\\1").gsub(/ \s+() | ^v() /unix, "")
    case typ
      when :deb
        # http://anonscm.debian.org/cgit/pkg-php/pkg-php-tools.git/tree/share/php/pkgtools/phpcomposer/source.php
        # http://anonscm.debian.org/cgit/pkg-php/
        # https://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&data=pkg-php-maint%40lists.alioth.debian.org
        v.gsub!(/[-@](dev|patch)(.*)$/i) { "~~" + "$1$2".downcase }
        v.gsub!(/[-@](alpha|beta|RC|stable)(.*)$/i) { "~" + "$1$2".downcase }
      when :rpm
        v.gsub!(/[-@](dev|patch|alpha|beta|RC|stable)(.*)$/) { "-" + "$1$2".downcase }
      else
        v.gsub!(/@/, "-")
    end
    return v
  end









|



<




|







291
292
293
294
295
296
297
298
299
300
301

302
303
304
305
306
307
308
309
310
311
312
313
        k + v
      }.join(" | ")
    }
  end
  
  # Normalize version strings to packaging system
  def version_rewrite(v, typ)
    v = v.gsub(/ ^.+ \sAS\s (.+)$ /unix, "\\1").gsub(/ \s+ | ^v(?=\d) | \#[[:xdigit:]]+$ /unix, "")
    case typ
      when :deb
        # http://anonscm.debian.org/cgit/pkg-php/pkg-php-tools.git/tree/share/php/pkgtools/phpcomposer/source.php

        # https://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&data=pkg-php-maint%40lists.alioth.debian.org
        v.gsub!(/[-@](dev|patch)(.*)$/i) { "~~" + "$1$2".downcase }
        v.gsub!(/[-@](alpha|beta|RC|stable)(.*)$/i) { "~" + "$1$2".downcase }
      when :rpm
        v.gsub!(/[-@](dev|patch|alpha|beta|RC|stable)(.*)$/) { $1.downcase }
      else
        v.gsub!(/@/, "-")
    end
    return v
  end