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