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