]> git.pld-linux.org Git - packages/vagrant.git/blob - vagrant.spec
up to 1.1.5, do not provide deps from bundled libs
[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.17
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
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 Provides:       group(vagrant)
82 Provides:       user(vagrant)
83 %if "%{_rpmversion}" >= "5"
84 BuildArch:      noarch
85 %endif
86
87 %description guest
88 This is the package to be installed in Vagrant guest.
89
90 WARNING: This package installs insecure keypair to vagant user. Do not
91 install this package in a box that is accessible others but you.
92
93 These keys are the "insecure" public/private keypair we offer to base
94 box creators for use in their base boxes so that vagrant installations
95 can automatically SSH into the boxes.
96
97 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
98
99 %package doc
100 Summary:        Documentation for %{name}
101 Group:          Documentation
102 Requires:       %{name} = %{version}-%{release}
103 %if "%{_rpmversion}" >= "5"
104 BuildArch:      noarch
105 %endif
106
107 %description doc
108 Ruby documentation for %{gem_name}
109
110 %prep
111 %setup -qcT
112 %ifarch %{ix86}
113 SOURCE=%{S:0}
114 %endif
115 %ifarch %{x8664}
116 SOURCE=%{S:1}
117 %endif
118
119 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
120 test "$V" = "%{version}"
121 rpm2cpio $SOURCE | cpio -i -d
122
123 mv opt/vagrant/* .
124
125 # causes chrpath on th-i686  to fail
126 rm embedded/rgloader/rgloader*.freebsd*.so
127 %ifarch %{ix86}
128 rm embedded/rgloader/rgloader*.x86_64.so
129 %endif
130
131 %build
132 # update RPATH, not to contain insecure /tmp/vagrant-temp/embedded (insecure,
133 # because /tmp is world writable dir) for the rest, just substitute with sed
134 # (so shebangs would be correct)
135 grep -r '/tmp/vagrant-temp/embedded' . -l | xargs -r file -i | while read path mime; do
136         path=${path%:}
137         case "$mime" in
138         text/*)
139                 sed -i -e 's,/tmp/vagrant-temp/embedded,%{_appdir}/embedded,' "$path"
140         ;;
141         application/x-executable*|application/x-sharedlib*)
142                 rpath=$(chrpath -l $path) || continue
143                 rpath=${rpath#$path: RPATH=}
144                 [ "$rpath" ] || continue
145
146                 case "$rpath" in
147                 '${ORIGIN}/../lib:/tmp/vagrant-temp/embedded/lib' | \
148                 '/tmp/vagrant-temp/embedded/lib:${ORIGIN}/../lib')
149                         rpath=%{_appdir}/embedded/lib
150                         chrpath -r "$rpath" $path
151                 ;;
152                 esac
153         ;;
154         esac
155 done
156
157 %install
158 rm -rf $RPM_BUILD_ROOT
159 %if %{with vagrant}
160 install -d $RPM_BUILD_ROOT{%{_bindir},%{_appdir}}
161 cp -a bin embedded $RPM_BUILD_ROOT%{_appdir}
162 ln -s %{_appdir}/bin/%{name} $RPM_BUILD_ROOT%{_bindir}
163 %endif
164
165 cd $RPM_BUILD_ROOT%{_appdir}/embedded/gems/gems/vagrant-%{version}
166
167 install -d $RPM_BUILD_ROOT/etc/bash_completion.d
168 mv contrib/bash/completion.sh $RPM_BUILD_ROOT/etc/bash_completion.d/%{name}.sh
169
170 # guest
171 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
172 cp -a /etc/skel/.bash*  $RPM_BUILD_ROOT%{vg_home}
173
174 # Since Vagrant only supports key-based authentication for SSH, we must
175 # set up the vagrant user to use key-based authentication. We can get the
176 # public key used by the Vagrant gem directly from its Github repository.
177 mv keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
178
179 %clean
180 rm -rf $RPM_BUILD_ROOT
181
182 %pre guest
183 # FIXME: register user in uid_gid.db.txt
184 %groupadd -g 2000 vagrant
185 %useradd -u 2000 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
186
187 %postun guest
188 if [ "$1" = "0" ]; then
189         %userremove vagrant
190         %groupremove vagrant
191 fi
192
193 %if %{with vagrant}
194 %files
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_bindir}/vagrant
197
198 %defattr(-,root,root,-)
199 %{_appdir}
200 %endif
201
202 %files -n bash-completion-%{name}
203 %defattr(644,root,root,755)
204 /etc/bash_completion.d/*
205
206 %files guest
207 %defattr(644,root,root,755)
208 %dir %attr(750,vagrant,vagrant) %{vg_home}
209 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
210 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
211 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
212 %dir %attr(700,root,root) %{vg_root}
213
214 %if 0
215 %files doc
216 %defattr(644,root,root,755)
217 %doc %{gem_docdir}
218 %endif
This page took 0.143412 seconds and 3 git commands to generate.