]>
Commit | Line | Data |
---|---|---|
289fa4b8 ER |
1 | # NOTE: |
2 | # - release notes: https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md | |
d9278297 ER |
3 | # |
4 | # Conditional build: | |
5 | %bcond_without vagrant # build vagrant package | |
6 | ||
2f2a2f85 ER |
7 | Summary: Provisioning and deployment of virtual instances |
8 | Name: vagrant | |
77d9f457 | 9 | Version: 1.1.2 |
0a34a42c | 10 | Release: 0.10 |
2f2a2f85 ER |
11 | License: MIT |
12 | Group: Applications/Emulators | |
13 | URL: http://vagrantup.com/ | |
77d9f457 ER |
14 | Source0: http://files.vagrantup.com/packages/67bd4d30f7dbefa7c0abc643599f0244986c38c8/vagrant_i686.rpm?/%{name}-%{version}.i686.rpm |
15 | # Source0-md5: 83093a71588f97a9eb69fa7fe07418b9 | |
16 | Source1: http://files.vagrantup.com/packages/67bd4d30f7dbefa7c0abc643599f0244986c38c8/vagrant_x86_64.rpm?/%{name}-%{version}.x86_64.rpm | |
17 | # Source1-md5: 3efa3ac73988c565e6b3236da6867557 | |
d9278297 | 18 | BuildRequires: bash |
f27e06d0 | 19 | BuildRequires: file |
376b9a6d ER |
20 | BuildRequires: pkgconfig |
21 | BuildRequires: rpm-pythonprov | |
32f7fb06 | 22 | BuildRequires: rpm-utils |
376b9a6d | 23 | BuildRequires: ruby |
a08aa0c6 | 24 | BuildRequires: sed >= 4.0 |
376b9a6d | 25 | BuildRequires: which |
32f7fb06 ER |
26 | ExclusiveArch: %{ix86} %{x8664} |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %define _appdir %{_libdir}/%{name} | |
30 | ||
d9278297 | 31 | %define vg_home /home/vagrant |
289fa4b8 | 32 | %define vg_root /vagrant |
d9278297 | 33 | |
32f7fb06 | 34 | %define no_install_post_check_so 1 |
2f2a2f85 ER |
35 | |
36 | %description | |
37 | Vagrant offers scripted provisioning and deployment of virtual | |
38 | instances. While VirtualBox is the main target, future versions may | |
39 | support other hypervizors as well. | |
40 | ||
41 | The vision of the project is to create a tool to transparently manage | |
42 | all the complex parts of modern development within a virtual | |
43 | environment without affecting the everyday workflow of the developer | |
44 | too much. A long term goal is moving all development into virtualized | |
45 | environments by making it easier to do so than not to. Additionally, | |
46 | work is ongoing to have Vagrant run identically on every major | |
47 | consumer OS platform (Linux, Mac OS X, and Windows). | |
48 | ||
d9278297 ER |
49 | %package guest |
50 | Summary: Vagrant guest | |
51 | Group: Development/Building | |
52 | Requires(postun): /usr/sbin/userdel | |
53 | Requires(pre): /bin/id | |
54 | Requires(pre): /usr/bin/getgid | |
55 | Requires(pre): /usr/sbin/groupadd | |
56 | Requires(pre): /usr/sbin/useradd | |
57 | Requires: openssh-server | |
58 | Provides: group(vagrant) | |
59 | Provides: user(vagrant) | |
60 | %if "%{_rpmversion}" >= "5" | |
61 | BuildArch: noarch | |
62 | %endif | |
63 | ||
64 | %description guest | |
65 | This is the package to be installed in Vagrant guest. | |
66 | ||
67 | WARNING: This package installs insecure keypair to vagant user. Do not | |
68 | install this package in a box that is accessible others but you. | |
69 | ||
70 | These keys are the "insecure" public/private keypair we offer to base | |
71 | box creators for use in their base boxes so that vagrant installations | |
72 | can automatically SSH into the boxes. | |
73 | ||
74 | See: <https://github.com/mitchellh/vagrant/tree/master/keys/>. | |
75 | ||
2f2a2f85 ER |
76 | %package doc |
77 | Summary: Documentation for %{name} | |
78 | Group: Documentation | |
79 | Requires: %{name} = %{version}-%{release} | |
80 | %if "%{_rpmversion}" >= "5" | |
81 | BuildArch: noarch | |
82 | %endif | |
83 | ||
84 | %description doc | |
85 | Ruby documentation for %{gem_name} | |
86 | ||
87 | %prep | |
32f7fb06 ER |
88 | %setup -qcT |
89 | %ifarch %{ix86} | |
90 | SOURCE=%{S:0} | |
91 | %endif | |
92 | %ifarch %{x8664} | |
93 | SOURCE=%{S:1} | |
94 | %endif | |
2f2a2f85 | 95 | |
32f7fb06 ER |
96 | V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE) |
97 | test "$V" = "%{version}" | |
32f7fb06 | 98 | rpm2cpio $SOURCE | cpio -i -d |
2f2a2f85 | 99 | |
32f7fb06 | 100 | mv opt/vagrant/* . |
2f2a2f85 | 101 | |
f27e06d0 ER |
102 | %build |
103 | # update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure, | |
104 | # because /tmp is world writable dir) for the rest, just substitute with sed | |
105 | # (so shebangs would be correct) | |
106 | grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do | |
107 | path=${path%:} | |
108 | case "$mime" in | |
109 | text/*) | |
110 | sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path" | |
111 | ;; | |
112 | application/x-executable*|application/x-sharedlib*) | |
113 | rpath=$(chrpath -l $path) || continue | |
114 | rpath=${rpath#$path: RPATH=} | |
115 | [ "$rpath" ] || continue | |
116 | ||
117 | case "$rpath" in | |
118 | '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \ | |
119 | '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib') | |
120 | rpath=%{_appdir}/embedded/lib | |
121 | chrpath -r "$rpath" $path | |
122 | ;; | |
123 | esac | |
124 | ;; | |
125 | esac | |
126 | done | |
a08aa0c6 | 127 | |
2f2a2f85 ER |
128 | %install |
129 | rm -rf $RPM_BUILD_ROOT | |
d9278297 | 130 | %if %{with vagrant} |
32f7fb06 | 131 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}} |
32f7fb06 ER |
132 | cp -a bin embedded $RPM_BUILD_ROOT%{_appdir} |
133 | ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir} | |
d9278297 ER |
134 | %endif |
135 | ||
136 | # guest | |
289fa4b8 | 137 | install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh} |
d9278297 | 138 | cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home} |
2f2a2f85 ER |
139 | |
140 | %clean | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
d9278297 ER |
143 | %pre guest |
144 | # FIXME: register user in uid_gid.db.txt | |
145 | %groupadd -g 2000 vagrant | |
146 | %useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant | |
147 | ||
148 | %postun guest | |
149 | if [ "$1" = "0" ]; then | |
150 | %userremove vagrant | |
151 | %groupremove vagrant | |
152 | fi | |
153 | ||
154 | %if %{with vagrant} | |
2f2a2f85 ER |
155 | %files |
156 | %defattr(644,root,root,755) | |
157 | %attr(755,root,root) %{_bindir}/vagrant | |
2f2a2f85 | 158 | |
32f7fb06 ER |
159 | %defattr(-,root,root,-) |
160 | %{_appdir} | |
d9278297 ER |
161 | %endif |
162 | ||
163 | %files guest | |
164 | %defattr(644,root,root,755) | |
165 | %dir %attr(750,vagrant,vagrant) %{vg_home} | |
166 | %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh | |
167 | %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash* | |
289fa4b8 | 168 | %dir %attr(700,root,root) %{vg_root} |
32f7fb06 ER |
169 | |
170 | %if 0 | |
2f2a2f85 ER |
171 | %files doc |
172 | %defattr(644,root,root,755) | |
173 | %doc %{gem_docdir} | |
32f7fb06 | 174 | %endif |