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