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