]>
Commit | Line | Data |
---|---|---|
289fa4b8 ER |
1 | # NOTE: |
2 | # - release notes: https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md | |
2f2a2f85 ER |
3 | Summary: Provisioning and deployment of virtual instances |
4 | Name: vagrant | |
8d17cacc | 5 | Version: 1.7.4 |
07cec447 | 6 | Release: 4 |
2f2a2f85 ER |
7 | License: MIT |
8 | Group: Applications/Emulators | |
739d81cd | 9 | Source0: https://github.com/mitchellh/vagrant/archive/v%{version}/%{name}-%{version}.tar.gz |
8d17cacc | 10 | # Source0-md5: 556b5e5594a327d46b63c4d8024db187 |
2fe4e4ef | 11 | Source1: %{name}.sh |
1539a824 ER |
12 | Patch1: rubygems.patch |
13 | Patch2: no-warning.patch | |
3ab7a71b | 14 | Patch3: Vagrantfile.patch |
423e25f8 | 15 | Patch4: version.patch |
a1db8c22 | 16 | Patch5: no-gems.patch |
ab6f2b85 | 17 | Patch6: checkpoint.patch |
af8dd7b7 | 18 | Patch7: insert-key.patch |
86f0f949 | 19 | Patch8: listen.patch |
28281fb4 | 20 | Patch9: pld-chef-installed.patch |
e775e16d | 21 | Patch10: pld-networking.patch |
30485291 | 22 | URL: http://www.vagrantup.com/ |
844c04d1 | 23 | BuildRequires: bash |
ccb4e738 | 24 | BuildRequires: rpm-rubyprov |
4619d17a | 25 | BuildRequires: ruby > 1:2.0 |
0876e579 | 26 | %if %{with tests} |
1539a824 ER |
27 | BuildRequires: ruby-contest >= 0.1.2 |
28 | BuildRequires: ruby-minitest >= 2.5.1 | |
29 | BuildRequires: ruby-mocha | |
30 | BuildRequires: ruby-rake | |
0876e579 ER |
31 | BuildRequires: ruby-rspec >= 2.14.0 |
32 | %endif | |
91fbc1b0 | 33 | Requires: bsdtar |
7aa78a1a | 34 | Requires: curl |
cec5282a ER |
35 | Requires: ruby-bundler >= 1.5.2 |
36 | Requires: ruby-childprocess >= 0.5.0 | |
1539a824 ER |
37 | Requires: ruby-erubis >= 2.7.0 |
38 | Requires: ruby-i18n >= 0.6.0 | |
37fd54cc | 39 | Requires: ruby-json |
86f0f949 | 40 | Requires: ruby-listen >= 2.7.11 |
cec5282a | 41 | Requires: ruby-log4r < 1.1.11 |
844c04d1 | 42 | Requires: ruby-log4r >= 1.1.9 |
1539a824 | 43 | Requires: ruby-net-scp >= 1.1.0 |
0876e579 | 44 | Requires: ruby-net-ssh < 2.8.0 |
1539a824 ER |
45 | Requires: ruby-net-ssh >= 2.6.6 |
46 | Requires: ruby-rubygems | |
89ea5f16 | 47 | Suggests: VirtualBox |
89565a92 ER |
48 | Suggests: VirtualBox-gui |
49 | Suggests: rdesktop | |
a668c701 | 50 | Suggests: rsync |
1539a824 | 51 | BuildArch: noarch |
32f7fb06 ER |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
53 | ||
1539a824 | 54 | %define _appdir %{_datadir}/%{name} |
196c9fce | 55 | %define bash_compdir %{_datadir}/bash-completion/completions |
32f7fb06 | 56 | |
d9278297 | 57 | %define vg_home /home/vagrant |
289fa4b8 | 58 | %define vg_root /vagrant |
d9278297 | 59 | |
2f2a2f85 ER |
60 | %description |
61 | Vagrant offers scripted provisioning and deployment of virtual | |
62 | instances. While VirtualBox is the main target, future versions may | |
63 | support other hypervizors as well. | |
64 | ||
65 | The vision of the project is to create a tool to transparently manage | |
66 | all the complex parts of modern development within a virtual | |
67 | environment without affecting the everyday workflow of the developer | |
68 | too much. A long term goal is moving all development into virtualized | |
69 | environments by making it easier to do so than not to. Additionally, | |
70 | work is ongoing to have Vagrant run identically on every major | |
71 | consumer OS platform (Linux, Mac OS X, and Windows). | |
72 | ||
ff67adbf ER |
73 | %package -n bash-completion-%{name} |
74 | Summary: bash-completion for %{name} | |
75 | Group: Applications/Shells | |
76 | Requires: %{name} | |
196c9fce | 77 | Requires: bash-completion >= 2.0 |
ff67adbf ER |
78 | |
79 | %description -n bash-completion-%{name} | |
80 | bash-completion for %{name}. | |
81 | ||
d9278297 ER |
82 | %package guest |
83 | Summary: Vagrant guest | |
84 | Group: Development/Building | |
062cfa5f | 85 | URL: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html |
d9278297 ER |
86 | Requires(postun): /usr/sbin/userdel |
87 | Requires(pre): /bin/id | |
88 | Requires(pre): /usr/bin/getgid | |
89 | Requires(pre): /usr/sbin/groupadd | |
90 | Requires(pre): /usr/sbin/useradd | |
bf59fba0 | 91 | Requires: /etc/pld-release |
062cfa5f | 92 | Requires: kernel(vboxsf) |
d9278297 | 93 | Requires: openssh-server |
30485291 | 94 | Requires: sudo >= 1.7.4p3-2 |
cee8b635 | 95 | Requires: which |
d9278297 ER |
96 | Provides: group(vagrant) |
97 | Provides: user(vagrant) | |
d9278297 ER |
98 | |
99 | %description guest | |
100 | This is the package to be installed in Vagrant guest. | |
101 | ||
102 | WARNING: This package installs insecure keypair to vagant user. Do not | |
103 | install this package in a box that is accessible others but you. | |
104 | ||
105 | These keys are the "insecure" public/private keypair we offer to base | |
106 | box creators for use in their base boxes so that vagrant installations | |
107 | can automatically SSH into the boxes. | |
108 | ||
109 | See: <https://github.com/mitchellh/vagrant/tree/master/keys/>. | |
110 | ||
2f2a2f85 ER |
111 | %package doc |
112 | Summary: Documentation for %{name} | |
113 | Group: Documentation | |
114 | Requires: %{name} = %{version}-%{release} | |
2f2a2f85 ER |
115 | |
116 | %description doc | |
117 | Ruby documentation for %{gem_name} | |
118 | ||
119 | %prep | |
1539a824 | 120 | %setup -q |
1539a824 ER |
121 | %patch1 -p1 |
122 | %patch2 -p1 | |
ca9ac262 | 123 | %patch3 -p1 |
423e25f8 | 124 | %patch4 -p1 |
a1db8c22 | 125 | %patch5 -p1 |
ab6f2b85 | 126 | %patch6 -p1 |
af8dd7b7 | 127 | %patch7 -p1 |
86f0f949 | 128 | %patch8 -p1 |
28281fb4 | 129 | %patch9 -p1 |
e775e16d | 130 | %patch10 -p1 |
423e25f8 ER |
131 | |
132 | VERSION=$(cat version.txt) | |
133 | sed -i -e "s/__VERSION__/$VERSION/" lib/vagrant/version.rb | |
a08aa0c6 | 134 | |
196c9fce ER |
135 | # cleanup backups after patching |
136 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
137 | ||
6773f50c ER |
138 | %build |
139 | # make gemspec self-contained | |
140 | ruby -r rubygems -e 'spec = eval(File.read("%{name}.gemspec")) | |
141 | File.open("%{name}-%{version}.gemspec", "w") do |file| | |
142 | file.puts spec.to_ruby_for_cache | |
143 | end' | |
144 | ||
2f2a2f85 ER |
145 | %install |
146 | rm -rf $RPM_BUILD_ROOT | |
be655f4d ER |
147 | install -d $RPM_BUILD_ROOT{%{ruby_gemdir}/gems/%{name}-%{version},%{ruby_specdir},%{_bindir}} |
148 | cp -a lib bin keys plugins templates $RPM_BUILD_ROOT%{ruby_gemdir}/gems/%{name}-%{version} | |
6773f50c | 149 | cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} |
2fe4e4ef | 150 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name} |
062cfa5f | 151 | |
196c9fce | 152 | install -d $RPM_BUILD_ROOT%{bash_compdir} |
844c04d1 | 153 | cp -p contrib/bash/completion.sh $RPM_BUILD_ROOT%{bash_compdir}/%{name} |
ff67adbf | 154 | |
d9278297 | 155 | # guest |
cc40b6fa ER |
156 | install -d $RPM_BUILD_ROOT/etc/sudoers.d |
157 | echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > $RPM_BUILD_ROOT/etc/sudoers.d/%{name} | |
158 | ||
289fa4b8 | 159 | install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh} |
844c04d1 | 160 | cp -p /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home} |
2f2a2f85 | 161 | |
062cfa5f ER |
162 | # Since Vagrant only supports key-based authentication for SSH, we must |
163 | # set up the vagrant user to use key-based authentication. We can get the | |
164 | # public key used by the Vagrant gem directly from its Github repository. | |
1539a824 | 165 | cp -p keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys |
062cfa5f | 166 | |
2f2a2f85 ER |
167 | %clean |
168 | rm -rf $RPM_BUILD_ROOT | |
169 | ||
d9278297 | 170 | %pre guest |
42a30f36 ER |
171 | %groupadd -g 291 vagrant |
172 | %useradd -u 291 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant | |
d9278297 ER |
173 | |
174 | %postun guest | |
175 | if [ "$1" = "0" ]; then | |
176 | %userremove vagrant | |
177 | %groupremove vagrant | |
178 | fi | |
179 | ||
2f2a2f85 ER |
180 | %files |
181 | %defattr(644,root,root,755) | |
182 | %attr(755,root,root) %{_bindir}/vagrant | |
be655f4d ER |
183 | #%{ruby_vendorlibdir}/vagrant.rb |
184 | #%{ruby_vendorlibdir}/vagrant | |
185 | #%{_appdir} | |
186 | ||
187 | %dir %{ruby_gemdir}/gems/%{name}-%{version} | |
188 | %dir %{ruby_gemdir}/gems/%{name}-%{version}/bin | |
189 | %attr(755,root,root) %{ruby_gemdir}/gems/%{name}-%{version}/bin/* | |
190 | %{ruby_gemdir}/gems/%{name}-%{version}/keys | |
191 | %{ruby_gemdir}/gems/%{name}-%{version}/lib | |
192 | %{ruby_gemdir}/gems/%{name}-%{version}/plugins | |
193 | %{ruby_gemdir}/gems/%{name}-%{version}/templates | |
194 | ||
6773f50c | 195 | %{ruby_specdir}/%{name}-%{version}.gemspec |
d9278297 | 196 | |
ff67adbf ER |
197 | %files -n bash-completion-%{name} |
198 | %defattr(644,root,root,755) | |
196c9fce | 199 | %{bash_compdir}/%{name} |
ff67adbf | 200 | |
d9278297 ER |
201 | %files guest |
202 | %defattr(644,root,root,755) | |
cc40b6fa | 203 | %attr(440,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/%{name} |
d9278297 ER |
204 | %dir %attr(750,vagrant,vagrant) %{vg_home} |
205 | %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh | |
062cfa5f | 206 | %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys |
d9278297 | 207 | %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash* |
289fa4b8 | 208 | %dir %attr(700,root,root) %{vg_root} |
32f7fb06 ER |
209 | |
210 | %if 0 | |
2f2a2f85 ER |
211 | %files doc |
212 | %defattr(644,root,root,755) | |
213 | %doc %{gem_docdir} | |
32f7fb06 | 214 | %endif |