]>
Commit | Line | Data |
---|---|---|
4abcd8ff | 1 | # TODO |
6a99c4df | 2 | # - avoid using defattr() and giving too much dirs/files to http |
4abcd8ff | 3 | # - webapps |
f6628fdc | 4 | # - FHS in web paths |
30a5fd64 | 5 | # - bash-completions |
603eb591 | 6 | # - logrotate |
30a5fd64 | 7 | %define subver beta5 |
603eb591 | 8 | %define rel 0.10 |
a649639e | 9 | Summary: Boot server configurator |
6a99c4df | 10 | Summary(pl.UTF-8): Konfiguracja serwera startującego |
a649639e | 11 | Name: cobbler |
30a5fd64 ER |
12 | Version: 2.4.0 |
13 | Release: 0.%{subver}.%{rel} | |
6a99c4df JB |
14 | License: GPL v2+ |
15 | Group: Applications/System | |
30a5fd64 ER |
16 | Source0: https://github.com/cobbler/cobbler/archive/%{name}-%{version}-%{subver}.tar.gz |
17 | # Source0-md5: f0b63f64d679e3ee547de2d97b74e681 | |
f6628fdc | 18 | Source1: %{name}-apache.conf |
30a5fd64 ER |
19 | URL: http://www.cobblerd.org/ |
20 | BuildRequires: python-PyYAML | |
6a99c4df JB |
21 | BuildRequires: python-cheetah |
22 | BuildRequires: python-devel | |
30a5fd64 ER |
23 | BuildRequires: python-setuptools |
24 | Requires: apache-mod_wsgi | |
a649639e | 25 | Requires: createrepo |
30a5fd64 ER |
26 | #Requires: genisoimage |
27 | Requires: python-PyYAML | |
28 | Requires: python-augeas | |
29 | Requires: python-cheetah | |
30 | Requires: python-netaddr | |
31 | Requires: python-simplejson | |
32 | Requires: python-urlgrabber | |
33 | Requires: rsync | |
4abcd8ff | 34 | Requires: tftpdaemon |
30a5fd64 | 35 | Requires: yum-utils |
8ebc915b | 36 | Requires(post,preun): /sbin/chkconfig |
a649639e | 37 | BuildArch: noarch |
a649639e ER |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
f6628fdc ER |
40 | %define _webapps /etc/webapps |
41 | %define _webapp %{name} | |
4abcd8ff ER |
42 | %define _appdir /var/www/cobbler |
43 | %define _cgibindir /var/www/cgi-bin | |
44 | ||
45 | #define _appdir %{_datadir}/%{name} | |
46 | #define _cgibindir %{_prefix}/lib/cgi-bin/%{name} | |
47 | ||
a649639e ER |
48 | %description |
49 | Cobbler is a network boot and update server. Cobbler supports PXE, | |
50 | provisioning virtualized images, and reinstalling existing Linux | |
51 | machines. The last two modes require a helper tool called 'koan' that | |
6a99c4df | 52 | integrates with Cobbler. Cobbler's advanced features include importing |
a649639e ER |
53 | distributions from DVDs and rsync mirrors, kickstart templating, |
54 | integrated yum mirroring, and built-in DHCP Management. Cobbler has a | |
55 | Python API for integration with other GPL systems management | |
56 | applications. | |
57 | ||
6a99c4df JB |
58 | %description -l pl.UTF-8 |
59 | Cobbler to sieciowy serwer do uruchamiania i uaktualniania komputerów. | |
60 | Obsługuje PXE, udostępnianie wirtualizowanych obrazów i reinstalowanie | |
61 | istniejących maszyn linuksowych. Dwa ostatnie tryby wymagają pakietu | |
62 | pomocniczego o nazwie "koan", integrującego się z Cobblerem. | |
63 | Zaawansowane możliwości Cobblera obejmują importowanie dystrybucji z | |
64 | płyt DVD i mirrorów rsynca, szablony uruchamiania, zintegrowane | |
65 | mirrorowanie repozytoriów yuma oraz wbudowane zarządzanie DHCP. | |
66 | Cobbler ma API w Pythonie do integracji z innymi aplikacjami | |
67 | zarządzającymi na licencji GPL. | |
68 | ||
30a5fd64 ER |
69 | %package web |
70 | Summary: Web interface for Cobbler | |
71 | Group: Applications/System | |
72 | Requires: %{name} = %{version}-%{release} | |
30a5fd64 | 73 | Requires: apache-mod_ssl |
8ebc915b | 74 | Requires: apache-mod_wsgi |
30a5fd64 ER |
75 | Requires: python-django >= 1.1.2 |
76 | ||
77 | %description web | |
78 | Web interface for Cobbler that allows visiting | |
79 | <http://server/cobbler_web> to configure the install server. | |
80 | ||
81 | %package -n koan | |
82 | Summary: Helper tool that performs cobbler orders on remote machines | |
83 | Group: Applications/System | |
84 | Requires: python-simplejson | |
85 | Requires: python-virtinst | |
86 | ||
87 | %description -n koan | |
88 | Koan stands for kickstart-over-a-network and allows for both network | |
89 | installation of new virtualized guests and reinstallation of an | |
90 | existing system. For use with a boot-server configured with Cobbler | |
91 | ||
a649639e | 92 | %prep |
30a5fd64 | 93 | %setup -q -n %{name}-%{name}-%{version}-%{subver} |
a649639e | 94 | |
8ebc915b | 95 | mv config/cobbler{,_web}.conf . |
603eb591 | 96 | mv config/{cobblerd,cobblerd_rotate,cobblerd.service,cobbler_bash} . |
8ebc915b | 97 | |
a649639e | 98 | %build |
3e5f6500 | 99 | %py_build |
a649639e ER |
100 | |
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
3e5f6500 | 104 | %py_install |
a649639e | 105 | |
30a5fd64 ER |
106 | %py_postclean |
107 | ||
f6628fdc | 108 | install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp} |
1d4fba00 ER |
109 | #cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
110 | #cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
8ebc915b ER |
111 | cp -p cobbler.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
112 | cat cobbler_web.conf >> $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf | |
113 | cp -p $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{apache,httpd}.conf | |
f6628fdc | 114 | |
30a5fd64 | 115 | install -d $RPM_BUILD_ROOT/var/lib/tftpboot/images |
8ebc915b | 116 | install -d $RPM_BUILD_ROOT/var/spool/koan |
603eb591 | 117 | install -p cobblerd $RPM_BUILD_ROOT/etc/rc.d/init.d/cobblerd |
a649639e ER |
118 | |
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %post | |
a649639e | 123 | /sbin/chkconfig --add cobblerd |
30a5fd64 ER |
124 | # reserialize and restart |
125 | # FIXIT: ????? | |
126 | #%{_bindir}/cobbler reserialize | |
a649639e ER |
127 | %service cobblerd restart |
128 | ||
129 | %preun | |
30a5fd64 | 130 | if [ $1 = 0 ]; then |
4abcd8ff | 131 | /sbin/chkconfig --del cobblerd |
30a5fd64 | 132 | %service cobblerd stop |
a649639e ER |
133 | fi |
134 | ||
30a5fd64 | 135 | %if 0 |
f6628fdc ER |
136 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
137 | %webapp_register apache %{_webapp} | |
138 | ||
139 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
140 | %webapp_unregister apache %{_webapp} | |
141 | ||
142 | %triggerin -- apache < 2.2.0, apache-base | |
143 | %webapp_register httpd %{_webapp} | |
144 | ||
145 | %triggerun -- apache < 2.2.0, apache-base | |
146 | %webapp_unregister httpd %{_webapp} | |
30a5fd64 ER |
147 | %endif |
148 | ||
149 | %post web | |
150 | # FIXME: this changes on each upgrade -glen | |
151 | # Change the SECRET_KEY option in the Django settings.py file | |
152 | # required for security reasons, should be unique on all systems | |
153 | RAND_SECRET=$(openssl rand -base64 40 | sed 's/\//\\\//g') | |
154 | sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" /usr/share/cobbler/web/settings.py | |
f6628fdc | 155 | |
a649639e ER |
156 | %files |
157 | %defattr(644,root,root,755) | |
158 | %doc AUTHORS CHANGELOG README | |
30a5fd64 ER |
159 | %attr(755,root,root) %{_bindir}/cobbler |
160 | %attr(755,root,root) %{_bindir}/cobbler-ext-nodes | |
161 | %attr(755,root,root) %{_bindir}/cobblerd | |
162 | %attr(755,root,root) %{_sbindir}/tftpd.py* | |
163 | %{_mandir}/man1/cobbler.1* | |
164 | %attr(754,root,root) /etc/rc.d/init.d/cobblerd | |
165 | ||
166 | %dir %{_sysconfdir}/%{name} | |
8ebc915b ER |
167 | %dir %{_sysconfdir}/%{name}/iso |
168 | %dir %{_sysconfdir}/%{name}/ldap | |
169 | %dir %{_sysconfdir}/%{name}/power | |
170 | %dir %{_sysconfdir}/%{name}/pxe | |
171 | %dir %{_sysconfdir}/%{name}/reporting | |
30a5fd64 ER |
172 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf |
173 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.template | |
174 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*/*.template | |
8ebc915b | 175 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/cheetah_macros |
8ebc915b ER |
176 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/completions |
177 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/distro_signatures.json | |
178 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/import_rsync_whitelist | |
179 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/rsync.exclude | |
180 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/settings | |
181 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/users.digest | |
182 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/version | |
30a5fd64 ER |
183 | |
184 | %{py_sitescriptdir}/%{name} | |
30a5fd64 ER |
185 | %{py_sitescriptdir}/%{name}*.egg-info |
186 | ||
187 | %{_datadir}/augeas/lenses/cobblersettings.aug | |
188 | ||
189 | %config(noreplace) /var/lib/cobbler | |
190 | %exclude /var/lib/cobbler/webui_sessions | |
f6628fdc | 191 | |
30a5fd64 ER |
192 | %{_appdir} |
193 | /var/log/cobbler | |
194 | /var/lib/tftpboot/images | |
195 | ||
196 | # XXX | |
197 | %dir /var/www | |
198 | %dir /var/lib/tftpboot | |
199 | ||
200 | %files web | |
201 | %defattr(644,root,root,755) | |
202 | %doc AUTHORS CHANGELOG README | |
f6628fdc ER |
203 | %dir %attr(750,root,http) %{_webapps}/%{_webapp} |
204 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf | |
205 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf | |
206 | ||
f6628fdc | 207 | %dir %{_datadir}/cobbler |
30a5fd64 ER |
208 | %{_datadir}/cobbler/web |
209 | %dir %attr(700,http,root) /var/lib/cobbler/webui_sessions | |
210 | /var/www/cobbler_webui_content | |
211 | ||
212 | %files -n koan | |
213 | %defattr(644,root,root,755) | |
214 | %doc AUTHORS CHANGELOG README | |
215 | %attr(755,root,root) %{_bindir}/koan | |
216 | %attr(755,root,root) %{_bindir}/ovz-install | |
217 | %attr(755,root,root) %{_bindir}/cobbler-register | |
218 | %{_mandir}/man1/koan.1* | |
219 | %{_mandir}/man1/cobbler-register.1* | |
220 | %{py_sitescriptdir}/koan | |
30a5fd64 ER |
221 | |
222 | %dir /var/spool/koan | |
223 | %dir /var/lib/koan | |
224 | %dir /var/lib/koan/config | |
225 | %dir /var/log/koan |