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