image_optim_pack 0.10.1.20240317-x86_64-darwin → 0.11.1-x86_64-darwin

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
2
  SHA256:
3
- metadata.gz: 01d8667dbc1dcd30cb68ff1b7ac65eed2a06469ebd31ed3d2bb21e59871c92ff
4
- data.tar.gz: bdf4005c0b367d3f848e3309056ab94da060b7618a9d8b6b83bb18b4389b909e
3
+ metadata.gz: 2c4418a82fab458305d0062a5171ea1241b340677b3699aaf7359866bdecf953
4
+ data.tar.gz: 5319cd849bc679b2ca2cc5050cc6e7368abcf13719fc3faea74b8b9ba10ece9e
5
5
  SHA512:
6
- metadata.gz: 48bf33a79aced3505477b280c3fd7b3ce0363051c69153e1ee667a204aec86ce95b5f6774317c3bbffff0b3f041dd9edb66335cb085b6c7f366985d86bcfabce
7
- data.tar.gz: 3a5685761146e9d6b0e58dad374bc8137f1df636b445e4733ff40ea7e4149646a0975899c52bd77494acfb9671f110412677385ed1d70a301bf99ac79f9832f3
6
+ metadata.gz: 93ce888d8df6cfa1a3f242043e75aea7e2d84b0b831fdf25fe31cc6f797fb80c9aa89445b46224e03b9c009b16b98c68660f366e75306f16136e37f25ab764b5
7
+ data.tar.gz: 10d588e13b5a1df44119b0a954c758dd69afe5131b2ad81fd4ca31ea27a17c15f16d34aee9265ac581825ada1eb1305b867e2919d3a1e89f252328549acf0190
@@ -11,15 +11,13 @@ jobs:
11
11
  matrix:
12
12
  os:
13
13
  - ubuntu-latest
14
- - macos-latest
14
+ - macos-13
15
15
  ruby:
16
- - '2.6'
17
16
  - '2.7'
18
17
  - '3.0'
19
18
  - '3.1'
20
19
  - '3.2'
21
20
  - '3.3'
22
- - jruby-9.3
23
21
  - jruby-9.4
24
22
  fail-fast: false
25
23
  steps:
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /build/
2
2
  /download/
3
- /.vagrant/
4
3
 
5
4
  Gemfile.lock
