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