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