6
5
  /*.gem
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.11.1 (2024-05-09)
6
+
7
+ * Use oldest maintained debian buster instead of newest bookworm for building linux binaries [@toy](https://github.com/toy)
8
+
9
+ ## v0.11.0 (2024-05-05)
10
+
11
+ * Use container instead of vagrant to build linux binaries [@toy](https://github.com/toy)
12
+ * oxipng 9.1.1 [@toy](https://github.com/toy)
13
+
5
14
  ## v0.10.1.20240317 (2024-03-17)
6
15
 
7
16
  * gifsicle 1.95 [@toy](https://github.com/toy)
data/Dockerfile CHANGED
@@ -120,8 +120,10 @@ FROM libpng as pngcrush
120
120
  ARG PNGCRUSH_VER
121
121
  ARG PNGCRUSH_SHA256
122
122
  COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
123
+ COPY patches/pngcrush.patch patches/
123
124
  RUN ./extract pngcrush && \
124
125
  cd build/pngcrush && \
126
+ patch < ../../patches/pngcrush.patch && \
125
127
  make && \
126
128
  install -c pngcrush /usr/local/bin
127
129
 
data/Dockerfile.debian CHANGED
@@ -120,8 +120,10 @@ FROM libpng as pngcrush
120
120
  ARG PNGCRUSH_VER
121
121
  ARG PNGCRUSH_SHA256
122
122
  COPY download/pngcrush-$PNGCRUSH_VER.tar.gz download/
123
+ COPY patches/pngcrush.patch patches/
123
124
  RUN ./extract pngcrush && \
124
125
  cd build/pngcrush && \
126
+ patch < ../../patches/pngcrush.patch && \
125
127
  make && \
126
128
  install -c pngcrush /usr/local/bin
127
129
 
data/Makefile CHANGED
@@ -13,7 +13,7 @@ LIBMOZJPEG_VER := 4.1.5
13
13
  LIBPNG_VER := 1.6.43
14
14
  LIBZ_VER := 1.2.11
15
15
  OPTIPNG_VER := 0.7.8
16
- OXIPNG_VER := 9.0.0
16
+ OXIPNG_VER := 9.1.1
17
17
  PNGCRUSH_VER := 1.8.13
18
18
  PNGOUT_VER := 20200115
19
19
  PNGOUT_LINUX_VER := $(PNGOUT_VER)
@@ -45,6 +45,8 @@ OUTPUT_ROOT_DIR := $(CURDIR)/vendor
45
45
  OUTPUT_DIR := $(OUTPUT_ROOT_DIR)/$(OS)-$(ARCH)
46
46
  PATCHES_DIR := $(CURDIR)/patches
47
47
 
48
+ export CARGO_HOME := $(DL_DIR)/cargo
49
+
48
50
  ANSI_RED=\033[31m
49
51
  ANSI_GREEN=\033[32m
50
52
  ANSI_MAGENTA=\033[35m
@@ -113,6 +115,10 @@ $(eval $(call archive-dl,PNGQUANT, https://pngquant.org/pngquant-[VER]-src.ta
113
115
  download : $(foreach archive,$(ARCHIVES),$($(archive)_ARC))
114
116
  .PHONY : download
115
117
 
118
+ download-dependencies : $(OXIPNG_EXTRACTED)
119
+ cd $(OXIPNG_DIR) && cargo fetch --locked
120
+ .PHONY : download-dependencies
121
+
116
122
  download-tidy-up :
117
123
  rm -f $(filter-out $(foreach archive,$(ARCHIVES),$($(archive)_ARC)),$(wildcard $(DL_DIR)/*.*))
118
124
  .PHONY : download-tidy-up
@@ -270,6 +276,7 @@ test :
270
276
  update-versions :
271
277
  script/livecheck --update
272
278
  make checksum-update
279
+ make download-dependencies
273
280
  .PHONY : update-versions
274
281
 
275
282
  # ====== DOCKER ======
@@ -411,7 +418,7 @@ $(JHEAD_TARGET) :
411
418
  ## jpeg-recompress
412
419
  $(eval $(call depend-build,JPEG-RECOMPRESS,LIBMOZJPEG))
413
420
  $(JPEG-RECOMPRESS_TARGET) :
414
- cd $(DIR) && $(MAKE) jpeg-recompress CC="$(CC) $(CFLAGS)" LIBJPEG=$(LIBMOZJPEG_TARGET) \
421
+ cd $(DIR) && $(MAKE) jpeg-recompress CC="$(CC) $(CFLAGS) -fcommon" LIBJPEG=$(LIBMOZJPEG_TARGET) \
415
422
  MAKE=$(MAKE) # fix for bsd in jpeg-archive-2.1.1
416
423
 
417
424
  ## jpegoptim
@@ -490,7 +497,7 @@ $(OPTIPNG_TARGET) :
490
497
 
491
498
  ## oxipng
492
499
  $(OXIPNG_TARGET) :
493
- cd $(DIR) && cargo build --release --locked
500
+ cd $(DIR) && cargo build --release --frozen --offline
494
501
 
495
502
  ## pngcrush
496
503
  $(eval $(call depend,PNGCRUSH,LIBPNG LIBZ))
data/README.markdown CHANGED
@@ -70,9 +70,7 @@ gem 'image_optim_pack'
70
70
 
71
71
  ## Development
72
72
 
73
- Mac OS X binaries and libraries are built on host, others using [vagrant](https://www.vagrantup.com/).
74
-
75
- Boxes for vagrant are built using [veewee](https://github.com/jedi4ever/veewee), check [boxes/Rakefile](boxes/Rakefile) and [boxes/definitions](boxes/definitions).
73
+ Mac OS X binaries and libraries are built on host, others using containers.
76
74
 
77
75
  ```sh
78
76
  script/run # Build and test all for all oses and architectures
data/checksums.mk CHANGED
@@ -9,7 +9,7 @@ LIBMOZJPEG_SHA256 := 9fcbb7171f6ac383f5b391175d6fb3acde5e64c4c4727274eade84ed099
9
9
  LIBPNG_SHA256 := e804e465d4b109b5ad285a8fb71f0dd3f74f0068f91ce3cdfde618180c174925
10
10
  LIBZ_SHA256 := c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
11
11
  OPTIPNG_SHA256 := 25a3bd68481f21502ccaa0f4c13f84dcf6b20338e4c4e8c51f2cefbd8513398c
12
- OXIPNG_SHA256 := 534fa8f349f52b01c2ee4332cef25ce1311edca04209ac6d972e38b171550a1b
12
+ OXIPNG_SHA256 := f50db90c7ef95c0964dc980f6596b821f362e15d6d4bab247f1eb4aab7554db8
13
13
  PNGCRUSH_SHA256 := fed0aaf5c098aa8c7f78c75365cd18d7341417326ecbdba547876b7b4f3df4be
14
14
  PNGOUT_LINUX_SHA256 := ac38bba6f0de29033de866538c3afa64341319b695bbe388efbc5fd9e830e928
15
15
  PNGOUT_LINUX_STATIC_SHA256 := 7a78ea475d65a00981bf418e5dfa3b34e42d6460fb992340802873bb14b08597
@@ -2,8 +2,8 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim_pack'
5
- s.version = '0.10.1.20240317'
6
- s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, pngcrush, pngquant}
5
+ s.version = '0.11.1'
6
+ s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, oxipng, pngcrush, pngout, pngquant}
7
7
  s.homepage = "https://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
9
9
  s.license = 'MIT'
data/script/livecheck CHANGED
@@ -122,8 +122,13 @@ class Livecheck
122
122
  def update_changelog
123
123
  changelog = FSPath('CHANGELOG.markdown')
124
124
  lines = changelog.readlines
125
- lines.insert(4, "\n") if lines[4] =~ /^## /
126
- lines.insert(4, changelog_entry)
125
+ i = 4
126
+ if lines[i] =~ /^## /
127
+ lines.insert(i, "\n")
128
+ else
129
+ i += 1 while lines[i] =~ /^\* /
130
+ end
131
+ lines.insert(i, changelog_entry)
127
132
  write(changelog, lines.join(''))
128
133
  end
129
134
 
@@ -5,7 +5,10 @@ require 'gems'
5
5
  require 'ostruct'
6
6
  require 'terminal-table'
7
7
 
8
- versions = Gems.versions('image_optim_pack').map(&OpenStruct.method(:new)) # rubocop:disable Style/OpenStructUse
8
+ versions = Gems.versions('image_optim_pack').map do |attributes|
9
+ attributes['number'] = Gem::Version.new(attributes['number'])
10
+ OpenStruct.new(attributes) # rubocop:disable Style/OpenStructUse
11
+ end
9
12
 
10
13
  platforms = versions.map(&:platform).uniq.sort_by do |platform|
11
14
  platform.sub('amd64', 'x86_64').split('-').reverse
data/script/run CHANGED
@@ -1,9 +1,7 @@
1
- #!/usr/bin/env bash
1
+ #!/usr/bin/env bash -e
2
2
 
3
3
  # Build tools on Mac OS X host and in all vms
4
4
 
5
- set -e
6
-
7
5
  MAKE_TASK='all -j'
8
6
 
9
7
  filters=()
@@ -29,6 +27,8 @@ if [[ $(uname -s) != 'Darwin' ]]; then
29
27
  exit 1
30
28
  fi
31
29
 
30
+ make download-dependencies
31
+
32
32
  for arch in x86_64; do
33
33
  platform="darwin-$arch"
34
34
  passes-filter "$platform" || continue
@@ -38,53 +38,85 @@ for arch in x86_64; do
38
38
 
39
39
  mkdir -p "vendor/$platform"
40
40
 
41
- sudo -u _image_optim --set-home bash -c "
42
- set -e
41
+ rsync -aR --del Makefile checksums.mk download patches "$build_dir"
43
42
 
43
+ sudo -u _image_optim --set-home bash -exc "
44
44
  mkdir -p '$build_dir'
45
45
  cd '$build_dir'
46
46
 
47
- ln -nsf '$PWD/Makefile' '$PWD/checksums.mk' '$PWD/download' '$PWD/patches' .
48
- rsync -aR --del '$PWD/./vendor/$platform' .
49
-
50
47
  make $MAKE_TASK ARCH=$arch
51
48
  "
52
49
 
53
50
  rsync -aR --del "$build_dir/./vendor/$platform" .
54
51
  done
55
52
 
56
- for vm in $(perl -pe "s/.*?'(.+?-.+?)'\s+=>\s+'.+?\/.+?'.*|.*/\$1/" Vagrantfile | uniq); do
57
- passes-filter "$vm" || continue
58
- header "$vm"
53
+ if command -v docker &> /dev/null; then
54
+ container_tool="docker"
55
+ elif command -v podman &> /dev/null; then
56
+ container_tool="podman"
57
+ else
58
+ echo "neither docker nor podman found"
59
+ exit 1
60
+ fi
59
61
 
