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