pkgr 1.6.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 88515b775ce0780722e7b2cf547a055eb389d2b1
4
- data.tar.gz: 90ea8f15d716c46d2a2ae12a0cfaa77b1ecd5d9c
2
+ SHA256:
3
+ metadata.gz: 3e4ee7683642379d95db25293212b682d6372658d25f1c4af1c351060ad02c23
4
+ data.tar.gz: b6395fae78964b3e198c59474290f93136f4e411033c77dda5aa93cc3c05370e
5
5
  SHA512:
6
- metadata.gz: 8574750422452b0efe2a75d4be2703ccac4a8c33c8936c0b781928d25092a1dced9e07f6eb7fc8e92765292043fa30dbb5a59ea3e60658c67573c9b64ac5be0d
7
- data.tar.gz: 1d730a9380f3c66a79f4e596e623028fd0e7637bb559da47b22d35b81f9fea2a184c2cb98878198b6b07e32cfcfafbc91afb5fccc45950844a2ceb215a2ed89e
6
+ metadata.gz: 7b7698dce4aff8fc9bcdf7dc2d62b1c77187e953d7d9a4852acb25c2f12af0b7f36ae48a5d03befd09889091ada6db67d88813ac78955963af59e460c3b1556a
7
+ data.tar.gz: 79d7ebb82c466d8b1b4dadcbcbf0912663bb51b959344982beedf506b6ab064da1d0d69782cf641cf1c4bcfbcb486d5208610854823368df5ee66c70c24942c9
data/README.md CHANGED
@@ -29,12 +29,16 @@ They may just work.
29
29
 
30
30
  ## Supported distributions (64bits only)
31
31
 
32
+ * Ubuntu 20.04 ("focal")
33
+ * Ubuntu 18.04 ("bionic")
32
34
  * Ubuntu 16.04 ("xenial")
33
35
  * Ubuntu 14.04 ("trusty")
34
36
  * Ubuntu 12.04 ("precise")
37
+ * Debian 10 ("buster")
35
38
  * Debian 9 ("stretch")
36
39
  * Debian 8 ("jessie")
37
40
  * Debian 7 ("wheezy")
41
+ * RHEL/CentOS 8
38
42
  * RHEL/CentOS 7
39
43
  * RHEL/CentOS 6
40
44
  * Suse Linux Enterprise Server 12