60
- if [[ -z "$NO_UP" ]]; then
61
- vagrant status "$vm" | grep -q running || vagrant up "$vm"
62
- fi
62
+ container_build() {
63
+ vm=$1
64
+ image=$2
65
+
66
+ passes-filter "$vm" || return 0
67
+ header "$vm"
63
68
 
64
- # create ssh config
65
- ssh_config=".vagrant/ssh_config.$vm"
66
- vagrant ssh-config "$vm" > "$ssh_config"
69
+ container_name="image_optim_pack-build-$vm"
70
+ workdir=/pack
67
71
 
68
- # rsync needed files to the box
69
- mkdir -p "vendor/$vm"
70
- rsync -e "ssh -F $ssh_config" -aR --del Makefile checksums.mk download patches "vendor/$vm" "$vm:/vagrant"
72
+ if [[ -z "$NO_UP" ]]; then
73
+ status=$("$container_tool" inspect --format '{{.State.Status}}' "$container_name" 2>/dev/null || true)
74
+
75
+ if [[ "$status" == "" ]]; then
76
+ mount="./_path_:$workdir/_path_"
77
+
78
+ "$container_tool" \
79
+ container create \
80
+ --name="$container_name" \
81
+ --stop-signal SIGHUP \
82
+ -it \
83
+ -v "${mount//_path_/}:ro" \
84
+ -v "${mount//_path_/build/$vm}" \
85
+ -v "${mount//_path_/vendor/$vm}" \
86
+ --workdir "$workdir" \
87
+ "$image"
88
+
89
+ "$container_tool" container start "$container_name"
90
+
91
+ "$container_tool" exec -it "$container_name" bash -exc "
92
+ apt update
93
+ apt -y install make gcc g++ chrpath perl pkg-config autoconf automake libtool nasm cmake patch
94
+ "
95
+ fi
71
96
 
72
- # sync time and run make
73
- ssh -F "$ssh_config" "$vm" "
74
- set -e
97
+ if [[ "$status" = @(created|exited) ]]; then
98
+ "$container_tool" container start "$container_name"
99
+ fi
75
100
 
76
- sudo ntpdate pool.ntp.org
101
+ if [[ "$status" = @(created|exited|running) ]]; then
102
+ "$container_tool" exec -it "$container_name" bash -exc "
103
+ apt update
104
+ apt -y dist-upgrade
105
+ rustup update
106
+ "
107
+ fi
77
108
 
78
- cd /vagrant
79
- if make -v 2>&1 | grep -q GNU\ Make; then
80
- make $MAKE_TASK
81
- else
82
- gmake $MAKE_TASK
109
+ if ! [[ "$status" = @(|created|exited|running) ]]; then
110
+ echo "unexpected status $status"
111
+ exit 1
83
112
  fi
113
+ fi
114
+
115
+ "$container_tool" exec -it "$container_name" bash -exc "
116
+ make $MAKE_TASK
84
117
  "
85
118
 
86
- # rsync files in vendor from the box
87
- rsync -e "ssh -F $ssh_config" -aR --del "$vm:/vagrant/./vendor/$vm" .
119
+ [[ -n "$NO_HALT" ]] || "$container_tool" container stop "$container_name"
120
+ }
88
121
 
