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