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