89
- [[ -n "$NO_HALT" ]] || vagrant halt "$vm"
90
- done
122
+ container_build linux-x86_64 rust:slim-buster
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_optim_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1.20240317
4
+ version: 0.11.1
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Ivan Kuchin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-17 00:00:00.000000000 Z
11
+ date: 2024-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: image_optim
@@ -112,7 +112,6 @@ files:
112
112
  - LICENSE.txt
113
113
  - Makefile
114
114
  - README.markdown
115
- - Vagrantfile
116
115
  - acknowledgements/7z.txt
117
116
  - acknowledgements/advancecomp.txt
118
117
  - acknowledgements/bmp2png.txt
@@ -139,13 +138,6 @@ files:
139
138
  - acknowledgements/zlib.txt
140
139
  - acknowledgements/zopfli-contributors.txt
141
140
  - acknowledgements/zopfli.txt
142
- - boxes/.gitignore
143
- - boxes/.rubocop.yml
144
- - boxes/Gemfile
145
- - boxes/Rakefile
146
- - boxes/definitions/centos-amd64/definition.rb
147
- - boxes/definitions/centos-amd64/ks.cfg
148
- - boxes/definitions/centos-postinstall.sh
149
141
  - checksums.mk
150
142
  - image_optim_pack-darwin-x86_64.gemspec
