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