Welcome to mirror list, hosted at ThFree Co, Russian Federation.

package « _package - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc9ef8cab1674039eddd2394a76127025761f72b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env ruby

NAME = 'gitaly'
DESCRIPTION = 'Gitaly (part of GitLab). Experimental build for testing only.'
VERSION = IO.popen(%w[git describe]) { |io| io.read }.chomp.split('v', 2)[1]
ARCHITECTURE = 'amd64'
PREFIX = '/usr/local'
VENDOR = 'GitLab Inc.'
MAINTAINER = VENDOR
LICENSE = 'MIT'
URL = 'https://gitlab.com/gitlab-org/gitaly'

PACKAGE_DIR = File.dirname(__FILE__)

def main(args)
  run!(%w[bundle install --quiet --binstubs], PACKAGE_DIR)
  File.chmod(0755, *args)
  File.chmod(0644, 'NOTICE')
  fpm = %W[
    #{PACKAGE_DIR}/bin/fpm -t deb -m #{MAINTAINER} --vendor #{VENDOR} --license #{LICENSE}
    --url #{URL} -s dir -n #{NAME} -v #{VERSION} -a #{ARCHITECTURE} --description #{DESCRIPTION}
  ]
  fpm += args.map { |arg| "#{arg}=#{PREFIX}/bin/" }
  fpm << "NOTICE=usr/share/doc/#{NAME}/"
  run!(fpm, '.')
end

def run!(cmd, dir)
  if ! system(*cmd, chdir: dir)
    abort "command failed: #{cmd.join(' ')}"
  end
end

abort "VERSION cannot be empty" if VERSION.empty?

if ARGV.empty?
  abort "Usage: #{$0} EXECUTABLE [EXECUTABLE...]"
end

main(ARGV)