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