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

⌈⌋ branch:  cross package maker


Check-in [32632f2a8d]

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

Overview
SHA1:32632f2a8d1a1a43f414610bbbd610892bccbf65
Date: 2015-05-01 02:17:52
User: mario
Comment:Add architecture mapping, limit mode per & 07777.
Tags And Properties
  • branch=trunk inherited from [5980cef12a]
  • sym-trunk inherited from [5980cef12a]
Context
2015-05-01
22:40
[275407c9b1] Retain more attributes: provides=, conflicts=, config_files as backup=, deb_recomends as optdepends=, update_filter as makepkgopt= for arch .PKGINFO (user: mario, tags: trunk)
02:17
[32632f2a8d] Add architecture mapping, limit mode per & 07777. (user: mario, tags: trunk)
2015-04-30
23:54
[006fa58cfa] New `-t arch` output package module. (Arch Linux binary tarballs with .PKGINFO and .MTREE meta files.) (user: mario, tags: trunk)
Changes

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

42
43
44
45
46
47
48








49
50
51
52
53
54
55
56
57
58
59
60
    ::Dir::chdir(staging_path) do
      args = ["tar", "-c", "-J", "--owner=0", "--group=0", "--xform", "s:./::", "--exclude", "./", "-f", tarfn, "."]
      safesystem(*args)
    end
  end # def output
  
  def pkginfo()








    File.open(staging_path + "/.PKGINFO", "w") do |f|
      f.write template("arch/PKGINFO.erb").result(binding)
    end
  end

  def mtree()
    Zlib::GzipWriter.open(staging_path + "/.MTREE") do |f|
      f.write template("arch/MTREEgz.erb").result(binding)
    end
  end

end # class FPM::Package::Arch







>
>
>
>
>
>
>
>







|




42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
    ::Dir::chdir(staging_path) do
      args = ["tar", "-c", "-J", "--owner=0", "--group=0", "--xform", "s:./::", "--exclude", "./", "-f", tarfn, "."]
      safesystem(*args)
    end
  end # def output
  
  def pkginfo()
    map = {
      "all" => "any",
      "amd64" => "x86-84",
      "x86" => "i686",
    }
    if map.has_key?(architecture)
      @architecture = map[architecture]
    end
    File.open(staging_path + "/.PKGINFO", "w") do |f|
      f.write template("arch/PKGINFO.erb").result(binding)
    end
  end

  def mtree()
    Zlib::GzipWriter.open(staging_path + "/.MTREE") do |f|
      f.write template("arch/MTREE.erb").result(binding)
    end
  end

end # class FPM::Package::Arch

Name change from templates/arch/MTREEgz.erb to templates/arch/MTREE.erb.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 lasth = ""

 ::Dir.chdir(staging_path) do
   ::Dir.glob("./**/*") do |fn|

     #-- per file/directory
     stat = File.stat(fn)
     f_mode = stat.mode.to_s(8)
     if File.directory? fn
       head = "/set uid=0 gid=0 mode=#{f_mode}\n"
       line = "#{fn} time=#{stat.mtime.to_f} type=dir\n"
     else
       f_md5 = Digest::MD5.file(fn).hexdigest
       f_sha = Digest::SHA256.file(fn).hexdigest
       head = "/set type=file uid=0 gid=0 mode=#{f_mode}\n"







|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 lasth = ""

 ::Dir.chdir(staging_path) do
   ::Dir.glob("./**/*") do |fn|

     #-- per file/directory
     stat = File.stat(fn)
     f_mode = (stat.mode & 07777).to_s(8)
     if File.directory? fn
       head = "/set uid=0 gid=0 mode=#{f_mode}\n"
       line = "#{fn} time=#{stat.mtime.to_f} type=dir\n"
     else
       f_md5 = Digest::MD5.file(fn).hexdigest
       f_sha = Digest::SHA256.file(fn).hexdigest
       head = "/set type=file uid=0 gid=0 mode=#{f_mode}\n"