]> git.pld-linux.org Git - packages/vagrant.git/blame - vagrant.spec
remove some files that chrpath fails to strip
[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
e61ff64e 10Release: 0.13
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
bf59fba0
ER
18Patch0: https://github.com/glensc/vagrant/commit/bd8a24e945a26dbae418680d570d33dced910088.patch
19# Patch0-md5: 15aeb8e5fe95457bc0040035c3801541
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
d9278297
ER
51%package guest
52Summary: Vagrant guest
53Group: Development/Building
54Requires(postun): /usr/sbin/userdel
55Requires(pre): /bin/id
56Requires(pre): /usr/bin/getgid
57Requires(pre): /usr/sbin/groupadd
58Requires(pre): /usr/sbin/useradd
bf59fba0 59Requires: /etc/pld-release
d9278297
ER
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/* .
e61ff64e
ER
104
105# causes chrpath on th-i686 to fail
106rm embedded/rgloader/rgloader*.freebsd*.so
107%ifarch %{ix86}
108rm embedded/rgloader/rgloader*.x86_64.so
109%endif
110
bf59fba0
ER
111cd embedded/gems/gems/vagrant-%{version}
112%patch0 -p1
2f2a2f85 113
f27e06d0
ER
114%build
115# update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure,
116# because /tmp is world writable dir) for the rest, just substitute with sed
117# (so shebangs would be correct)
118grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do
119 path=${path%:}
120 case "$mime" in
121 text/*)
122 sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path"
123 ;;
124 application/x-executable*|application/x-sharedlib*)
125 rpath=$(chrpath -l $path) || continue
126 rpath=${rpath#$path: RPATH=}
127 [ "$rpath" ] || continue
128
129 case "$rpath" in
130 '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \
131 '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib')
132 rpath=%{_appdir}/embedded/lib
133 chrpath -r "$rpath" $path
134 ;;
135 esac
136 ;;
137 esac
138done
a08aa0c6 139
2f2a2f85
ER
140%install
141rm -rf $RPM_BUILD_ROOT
d9278297 142%if %{with vagrant}
32f7fb06 143install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
32f7fb06
ER
144cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
145ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
d9278297
ER
146%endif
147
148# guest
289fa4b8 149install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
d9278297 150cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
2f2a2f85
ER
151
152%clean
153rm -rf $RPM_BUILD_ROOT
154
d9278297
ER
155%pre guest
156# FIXME: register user in uid_gid.db.txt
157%groupadd -g 2000 vagrant
158%useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
159
160%postun guest
161if [ "$1" = "0" ]; then
162 %userremove vagrant
163 %groupremove vagrant
164fi
165
166%if %{with vagrant}
2f2a2f85
ER
167%files
168%defattr(644,root,root,755)
169%attr(755,root,root) %{_bindir}/vagrant
2f2a2f85 170
32f7fb06
ER
171%defattr(-,root,root,-)
172%{_appdir}
d9278297
ER
173%endif
174
175%files guest
176%defattr(644,root,root,755)
177%dir %attr(750,vagrant,vagrant) %{vg_home}
178%dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
179%dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
289fa4b8 180%dir %attr(700,root,root) %{vg_root}
32f7fb06
ER
181
182%if 0
2f2a2f85
ER
183%files doc
184%defattr(644,root,root,755)
185%doc %{gem_docdir}
32f7fb06 186%endif
This page took 0.085696 seconds and 4 git commands to generate.