]> git.pld-linux.org Git - packages/vagrant.git/blame - vagrant.spec
add bash-completion subpackage
[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
ff67adbf 10Release: 0.15
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
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
66Requires(postun): /usr/sbin/userdel
67Requires(pre): /bin/id
68Requires(pre): /usr/bin/getgid
69Requires(pre): /usr/sbin/groupadd
70Requires(pre): /usr/sbin/useradd
bf59fba0 71Requires: /etc/pld-release
d9278297
ER
72Requires: openssh-server
73Provides: group(vagrant)
74Provides: user(vagrant)
75%if "%{_rpmversion}" >= "5"
76BuildArch: noarch
77%endif
78
79%description guest
80This is the package to be installed in Vagrant guest.
81
82WARNING: This package installs insecure keypair to vagant user. Do not
83install this package in a box that is accessible others but you.
84
85These keys are the "insecure" public/private keypair we offer to base
86box creators for use in their base boxes so that vagrant installations
87can automatically SSH into the boxes.
88
89See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
90
2f2a2f85
ER
91%package doc
92Summary: Documentation for %{name}
93Group: Documentation
94Requires: %{name} = %{version}-%{release}
95%if "%{_rpmversion}" >= "5"
96BuildArch: noarch
97%endif
98
99%description doc
100Ruby documentation for %{gem_name}
101
102%prep
32f7fb06
ER
103%setup -qcT
104%ifarch %{ix86}
105SOURCE=%{S:0}
106%endif
107%ifarch %{x8664}
108SOURCE=%{S:1}
109%endif
2f2a2f85 110
32f7fb06
ER
111V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
112test "$V" = "%{version}"
32f7fb06 113rpm2cpio $SOURCE | cpio -i -d
2f2a2f85 114
32f7fb06 115mv opt/vagrant/* .
e61ff64e
ER
116
117# causes chrpath on th-i686 to fail
118rm embedded/rgloader/rgloader*.freebsd*.so
119%ifarch %{ix86}
120rm embedded/rgloader/rgloader*.x86_64.so
121%endif
122
bf59fba0
ER
123cd embedded/gems/gems/vagrant-%{version}
124%patch0 -p1
2f2a2f85 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
ff67adbf
ER
160install -d $RPM_BUILD_ROOT/etc/bash_completion.d
161mv $RPM_BUILD_ROOT{%{_appdir}/embedded/gems/gems/vagrant-%{version}/contrib/bash/completion.sh,/etc/bash_completion.d/%{name}.sh}
162
d9278297 163# guest
289fa4b8 164install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
d9278297 165cp -a /etc/skel/.bash* $RPM_BUILD_ROOT%{vg_home}
2f2a2f85
ER
166
167%clean
168rm -rf $RPM_BUILD_ROOT
169
d9278297
ER
170%pre guest
171# FIXME: register user in uid_gid.db.txt
172%groupadd -g 2000 vagrant
173%useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
174
175%postun guest
176if [ "$1" = "0" ]; then
177 %userremove vagrant
178 %groupremove vagrant
179fi
180
181%if %{with vagrant}
2f2a2f85
ER
182%files
183%defattr(644,root,root,755)
184%attr(755,root,root) %{_bindir}/vagrant
2f2a2f85 185
32f7fb06
ER
186%defattr(-,root,root,-)
187%{_appdir}
d9278297
ER
188%endif
189
ff67adbf
ER
190%files -n bash-completion-%{name}
191%defattr(644,root,root,755)
192/etc/bash_completion.d/*
193
d9278297
ER
194%files guest
195%defattr(644,root,root,755)
196%dir %attr(750,vagrant,vagrant) %{vg_home}
197%dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
198%dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
289fa4b8 199%dir %attr(700,root,root) %{vg_root}
32f7fb06
ER
200
201%if 0
2f2a2f85
ER
202%files doc
203%defattr(644,root,root,755)
204%doc %{gem_docdir}
32f7fb06 205%endif
This page took 0.146041 seconds and 4 git commands to generate.