151
143
  - image_optim_pack-linux-x86_64.gemspec
@@ -181,7 +173,7 @@ licenses:
181
173
  metadata:
182
174
  bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
183
175
  changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
184
- documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.10.1.20240317
176
+ documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.11.1
185
177
  source_code_uri: https://github.com/toy/image_optim_pack
186
178
  post_install_message:
187
179
  rdoc_options: []
@@ -202,7 +194,7 @@ rubygems_version: 3.5.5
202
194
  signing_key:
203
195
  specification_version: 4
204
196
  summary: 'Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress,
205
- jpegoptim, jpegtran, optipng, pngcrush, pngquant'
197
+ jpegoptim, jpegtran, optipng, oxipng, pngcrush, pngout, pngquant'
206
198
  test_files:
207
199
  - spec/image_optim/pack_spec.rb
208
200
  - spec/image_optim_spec.rb
data/Vagrantfile DELETED
@@ -1,61 +0,0 @@
1
- Vagrant.configure('2') do |config|
2
- # don't mess with keys
3
- config.ssh.insert_key = false
4
-
5
- # doesn't make sense to check updates for local boxes
6
- config.vm.box_check_update = false
7
-
8
- # there are no guest additions
9
- config.vm.provider 'virtualbox' do |vb|
10
- vb.check_guest_additions = false
11
- vb.customize ['modifyvm', :id, '--groups', '/image_optim']
12
- vb.customize ['modifyvm', :id, '--uartmode1', 'disconnected'] # override for ubuntu/xenial32
13
- end
14
-
15
- # handle manually using rsync
16
- config.vm.synced_folder '.', '/vagrant', disabled: true
17
-
18
- {
19
- 'linux-x86_64' => 'boxes/centos-amd64.box',
20
- }.each do |name, location|
21
- config.vm.define name do |machine|
22
- machine.vm.hostname = name.gsub('_', '-')
23
- machine.vm.box = location
24
-
25
- machine.vm.provision :shell, inline: <<-SH
26
- if command -v apt-get; then
27
- set -ex
28
-
29
- apt-get update
30
- apt-get -y install rsync ntpdate make wget gcc g++ chrpath perl pkg-config autoconf automake libtool nasm cmake cargo patch
31
- apt-get -y remove unattended-upgrades
32
- else
33
- set -ex
34
-
35
- yum -y install epel-release
36
- yum -y install rsync ntpdate make wget gcc gcc-c++ chrpath perl pkg-config autoconf automake libtool nasm cmake cargo patch
37
- fi
38
-
39
- mkdir -p /vagrant
40
- chown vagrant:vagrant /vagrant
41
- SH
42
-
43
- machine.vm.provision :shell, run: 'always', inline: <<-SH
44
- if command -v apt-get; then
45
- set -ex
46
-
47
- apt-get update
48
- apt-get -y dist-upgrade
49
-
50
- if [ $(lsb_release -r | egrep -o '[0-9]+' | head -1) -lt 18 ]; then
51
- do-release-upgrade -f DistUpgradeViewNonInteractive
52
- fi
53
- else
54
- set -ex
55
-
56
- yum -y update
57
- fi
58
- SH
59
- end
60
- end
61
- end
data/boxes/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- /*.box
2
- /.env
3
- /iso/
data/boxes/.rubocop.yml DELETED
@@ -1,10 +0,0 @@
1
- inherit_from: ../.rubocop.yml
2
-
3
- Layout/LineLength:
4
- Enabled: false
5
-
6
- Lint/RedundantSplatExpansion:
7
- Enabled: false
8
-
9
- Security/Eval:
10
- Exclude: [Rakefile]
data/boxes/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gem 'rake'
6
-
7
- gem 'veewee', '= 0.4.5.1'
8
-
9
- gem 'net-scp'
10
- gem 'progressbar', '~> 0.21.0'
data/boxes/Rakefile DELETED
@@ -1,88 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pathname'
4
-
5
- class Box # :nodoc:
6
- attr_reader :definition_path, :definition_dir, :name, :path, :groups
7
-
8
- def initialize(definition_path)
9
- @definition_path = Pathname(definition_path)
10
- @definition_dir = @definition_path.dirname
11
- @name = @definition_dir.basename.to_s
12
- @path = Pathname("#{@name}.box")
13
- parts = @name.split('-')
14
- @groups = (1...parts.length).map{ |n| parts.take(n).join('-') }
15
- end
16
-
17
- def dependencies
18
- postinstall_file_paths = Array(definition[:postinstall_files]).map do |path|
19
- definition_dir + path
20
- end
21
- [definition_path] + postinstall_file_paths
22
- end
23
-
24
- def build
25
- sh(*%W[veewee vbox build --auto --checksum --force --nogui #{name}])
26
- sh(*%w[sleep 30])
27
- sh(*%W[veewee vbox export --force #{name}])
28
- sh(*%W[veewee vbox destroy #{name}])
29
- end
30
-
31
- def add
32
- assert_box_created
33
-
34
- sh(*%W[vagrant box add --force --name boxes/#{path} #{path}])
35
- end
36
-
37
- private
38
-
39
- def definition
40
- @definition ||= eval definition_path.read.sub('Veewee::Session.declare', '{}.merge')
41
- end
42
-
43
- def assert_box_created
44
- abort "#{path} doesn't exist" unless path.size?
45
- end
46
-
47
- def sh(*args)
48
- abort unless system(*args)
49
- end
50
- end
51
-
52
- Dir['definitions/*/definition.rb'].each do |definition_path|
53
- box = Box.new(definition_path)
54
-
55
- desc "build #{box.name} box"
56
- file box.path => box.dependencies do
57
- box.build
58
- end
59
-
60
- namespace :add do
61
- desc "add #{box.name} box to vagrant"
62
- task box.name => box.path do
63
- box.add
64
- end
65
- end
66
-
67
- box.groups.each do |group|
68
- desc "build #{group} boxes"
69
- task "build:#{group}" => box.path
70
-
71
- desc "add #{group} boxes to vagrant"
72
- task "add:#{group}" => "add:#{box.name}"
73
- end
74
-
75
- desc 'build all boxes'
76
- task build: box.path
77
-
78
- desc 'add all boxes to vagrant'
79
- task add: "add:#{box.name}"
80
- end
81
-
82
- desc 'remove *.box and iso dir'
83
- task :clean do
84
- sh 'rm *.box || true'
85
- sh 'rm -r iso || true'
86
- end
87
-
88
- task default: :build
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Veewee::Session.declare({
4
- cpu_count: '1',
5
- memory_size: '512',
6
- disk_size: '8192',
7
- disk_format: 'VDI',
8
- hostiocache: 'off',
9
- os_type_id: 'RedHat6_64',
10
- iso_file: 'CentOS-7-x86_64-Minimal-2009.iso',
11
- iso_src: 'http://linux.darkpenguin.net/distros/CentOS/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso',
12
- iso_sha256: '07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a',
13
- iso_download_timeout: '1000',
14
- boot_wait: '10',
15
- boot_cmd_sequence: [
16
- '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>',
17
- ],
18
- kickstart_port: '7122',
19
- kickstart_timeout: '300',
20
- kickstart_file: 'ks.cfg',
21
- ssh_login_timeout: '10000',
22
- ssh_user: 'veewee',
23
- ssh_password: 'veewee',
24
- ssh_key: '',
25
- ssh_host_port: '7222',
26
- ssh_guest_port: '22',
27
- sudo_cmd: "echo '%p'|sudo -S sh '%f'",
28
- shutdown_cmd: '/sbin/halt -h -p',
29
- postinstall_files: %w[../centos-postinstall.sh],
30
- postinstall_timeout: '10000',
31
- skip_iso_transfer: true,
32
- })
@@ -1,37 +0,0 @@
1
- install
2
- cdrom
3
- lang en_US.UTF-8
4
- keyboard us
5
- network --bootproto=dhcp
6
- rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
7
- firewall --enabled --service=ssh
8
- authconfig --enableshadow --passalgo=sha512
9
- selinux --disabled
10
- timezone UTC
11
- bootloader --location=mbr
12
-
13
- text
14
- skipx
15
- zerombr
16
-
17
- clearpart --all --initlabel
18
- autopart
19
-
20
- auth --useshadow --enablemd5
21
- firstboot --disabled
22
- reboot
23
-
24
- %packages --nobase
25
- @core
26
- openssh-clients
27
- %end
28
-
29
- %post
30
- /usr/bin/yum -y install sudo
31
- /usr/sbin/groupadd veewee
32
- /usr/sbin/useradd veewee -g veewee -G wheel
33
- echo "veewee"|passwd --stdin veewee
34
- echo "veewee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/veewee
35
- chmod 0440 /etc/sudoers.d/veewee
36
- %end
37
-
@@ -1,29 +0,0 @@
1
- set -ex
2
-
3
- sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
4
-
5
- yum -y install wget
6
-
7
- # Make ssh faster by not waiting on DNS
8
- echo "UseDNS no" >> /etc/ssh/sshd_config
9
-
10
- # Vagrant specific
11
- date > /etc/vagrant_box_build_time
12
-
13
- # Add vagrant user
14
- /usr/sbin/groupadd vagrant
15
- /usr/sbin/useradd vagrant -g vagrant -G wheel
16
- echo "vagrant"|passwd --stdin vagrant
17
- echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
18
- chmod 0440 /etc/sudoers.d/vagrant
19
-
20
- # Installing vagrant keys
21
- mkdir -pm 700 /home/vagrant/.ssh
22
- wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
23
- chmod 0600 /home/vagrant/.ssh/authorized_keys
24
- chown -R vagrant /home/vagrant/.ssh
25
-
26
- yum -y clean all
27
-
28
- # Zero out the free space to save space in the final image
29
- dd if=/dev/zero of=/filler bs=1M || rm /filler