@@ -48,23 +52,25 @@ See [Packager.io][packager-io] for examples of apps packaged with `pkgr` (Gitlab
48
52
 
49
53
  ## Installation
50
54
 
51
- You can find DEB and RPM packages for a wide range of distributions on Packager.io:
55
+ Docker images are available for the most recent distributions. If you don't
56
+ have docker or are interested in older distributions, you can also install
57
+ `pkgr` as a ruby gem:
52
58
 
53
- <https://packager.io/gh/crohr/pkgr>
54
-
55
- Or, installing as a gem, on debian-based machines:
56
-
57
- sudo apt-get update
58
- sudo apt-get install -y build-essential ruby1.9.1-full rubygems1.9.1
59
- sudo gem install pkgr
59
+ gem install pkgr
60
60
 
61
61
  ## Usage
62
62
 
63
63
  To package your app, execute `pkgr` against your app's repository:
64
64
 
65
+ # if using the ruby gem, you need to run it under the distribution you want to package for:
65
66
  pkgr package path/to/app/repo
66
67
 
67
- The resulting `.deb` or `.rpm` package will be in your current working directory. That is, you need to run `pkgr` on the target distribution for which you want to generate a package.
68
+ # if using a docker image, you can run it from any host OS:
69
+ docker run --rm -it -v $(pwd):/app -v /tmp/cache pkgr/ubuntu:20.04
70
+ docker run --rm -it -v $(pwd):/app -v /tmp/cache pkgr/el:8
71
+ docker run --rm -it -v $(pwd):/app -v /tmp/cache pkgr/debian:10
72
+
73
+ The resulting `.deb` or `.rpm` package will be in your current working directory.
68
74
 
69
75
  Full command line options are given below:
70
76
 
@@ -81,6 +87,11 @@ Full command line options are given below:
81
87
  [--architecture=ARCHITECTURE] # Target architecture for the package
82
88
  # Default: x86_64
83
89
  [--runner=RUNNER] # Force a specific runner (e.g. upstart-1.5, sysv-lsb-1.3)
90
+ [--logrotate-frequency=FREQUENCY] # Set logrotate frequency
91
+ # Default: daily
92
+ # Possible values: daily, weekly, monthly, yearly
93
+ [--logrotate-backlog=BACKLOG] # Set logrotate backlog
94
+ # Default: 14
84
95
  [--homepage=HOMEPAGE] # Project homepage (e.g. "https://pkgr.example.org")
85
96
  [--home=HOME] # Project home (e.g. "/usr/share/PACKAGE_HOME")
86
97
  [--description=DESCRIPTION] # Project description
@@ -140,7 +151,7 @@ Finally, it's a great way to share your open source software with your users and
140
151
 
141
152
  * Uses Heroku buildpacks to embed all the dependencies related to your application runtime within the debian package. For a Rails app for instance, this means that `pkgr` will embed the specific ruby runtime you asked for, along with all the gems specified in your Gemfile. However, all other dependencies you may need must be specified as additional system dependencies (see Usage). This avoids the 'packaging-the-world' approach used by other tools such as omnibus (with the pros and cons that come with it), but it still allows you to use the latest and greatest libraries for your language of choice. See this [blog post][background-pkgr] for more background.
142
153
 
143
- [background-pkgr]: http://blog.packager.io/post/81988994454/why-i-made-pkgr-io-digressions-on-software-packaging
154
+ [background-pkgr]: https://blog.packager.io/posts/1-why-i-made-packager-io-digressions-on-software-packaging
144
155
 
145
156
  * Gives you a nice executable, which closely replicates the Heroku toolbelt utility. For instance, assuming you're packaging an app called `my-app`, you can do the following:
146
157
 
@@ -198,5 +209,3 @@ Issue getting nokogiri to compile? Try the following based on this [comment](htt
198
209
  ## Copyright
199
210
 
200
211
  See LICENSE (MIT)
201
-
202
-
@@ -23,3 +23,7 @@ debian-9:
23
23
  - libssl1.0.2
24
24
  - libssl1.0-dev
25
25
  - default-libmysqlclient-dev
26
+ debian-10:
27
+ - libssl1.1
28
+ - libssl-dev
29
+ - default-libmysqlclient-dev
@@ -13,5 +13,11 @@ ubuntu-10.04:
13
13
  - libssl0.9.8
14
14
  ubuntu-12.04:
15
15
  - libssl1.0.0
16
+ ubuntu-14.04:
17
+ - libssl1.0.0
16
18
  ubuntu-16.04:
17
19
  - libssl1.0.0
20
+ ubuntu-18.04:
21
+ - libssl1.0.0
22
+ ubuntu-20.04:
23
+ - libssl1.1
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -0,0 +1,4 @@
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
+ https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
+ https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
+ https://github.com/kr/heroku-buildpack-go.git
@@ -0,0 +1,4 @@
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
+ https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
+ https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
+ https://github.com/kr/heroku-buildpack-go.git
@@ -1,3 +1,3 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-ruby.git,CURL_CONNECT_TIMEOUT=60,CURL_TIMEOUT=300
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,3 +1,3 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
@@ -1,3 +1,3 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
@@ -1,3 +1,3 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
@@ -1,3 +1,3 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -1,4 +1,4 @@
1
- https://github.com/pkgr/heroku-buildpack-ruby.git#v164-1,BUILDPACK_NODE_VERSION="0.6.8"
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
2
  https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
3
  https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
4
  https://github.com/kr/heroku-buildpack-go.git
@@ -0,0 +1,4 @@
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
+ https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
+ https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
+ https://github.com/kr/heroku-buildpack-go.git
@@ -0,0 +1,4 @@
1
+ https://github.com/pkgr/heroku-buildpack-ruby.git#v227-1
2
+ https://github.com/pkgr/heroku-buildpack-python.git#buildcurl
3
+ https://github.com/heroku/heroku-buildpack-nodejs.git#v106
4
+ https://github.com/kr/heroku-buildpack-go.git
data/data/cli/cli.sh.erb CHANGED
@@ -28,6 +28,7 @@ usage() {
28
28
  echo " $APP_NAME logs [--tail|-n NUMBER]"
29
29
  echo " $APP_NAME config:get VAR"
30
30
  echo " $APP_NAME config:set VAR=VALUE"
31
+ echo " $APP_NAME config:unset VAR"
31
32
  echo " $APP_NAME configure"
32
33
  echo " $APP_NAME reconfigure"
33
34
  echo " $APP_NAME restart"
@@ -46,6 +47,7 @@ usage() {
46
47
  echo ""
47
48
  echo " $APP_NAME restart [process]"
48
49
  echo " This will restart the application (or the given process), in a distribution-independent manner."
50
+ exit 64
49
51
  }
50
52
 
51
53
  DEFAULT_FILE=$(_p "/etc/default/${APP_NAME}")
@@ -59,7 +61,19 @@ for file in $(_p "${APP_HOME}/.profile.d")/*.sh; do
59
61
  done
60
62
 
61
63
  if [ "$APP_CLI" != "" ] ; then
62
- exec $APP_HOME/bin/$APP_CLI "$@"
64
+ cli_path="$APP_CLI"
65
+ if [ ! -e "$cli_path" ]; then
66
+ cli_path="$APP_HOME/$APP_CLI"
67
+ fi
68
+ if [ ! -e "$cli_path" ]; then
69
+ cli_path="$APP_HOME/bin/$APP_CLI"
70
+ fi
71
+ if [ -e "$cli_path" ]; then
72
+ exec "$cli_path" "$@"
73
+ else
74
+ echo "Error: the given CLI ($APP_CLI) does not point to any valid executable"
75
+ exit 1
76
+ fi
63
77
  fi
64
78
 
65
79
  if [ ! -w "$(_p "/etc/${APP_NAME}/conf.d")" ] ; then
@@ -96,14 +110,24 @@ show_env() {
96
110
  env -i ROOT_PATH=${ROOT_PATH} ${0} run env | sort
97
111
  }
98
112
 
113
+ logs_files() {
114
+ files=$(shopt -s nullglob dotglob; echo $(_p "/var/log/${APP_NAME}")/*.log)
115
+ echo "$files"
116
+ }
117
+
99
118
  logs_opt() {
119
+ files=$(logs_files)
120
+ if [ "$files" == "" ]; then
121
+ return
122
+ fi
123
+
100
124
  if [ "$1" == "" ]; then
101
- for file in $(_p "/var/log/${APP_NAME}")/*.log ; do
125
+ for file in $files ; do
102
126
  echo "==> ${file} <=="
103
127
  cat "${file}"
104
128
  done
105
129
  else
106
- tail $(_p "/var/log/${APP_NAME}")/*.log "$@"
130
+ tail $files "$@"
107
131
  fi
108
132
  }
109
133
  logs_systemd() {
@@ -121,7 +145,11 @@ logs() {
121
145
  }
122
146
 
123
147
  tail_logs_opt() {
124
- tail -f $(_p "/var/log/${APP_NAME}")/*.log
148
+ files=$(logs_files)
149
+ if [ "$files" == "" ]; then
150
+ return
151
+ fi
152
+ tail -f $files
125
153
  }
126
154
  tail_logs_systemd() {
127
155
  journalctl -u "$APP_NAME-*" -f "$@"
@@ -154,7 +182,7 @@ process_index() {
154
182
  if [ -f "$(_p "${APP_HOME}/Procfile")" ]; then
155
183
  index="$(cat "$(_p "${APP_HOME}/Procfile")" | grep -ve '^#' | grep -n "$process_name:" | cut -f 1 -d ':')"
156
184
  else
157
- index=0
185
+ index=1
158
186
  fi
159
187
  echo $(($index - 1))
160
188
  }
@@ -367,13 +395,18 @@ reconfigure() {
367
395
  configure --reconfigure
368
396
  }
369
397
 
398
+ config_unset() {
399
+ local key="${1}"
400
+ sed -i -r "s/^\s*export\s+${key}.*$//g" $(_p "/etc/${APP_NAME}/conf.d")/*
401
+ }
402
+
370
403
  config_set() {
371
404
  # http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02
372
405
  local key="${1%%=*}"
373
406
  local value="${1#*=}"
374
407
  local file=$(_p "/etc/${APP_NAME}/conf.d/other")
375
408
  touch "$file"
376
- sed -i -r "s/^\s*export\s+${key}.*$//g" $(_p "/etc/${APP_NAME}/conf.d")/*
409
+ config_unset "$key"
377
410
  echo "export ${key}=\"${value}\"" >> "${file}"
378
411
  sed -i '/^\s*$/d' "$file"
379
412
  }
@@ -466,10 +499,14 @@ while : ; do
466
499
  show_env
467
500
  break;;
468
501
 
502
+ config:unset)
503
+ [ $# -lt 2 ] && usage
504
+ config_unset "$2"
505
+ break;;
506
+
469
507
  config:set)
470
508
  [ $# -lt 2 ] && usage
471
509
  config_set "$2"
472
-
473
510
  break;;
474
511
 
475
512
  config:get)
@@ -4,6 +4,11 @@ default:
4
4
  - libxml2
5
5
  - libxslt
6
6
  - libevent
7
- - postgresql-libs
8
7
  - mysql-libs
9
8
  - sqlite
9
+ centos-6:
10
+ - postgresql-libs
11
+ centos-7:
12
+ - postgresql-libs
13
+ centos-8:
14
+ - libpq
@@ -5,23 +5,44 @@ default:
5
5
  - openssl
6
6
  - libxml2
7
7
  - libxslt1.1
8
- - libreadline5
9
- - libreadline6
10
8
  ubuntu-10.04:
9
+ - libreadline5
11
10
  - libssl0.9.8
12
11
  - libmysqlclient16
13
12
  - libevent-1.4-2
14
13
  - libevent-core-1.4-2
15
14
  - libevent-extra-1.4-2
16
15
  ubuntu-12.04:
16
+ - libreadline6
17
+ - libssl1.0.0
18
+ - libmysqlclient18
19
+ - libevent-2.0-5
20
+ - libevent-core-2.0-5
21
+ - libevent-extra-2.0-5
22
+ ubuntu-14.04:
23
+ - libreadline6
17
24
  - libssl1.0.0
18
25
  - libmysqlclient18
19
26
  - libevent-2.0-5
20
27
  - libevent-core-2.0-5
21
28
  - libevent-extra-2.0-5
22
29
  ubuntu-16.04:
30
+ - libreadline6
23
31
  - libssl1.0.0
24
32
  - libmysqlclient20
25
33
  - libevent-2.0-5
26
34
  - libevent-core-2.0-5
27
35
  - libevent-extra-2.0-5
36
+ ubuntu-18.04:
37
+ - libreadline7
38
+ - libssl1.0.0
39
+ - libmysqlclient20
40
+ - libevent-2.1-6
41
+ - libevent-core-2.1-6
42
+ - libevent-extra-2.1-6
43
+ ubuntu-20.04:
44
+ - libreadline8
45
+ - libssl1.1
46
+ - libevent-2.1-7
47
+ - libevent-core-2.1-7
48
+ - libevent-extra-2.1-7
@@ -1,8 +1,8 @@
1
1
  # <%= name %> logs:
2
2
  /var/log/<%= name %>/*.log {
3
- daily
3
+ <%= logrotate_frequency %>
4
4
  missingok
5
- rotate 14
5
+ rotate <%= logrotate_backlog %>
6
6
  compress
7
7
  delaycompress
8
8
  notifempty
@@ -7,8 +7,14 @@ module Pkgr
7
7
  attr_writer :buildpacks_cache_dir
8
8
 
9
9
  def buildpacks_cache_dir
10
- @buildpacks_cache_dir ||= File.expand_path("~/.pkgr/buildpacks").tap do |dir|
11
- FileUtils.mkdir_p(dir)
10
+ default_buildpacks_cache_dir = File.expand_path("~/.pkgr/buildpacks")
11
+ @buildpacks_cache_dir ||= begin
12
+ default_buildpacks_cache_dir.tap do |dir|
13
+ FileUtils.mkdir_p(dir)
14
+ end
15
+ rescue
16
+ Pkgr.warn "Unable to create directory at #{default_buildpacks_cache_dir.inspect}. Using temporary directory."
17
+ Dir.mktmpdir
12
18
  end
13
19
  end
14
20
  end
@@ -36,7 +42,10 @@ module Pkgr
36
42
  end
37
43
 
38
44
  def compile(path, compile_cache_dir, compile_env_dir)
39
- cmd = %{env -i #{compound_environment(path)} #{dir}/bin/compile "#{path}" "#{compile_cache_dir}" "#{compile_env_dir}" }
45
+ compile_home_dir = Dir.mktmpdir
46
+ # Required to work around bundler forcing a writable home dir
47
+ local_env = Env.new(["HOME=#{compile_home_dir}"])
48
+ cmd = %{env -i #{compound_environment(path, local_env)} #{dir}/bin/compile "#{path}" "#{compile_cache_dir}" "#{compile_env_dir}" }
40
49
  Pkgr.debug "Running #{cmd.inspect}"
41
50
 
42
51
  Dir.chdir(path) do
@@ -48,7 +57,8 @@ module Pkgr
48
57
  end
49
58
  raise "compile failed" unless $?.exitstatus.zero?
50
59
  end
51
-
60
+ ensure
61
+ FileUtils.remove_entry_secure compile_home_dir
52
62
  true
53
63
  end
54
64
 
@@ -107,8 +117,8 @@ module Pkgr
107
117
 
108
118
  private
109
119
 
110
- def compound_environment(path)
111
- Env.new(['PATH=$PATH']).merge(env).merge(exported_environment(File.join(path, "export")))
120
+ def compound_environment(path, local_env = Env.new)
121
+ Env.new(['PATH=$PATH']).merge(local_env).merge(env).merge(exported_environment(File.join(path, "export")))
112
122
  end
113
123
 
114
124
  def exported_environment(path)
data/lib/pkgr/cli.rb CHANGED
@@ -51,6 +51,15 @@ module Pkgr
51
51
  method_option :runner,
52
52
  :type => :string,
53
53
  :desc => "Force a specific runner (e.g. upstart-1.5, sysv-lsb-1.3)"
54
+ method_option :logrotate_frequency,
55
+ :type => :string,
56
+ :desc => "Set logrotate backlog",
57
+ :enum => %w(daily weekly monthly yearly),
58
+ :default => "daily"
59
+ method_option :logrotate_backlog,
60
+ :type => :numeric,
61
+ :desc => "Set logrotate backlog",
62
+ :default => 14
54
63
  method_option :homepage,
55
64
  :type => :string,
56
65
  :desc => "Project homepage"
data/lib/pkgr/config.rb CHANGED
@@ -92,6 +92,14 @@ module Pkgr
92
92
  @table[:home] || "/opt/#{name}"
93
93
  end
94
94
 
95
+ def logrotate_frequency
96
+ @table[:logrotate_frequency] || "daily"
97
+ end
98
+
99
+ def logrotate_backlog
100
+ @table[:logrotate_backlog] || 14
101
+ end
102
+
95
103
  def user
96
104
  @table[:user] || name
97
105
  end
@@ -252,6 +260,8 @@ module Pkgr
252
260
  args.push "--buildpack_list \"#{buildpack_list}\"" unless buildpack_list.nil? || buildpack_list.empty?
253
261
  args.push "--force-os \"#{force_os}\"" unless force_os.nil? || force_os.empty?
254
262
  args.push "--runner \"#{runner}\"" unless runner.nil? || runner.empty?
263
+ args.push "--logrotate-frequency \"#{logrotate_frequency}\"" unless logrotate_frequency.nil? || logrotate_frequency.empty?
264
+ args.push "--logrotate-backlog \"#{logrotate_backlog}\"" unless logrotate_backlog.nil?
255
265
  args.push "--env #{env.variables.map{|v| "\"#{v}\""}.join(" ")}" if env.present?
256
266
  args.push "--auto" if auto
257
267
  args.push "--verbose" if verbose
@@ -42,7 +42,7 @@ module Pkgr
42
42
  v = (Git.new(path).latest_tag || "").gsub(/^[^\d]+(\d.*)/, '\1')
43
43
  # If it's not a Git archive, try to figure out svn revision number
44
44
  begin
45
- v = `cd #{path.to_s}&&svn info|grep Revision`.to_s.gsub!(/\D/, "") if (v !~ /^\d/)
45
+ v = `cd #{path.to_s} && svn info 2>/dev/null | grep Revision`.to_s.gsub!(/\D/, "") if (v !~ /^\d/)
46
46
  rescue
47
47
  end
48
48
  v = "0.0.0" if v !~ /^\d/
@@ -30,7 +30,8 @@ module Pkgr
30
30
  def target
31
31
  {
32
32
  "centos-6" => "el:6",
33
- "centos-7" => "el:7"
33
+ "centos-7" => "el:7",
34
+ "centos-8" => "el:8"
34
35
  }.fetch(slug, slug.sub("-", ":"))
35
36
  end
36
37
 
@@ -14,7 +14,7 @@ module Pkgr
14
14
 
15
15
  def runner
16
16
  @runner ||= case release
17
- when /^8/, /^9/
17
+ when /^8/, /^9/, /^10/
18
18
  Runner.new("systemd", "default", "systemctl")
19
19
  else
20
20
  Runner.new("sysv", "lsb-3.1", "update-rc.d")
@@ -11,10 +11,10 @@ module Pkgr
11
11
 
12
12
  def runner
13
13
  @runner ||= case release
14
- when /^16.04/
15
- Runner.new("systemd", "default", "systemctl")
16
- else
14
+ when /^12.04/, /^14.04/
17
15
  Runner.new("upstart", "1.5", "initctl")
16
+ else
17
+ Runner.new("systemd", "default", "systemctl")
18
18
  end
19
19
  end
20
20
 
data/lib/pkgr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pkgr
2
- VERSION = "1.6.0"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Rohr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -132,6 +132,8 @@ files:
132
132
  - data/buildpacks/amazon-2015
133
133
  - data/buildpacks/centos-6
134
134
  - data/buildpacks/centos-7
135
+ - data/buildpacks/centos-8
136
+ - data/buildpacks/debian-10
135
137
  - data/buildpacks/debian-6
136
138
  - data/buildpacks/debian-7
137
139
  - data/buildpacks/debian-8
@@ -143,6 +145,8 @@ files:
143
145
  - data/buildpacks/ubuntu-12.04
144
146
  - data/buildpacks/ubuntu-14.04
145
147
  - data/buildpacks/ubuntu-16.04
148
+ - data/buildpacks/ubuntu-18.04
149
+ - data/buildpacks/ubuntu-20.04
146
150
  - data/cli/cli.sh.erb
147
151
  - data/dependencies/amazon.yml
148
152
  - data/dependencies/centos.yml
@@ -215,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
219
  version: '1.3'
216
220
  requirements: []
217
221
  rubyforge_project:
218
- rubygems_version: 2.6.11
222
+ rubygems_version: 2.7.9
219
223
  signing_key:
220
224
  specification_version: 4
221
225
  summary: Package any Ruby, NodeJS or Go app as a deb or rpm package