]> git.pld-linux.org Git - packages/vagrant.git/blame - vagrant.spec
allow strip and chrpath and -debuginfo package
[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
0a34a42c 10Release: 0.10
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 34%define no_install_post_check_so 1
2f2a2f85
ER
35
36%description
37Vagrant offers scripted provisioning and deployment of virtual
38instances. While VirtualBox is the main target, future versions may
39support other hypervizors as well.
40
41The vision of the project is to create a tool to transparently manage
42all the complex parts of modern development within a virtual
43environment without affecting the everyday workflow of the developer
44too much. A long term goal is moving all development into virtualized
45environments by making it easier to do so than not to. Additionally,
46work is ongoing to have Vagrant run identically on every major
47consumer OS platform (Linux, Mac OS X, and Windows).
48
d9278297
ER
49%package guest
50Summary: Vagrant guest
51Group: Development/Building
52Requires(postun): /usr/sbin/userdel
53Requires(pre): /bin/id
54Requires(pre): /usr/bin/getgid
55Requires(pre): /usr/sbin/groupadd
56Requires(pre): /usr/sbin/useradd
57Requires: openssh-server
58Provides: group(vagrant)
59Provides: user(vagrant)
60%if "%{_rpmversion}" >= "5"
61BuildArch: noarch
62%endif
63
64%description guest
65This is the package to be installed in Vagrant guest.
66
67WARNING: This package installs insecure keypair to vagant user. Do not
68install this package in a box that is accessible others but you.
69
70These keys are the "insecure" public/private keypair we offer to base
71box creators for use in their base boxes so that vagrant installations
72can automatically SSH into the boxes.
73
74See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
75
2f2a2f85
ER
76%package doc
77Summary: Documentation for %{name}
78Group: Documentation
79Requires: %{name} = %{version}-%{release}
80%if "%{_rpmversion}" >= "5"
81BuildArch: noarch
82%endif
83
84%description doc
85Ruby documentation for %{gem_name}
86
87%prep
32f7fb06
ER
88%setup -qcT
89%ifarch %{ix86}
90SOURCE=%{S:0}
91%endif
92%ifarch %{x8664}
93SOURCE=%{S:1}
94%endif
2f2a2f85 95
32f7fb06
ER
96V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
97test "$V" = "%{version}"
32f7fb06 98rpm2cpio $SOURCE | cpio -i -d
2f2a2f85 99
32f7fb06 100mv 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)
106grep -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
126done
a08aa0c6 127
2f2a2f85
ER
128%install
129rm -rf $RPM_BUILD_ROOT
d9278297 130%if %{with vagrant}
32f7fb06 131install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
32f7fb06
ER
132cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
133ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
d9278297
ER
134%endif
135
136# guest
289fa4b8 137install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
d9278297 138cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
2f2a2f85
ER
139
140%clean
141rm -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
149if [ "$1" = "0" ]; then
150 %userremove vagrant
151 %groupremove vagrant
152fi
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
This page took 0.044241 seconds and 4 git commands to generate.