]> git.pld-linux.org Git - packages/vagrant.git/blob - vagrant.spec
fbaa21bc2532bcfb8418751fecc94ed040c828ec
[packages/vagrant.git] / vagrant.spec
1 # NOTE:
2 # - release notes: https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md
3 Summary:        Provisioning and deployment of virtual instances
4 Name:           vagrant
5 Version:        1.7.4
6 Release:        1
7 License:        MIT
8 Group:          Applications/Emulators
9 Source0:        https://github.com/mitchellh/vagrant/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  556b5e5594a327d46b63c4d8024db187
11 Source1:        %{name}.sh
12 Patch1:         rubygems.patch
13 Patch2:         no-warning.patch
14 Patch3:         Vagrantfile.patch
15 Patch4:         version.patch
16 Patch5:         no-gems.patch
17 Patch6:         checkpoint.patch
18 Patch7:         insert-key.patch
19 Patch8:         listen.patch
20 Patch9:         pld-chef-installed.patch
21 URL:            http://www.vagrantup.com/
22 BuildRequires:  bash
23 BuildRequires:  rpm-rubyprov
24 BuildRequires:  ruby > 1:2.0
25 %if %{with tests}
26 BuildRequires:  ruby-contest >= 0.1.2
27 BuildRequires:  ruby-minitest >= 2.5.1
28 BuildRequires:  ruby-mocha
29 BuildRequires:  ruby-rake
30 BuildRequires:  ruby-rspec >= 2.14.0
31 %endif
32 Requires:       VirtualBox
33 Requires:       bsdtar
34 Requires:       curl
35 Requires:       ruby-bundler >= 1.5.2
36 Requires:       ruby-childprocess >= 0.5.0
37 Requires:       ruby-erubis >= 2.7.0
38 Requires:       ruby-i18n >= 0.6.0
39 Requires:       ruby-json
40 Requires:       ruby-listen >= 2.7.11
41 Requires:       ruby-log4r < 1.1.11
42 Requires:       ruby-log4r >= 1.1.9
43 Requires:       ruby-net-scp >= 1.1.0
44 Requires:       ruby-net-ssh < 2.8.0
45 Requires:       ruby-net-ssh >= 2.6.6
46 Requires:       ruby-rubygems
47 Suggests:       VirtualBox-gui
48 Suggests:       rdesktop
49 Suggests:       rsync
50 BuildArch:      noarch
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %define         _appdir %{_datadir}/%{name}
54 %define         bash_compdir    %{_datadir}/bash-completion/completions
55
56 %define         vg_home /home/vagrant
57 %define         vg_root /vagrant
58
59 %description
60 Vagrant offers scripted provisioning and deployment of virtual
61 instances. While VirtualBox is the main target, future versions may
62 support other hypervizors as well.
63
64 The vision of the project is to create a tool to transparently manage
65 all the complex parts of modern development within a virtual
66 environment without affecting the everyday workflow of the developer
67 too much. A long term goal is moving all development into virtualized
68 environments by making it easier to do so than not to. Additionally,
69 work is ongoing to have Vagrant run identically on every major
70 consumer OS platform (Linux, Mac OS X, and Windows).
71
72 %package -n bash-completion-%{name}
73 Summary:        bash-completion for %{name}
74 Group:          Applications/Shells
75 Requires:       %{name}
76 Requires:       bash-completion >= 2.0
77
78 %description -n bash-completion-%{name}
79 bash-completion for %{name}.
80
81 %package guest
82 Summary:        Vagrant guest
83 Group:          Development/Building
84 URL:            http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
85 Requires(postun):       /usr/sbin/userdel
86 Requires(pre):  /bin/id
87 Requires(pre):  /usr/bin/getgid
88 Requires(pre):  /usr/sbin/groupadd
89 Requires(pre):  /usr/sbin/useradd
90 Requires:       /etc/pld-release
91 Requires:       kernel(vboxsf)
92 Requires:       openssh-server
93 Requires:       sudo >= 1.7.4p3-2
94 Requires:       which
95 Provides:       group(vagrant)
96 Provides:       user(vagrant)
97
98 %description guest
99 This is the package to be installed in Vagrant guest.
100
101 WARNING: This package installs insecure keypair to vagant user. Do not
102 install this package in a box that is accessible others but you.
103
104 These keys are the "insecure" public/private keypair we offer to base
105 box creators for use in their base boxes so that vagrant installations
106 can automatically SSH into the boxes.
107
108 See: <https://github.com/mitchellh/vagrant/tree/master/keys/>.
109
110 %package doc
111 Summary:        Documentation for %{name}
112 Group:          Documentation
113 Requires:       %{name} = %{version}-%{release}
114
115 %description doc
116 Ruby documentation for %{gem_name}
117
118 %prep
119 %setup -q
120 %patch1 -p1
121 %patch2 -p1
122 %patch3 -p1
123 %patch4 -p1
124 %patch5 -p1
125 %patch6 -p1
126 %patch7 -p1
127 %patch8 -p1
128 %patch9 -p1
129
130 VERSION=$(cat version.txt)
131 sed -i -e "s/__VERSION__/$VERSION/" lib/vagrant/version.rb
132
133 # cleanup backups after patching
134 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
135
136 %build
137 # make gemspec self-contained
138 ruby -r rubygems -e 'spec = eval(File.read("%{name}.gemspec"))
139         File.open("%{name}-%{version}.gemspec", "w") do |file|
140         file.puts spec.to_ruby_for_cache
141 end'
142
143 %install
144 rm -rf $RPM_BUILD_ROOT
145 install -d $RPM_BUILD_ROOT{%{ruby_gemdir}/gems/%{name}-%{version},%{ruby_specdir},%{_bindir}}
146 cp -a lib bin keys plugins templates $RPM_BUILD_ROOT%{ruby_gemdir}/gems/%{name}-%{version}
147 cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
148 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
149
150 install -d $RPM_BUILD_ROOT%{bash_compdir}
151 cp -p contrib/bash/completion.sh $RPM_BUILD_ROOT%{bash_compdir}/%{name}
152
153 # guest
154 install -d $RPM_BUILD_ROOT/etc/sudoers.d
155 echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > $RPM_BUILD_ROOT/etc/sudoers.d/%{name}
156
157 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
158 cp -p /etc/skel/.bash*  $RPM_BUILD_ROOT%{vg_home}
159
160 # Since Vagrant only supports key-based authentication for SSH, we must
161 # set up the vagrant user to use key-based authentication. We can get the
162 # public key used by the Vagrant gem directly from its Github repository.
163 cp -p keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
164
165 %clean
166 rm -rf $RPM_BUILD_ROOT
167
168 %pre guest
169 %groupadd -g 291 vagrant
170 %useradd -u 291 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
171
172 %postun guest
173 if [ "$1" = "0" ]; then
174         %userremove vagrant
175         %groupremove vagrant
176 fi
177
178 %files
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_bindir}/vagrant
181 #%{ruby_vendorlibdir}/vagrant.rb
182 #%{ruby_vendorlibdir}/vagrant
183 #%{_appdir}
184
185 %dir %{ruby_gemdir}/gems/%{name}-%{version}
186 %dir %{ruby_gemdir}/gems/%{name}-%{version}/bin
187 %attr(755,root,root) %{ruby_gemdir}/gems/%{name}-%{version}/bin/*
188 %{ruby_gemdir}/gems/%{name}-%{version}/keys
189 %{ruby_gemdir}/gems/%{name}-%{version}/lib
190 %{ruby_gemdir}/gems/%{name}-%{version}/plugins
191 %{ruby_gemdir}/gems/%{name}-%{version}/templates
192
193 %{ruby_specdir}/%{name}-%{version}.gemspec
194
195 %files -n bash-completion-%{name}
196 %defattr(644,root,root,755)
197 %{bash_compdir}/%{name}
198
199 %files guest
200 %defattr(644,root,root,755)
201 %attr(440,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/%{name}
202 %dir %attr(750,vagrant,vagrant) %{vg_home}
203 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
204 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
205 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
206 %dir %attr(700,root,root) %{vg_root}
207
208 %if 0
209 %files doc
210 %defattr(644,root,root,755)
211 %doc %{gem_docdir}
212 %endif
This page took 0.055559 seconds and 2 git commands to generate.