]> git.pld-linux.org Git - packages/vagrant.git/blame - vagrant.spec
up to 1.1.4, pld patch merged :)
[packages/vagrant.git] / vagrant.spec
CommitLineData
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
7Summary: Provisioning and deployment of virtual instances
8Name: vagrant
0d7df0ab 9Version: 1.1.4
062cfa5f 10Release: 0.16
2f2a2f85
ER
11License: MIT
12Group: Applications/Emulators
13URL: http://vagrantup.com/
0d7df0ab
ER
14Source0: http://files.vagrantup.com/packages/87613ec9392d4660ffcb1d5755307136c06af08c/vagrant_i686.rpm?/%{name}-%{version}.i686.rpm
15# Source0-md5: 970e0f11eea80ae57fd64cd25993382b
16Source1: http://files.vagrantup.com/packages/87613ec9392d4660ffcb1d5755307136c06af08c/vagrant_x86_64.rpm?/%{name}-%{version}.x86_64.rpm
17# Source1-md5: 95f30df5cb93db6282f7edc42eedfe59
062cfa5f
ER
18Source2: https://raw.github.com/mitchellh/vagrant/master/keys/%{name}.pub
19# Source2-md5: b440b5086dd12c3fd8abb762476b9f40
d9278297 20BuildRequires: bash
f27e06d0 21BuildRequires: file
376b9a6d
ER
22BuildRequires: pkgconfig
23BuildRequires: rpm-pythonprov
32f7fb06 24BuildRequires: rpm-utils
376b9a6d 25BuildRequires: ruby
a08aa0c6 26BuildRequires: sed >= 4.0
376b9a6d 27BuildRequires: which
32f7fb06
ER
28ExclusiveArch: %{ix86} %{x8664}
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%define _appdir %{_libdir}/%{name}
32
d9278297 33%define vg_home /home/vagrant
289fa4b8 34%define vg_root /vagrant
d9278297 35
32f7fb06 36%define no_install_post_check_so 1
2f2a2f85
ER
37
38%description
39Vagrant offers scripted provisioning and deployment of virtual
40instances. While VirtualBox is the main target, future versions may
41support other hypervizors as well.
42
43The vision of the project is to create a tool to transparently manage
44all the complex parts of modern development within a virtual
45environment without affecting the everyday workflow of the developer
46too much. A long term goal is moving all development into virtualized
47environments by making it easier to do so than not to. Additionally,
48work is ongoing to have Vagrant run identically on every major
49consumer OS platform (Linux, Mac OS X, and Windows).
50
ff67adbf
ER
51%package -n bash-completion-%{name}
52Summary: bash-completion for %{name}
53Group: Applications/Shells
54Requires: %{name}
55Requires: bash-completion
56%if "%{_rpmversion}" >= "5"
57BuildArch: noarch
58%endif
59
60%description -n bash-completion-%{name}
61bash-completion for %{name}.
62
d9278297
ER
63%package guest
64Summary: Vagrant guest
65Group: Development/Building
062cfa5f 66URL: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
d9278297
ER
67Requires(postun): /usr/sbin/userdel
68Requires(pre): /bin/id
69Requires(pre): /usr/bin/getgid
70Requires(pre): /usr/sbin/groupadd
71Requires(pre): /usr/sbin/useradd
bf59fba0 72Requires: /etc/pld-release
062cfa5f 73Requires: kernel(vboxsf)
d9278297 74Requires: openssh-server
062cfa5f 75Requires: sudo
d9278297
ER
76Provides: group(vagrant)
77Provides: user(vagrant)
78%if "%{_rpmversion}" >= "5"
79BuildArch: noarch
80%endif
81
82%description guest
83This is the package to be installed in Vagrant guest.
84
85WARNING: This package installs insecure keypair to vagant user. Do not
86install this package in a box that is accessible others but you.
87
88These keys are the "insecure" public/private keypair we offer to base
89box creators for use in their base boxes so that vagrant installations
90can automatically SSH into the boxes.
91
92See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
93
2f2a2f85
ER
94%package doc
95Summary: Documentation for %{name}
96Group: Documentation
97Requires: %{name} = %{version}-%{release}
98%if "%{_rpmversion}" >= "5"
99BuildArch: noarch
100%endif
101
102%description doc
103Ruby documentation for %{gem_name}
104
105%prep
32f7fb06
ER
106%setup -qcT
107%ifarch %{ix86}
108SOURCE=%{S:0}
109%endif
110%ifarch %{x8664}
111SOURCE=%{S:1}
112%endif
2f2a2f85 113
32f7fb06
ER
114V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
115test "$V" = "%{version}"
32f7fb06 116rpm2cpio $SOURCE | cpio -i -d
2f2a2f85 117
32f7fb06 118mv opt/vagrant/* .
e61ff64e
ER
119
120# causes chrpath on th-i686 to fail
121rm embedded/rgloader/rgloader*.freebsd*.so
122%ifarch %{ix86}
123rm embedded/rgloader/rgloader*.x86_64.so
124%endif
125
f27e06d0
ER
126%build
127# update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure,
128# because /tmp is world writable dir) for the rest, just substitute with sed
129# (so shebangs would be correct)
130grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do
131 path=${path%:}
132 case "$mime" in
133 text/*)
134 sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path"
135 ;;
136 application/x-executable*|application/x-sharedlib*)
137 rpath=$(chrpath -l $path) || continue
138 rpath=${rpath#$path: RPATH=}
139 [ "$rpath" ] || continue
140
141 case "$rpath" in
142 '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \
143 '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib')
144 rpath=%{_appdir}/embedded/lib
145 chrpath -r "$rpath" $path
146 ;;
147 esac
148 ;;
149 esac
150done
a08aa0c6 151
2f2a2f85
ER
152%install
153rm -rf $RPM_BUILD_ROOT
d9278297 154%if %{with vagrant}
32f7fb06 155install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
32f7fb06
ER
156cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
157ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
d9278297
ER
158%endif
159
062cfa5f
ER
160cd $RPM_BUILD_ROOT%{_appdir}/embedded/gems/gems/vagrant-%{version}
161
ff67adbf 162install -d $RPM_BUILD_ROOT/etc/bash_completion.d
062cfa5f 163mv contrib/bash/completion.sh $RPM_BUILD_ROOT/etc/bash_completion.d/%{name}.sh
ff67adbf 164
d9278297 165# guest
289fa4b8 166install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
d9278297 167cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
2f2a2f85 168
062cfa5f
ER
169# Since Vagrant only supports key-based authentication for SSH, we must
170# set up the vagrant user to use key-based authentication. We can get the
171# public key used by the Vagrant gem directly from its Github repository.
172mv keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
173
2f2a2f85
ER
174%clean
175rm -rf $RPM_BUILD_ROOT
176
d9278297
ER
177%pre guest
178# FIXME: register user in uid_gid.db.txt
179%groupadd -g 2000 vagrant
180%useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
181
182%postun guest
183if [ "$1" = "0" ]; then
184 %userremove vagrant
185 %groupremove vagrant
186fi
187
188%if %{with vagrant}
2f2a2f85
ER
189%files
190%defattr(644,root,root,755)
191%attr(755,root,root) %{_bindir}/vagrant
2f2a2f85 192
32f7fb06
ER
193%defattr(-,root,root,-)
194%{_appdir}
d9278297
ER
195%endif
196
ff67adbf
ER
197%files -n bash-completion-%{name}
198%defattr(644,root,root,755)
199/etc/bash_completion.d/*
200
d9278297
ER
201%files guest
202%defattr(644,root,root,755)
203%dir %attr(750,vagrant,vagrant) %{vg_home}
204%dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
062cfa5f 205%attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
d9278297 206%dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
289fa4b8 207%dir %attr(700,root,root) %{vg_root}
32f7fb06
ER
208
209%if 0
2f2a2f85
ER
210%files doc
211%defattr(644,root,root,755)
212%doc %{gem_docdir}
32f7fb06 213%endif
This page took 0.131904 seconds and 4 git commands to generate.