]> git.pld-linux.org Git - packages/vagrant.git/blob - vagrant.spec
- relax net-ssh dependency (5.0.0 has just a bunch of new features)
[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:        2.1.2
6 Release:        2
7 License:        MIT
8 Group:          Applications/Emulators
9 Source0:        https://github.com/mitchellh/vagrant/archive/v%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  20b7a4a7b3e1bb4a57c8cac65a547ce7
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 Patch7:         insert-key.patch
18 Patch8:         listen.patch
19 Patch9:         pld-chef-installed.patch
20 Patch10:        net-ssh.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:       bsdtar
33 Requires:       curl
34 Requires:       ruby-json
35 Requires:       ruby-rubygems
36 Suggests:       VirtualBox
37 Suggests:       VirtualBox-gui
38 Suggests:       rdesktop
39 Suggests:       rsync
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %define         _appdir %{_datadir}/%{name}
44 %define         bash_compdir    %{_datadir}/bash-completion/completions
45
46 %define         vg_home /home/vagrant
47 %define         vg_root /vagrant
48
49 %description
50 Vagrant offers scripted provisioning and deployment of virtual
51 instances. While VirtualBox is the main target, future versions may
52 support other hypervizors as well.
53
54 The vision of the project is to create a tool to transparently manage
55 all the complex parts of modern development within a virtual
56 environment without affecting the everyday workflow of the developer
57 too much. A long term goal is moving all development into virtualized
58 environments by making it easier to do so than not to. Additionally,
59 work is ongoing to have Vagrant run identically on every major
60 consumer OS platform (Linux, Mac OS X, and Windows).
61
62 %package -n bash-completion-%{name}
63 Summary:        bash-completion for %{name}
64 Group:          Applications/Shells
65 Requires:       %{name}
66 Requires:       bash-completion >= 2.0
67
68 %description -n bash-completion-%{name}
69 bash-completion for %{name}.
70
71 %package guest
72 Summary:        Vagrant guest
73 Group:          Development/Building
74 URL:            http://docs-v1.vagrantup.com/v1/docs/base_boxes.html
75 Requires(postun):       /usr/sbin/userdel
76 Requires(pre):  /bin/id
77 Requires(pre):  /usr/bin/getgid
78 Requires(pre):  /usr/sbin/groupadd
79 Requires(pre):  /usr/sbin/useradd
80 Requires:       /etc/pld-release
81 Requires:       openssh-server
82 Requires:       sudo >= 1.7.4p3-2
83 Requires:       which
84 Suggests:       kernel(vboxsf)
85 Provides:       group(vagrant)
86 Provides:       user(vagrant)
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
105 %description doc
106 Ruby documentation for %{gem_name}
107
108 %prep
109 %setup -q
110 %patch1 -p1
111 %patch2 -p1
112 %patch3 -p1
113 %patch4 -p1
114 %patch5 -p1
115 %patch7 -p1
116 %patch8 -p1
117 %patch9 -p1
118 %patch10 -p1
119
120 VERSION=$(cat version.txt)
121 sed -i -e "s/__VERSION__/$VERSION/" lib/vagrant/version.rb
122
123 # cleanup backups after patching
124 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
125
126 %build
127 # make gemspec self-contained
128 ruby -r rubygems -e 'spec = eval(File.read("%{name}.gemspec"))
129         File.open("%{name}-%{version}.gemspec", "w") do |file|
130         file.puts spec.to_ruby_for_cache
131 end'
132
133 %install
134 rm -rf $RPM_BUILD_ROOT
135 install -d $RPM_BUILD_ROOT{%{ruby_gemdir}/gems/%{name}-%{version},%{ruby_specdir},%{_bindir}}
136 cp -a lib bin keys plugins templates $RPM_BUILD_ROOT%{ruby_gemdir}/gems/%{name}-%{version}
137 cp -p %{name}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
138 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}
139
140 install -d $RPM_BUILD_ROOT%{bash_compdir}
141 cp -p contrib/bash/completion.sh $RPM_BUILD_ROOT%{bash_compdir}/%{name}
142
143 # guest
144 install -d $RPM_BUILD_ROOT/etc/sudoers.d
145 echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > $RPM_BUILD_ROOT/etc/sudoers.d/%{name}
146
147 install -d $RPM_BUILD_ROOT{%{vg_root},%{vg_home}/.ssh}
148 cp -p /etc/skel/.bash*  $RPM_BUILD_ROOT%{vg_home}
149
150 # Since Vagrant only supports key-based authentication for SSH, we must
151 # set up the vagrant user to use key-based authentication. We can get the
152 # public key used by the Vagrant gem directly from its Github repository.
153 cp -p keys/vagrant.pub $RPM_BUILD_ROOT%{vg_home}/.ssh/authorized_keys
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %pre guest
159 %groupadd -g 291 vagrant
160 %useradd -u 291 -g vagrant -G wheel -c "Vagrant user" -s /bin/bash -d %{vg_home} vagrant
161
162 %postun guest
163 if [ "$1" = "0" ]; then
164         %userremove vagrant
165         %groupremove vagrant
166 fi
167
168 %files
169 %defattr(644,root,root,755)
170 %attr(755,root,root) %{_bindir}/vagrant
171 #%{ruby_vendorlibdir}/vagrant.rb
172 #%{ruby_vendorlibdir}/vagrant
173 #%{_appdir}
174
175 %dir %{ruby_gemdir}/gems/%{name}-%{version}
176 %dir %{ruby_gemdir}/gems/%{name}-%{version}/bin
177 %attr(755,root,root) %{ruby_gemdir}/gems/%{name}-%{version}/bin/*
178 %{ruby_gemdir}/gems/%{name}-%{version}/keys
179 %{ruby_gemdir}/gems/%{name}-%{version}/lib
180 %{ruby_gemdir}/gems/%{name}-%{version}/plugins
181 %{ruby_gemdir}/gems/%{name}-%{version}/templates
182
183 %{ruby_specdir}/%{name}-%{version}.gemspec
184
185 %files -n bash-completion-%{name}
186 %defattr(644,root,root,755)
187 %{bash_compdir}/%{name}
188
189 %files guest
190 %defattr(644,root,root,755)
191 %attr(440,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/%{name}
192 %dir %attr(750,vagrant,vagrant) %{vg_home}
193 %dir %attr(700,vagrant,vagrant) %{vg_home}/.ssh
194 %attr(600,vagrant,vagrant) %config(noreplace) %verify(not md5 mtime size) %{vg_home}/.ssh/authorized_keys
195 %dir %attr(640,vagrant,vagrant) %{vg_home}/.bash*
196 %dir %attr(700,root,root) %{vg_root}
197
198 %if 0
199 %files doc
200 %defattr(644,root,root,755)
201 %doc %{gem_docdir}
202 %endif
This page took 0.077873 seconds and 3 git commands to generate.