]>
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 ER |
5 | # - bash-completions |
6 | %define subver beta5 | |
7 | %define rel 0.6 | |
a649639e | 8 | Summary: Boot server configurator |
6a99c4df | 9 | Summary(pl.UTF-8): Konfiguracja serwera startującego |
a649639e | 10 | Name: cobbler |
30a5fd64 ER |
11 | Version: 2.4.0 |
12 | Release: 0.%{subver}.%{rel} | |
6a99c4df JB |
13 | License: GPL v2+ |
14 | Group: Applications/System | |
30a5fd64 ER |
15 | Source0: https://github.com/cobbler/cobbler/archive/%{name}-%{version}-%{subver}.tar.gz |
16 | # Source0-md5: f0b63f64d679e3ee547de2d97b74e681 | |
f6628fdc | 17 | Source1: %{name}-apache.conf |
30a5fd64 ER |
18 | URL: http://www.cobblerd.org/ |
19 | BuildRequires: python-PyYAML | |
6a99c4df JB |
20 | BuildRequires: python-cheetah |
21 | BuildRequires: python-devel | |
6a99c4df | 22 | Requires(post,preun): /sbin/chkconfig |
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 |
a649639e | 36 | BuildArch: noarch |
a649639e ER |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
38 | ||
f6628fdc ER |
39 | %define _webapps /etc/webapps |
40 | %define _webapp %{name} | |
4abcd8ff ER |
41 | %define _appdir /var/www/cobbler |
42 | %define _cgibindir /var/www/cgi-bin | |
43 | ||
44 | #define _appdir %{_datadir}/%{name} | |
45 | #define _cgibindir %{_prefix}/lib/cgi-bin/%{name} | |
46 | ||
a649639e ER |
47 | %description |
48 | Cobbler is a network boot and update server. Cobbler supports PXE, | |
49 | provisioning virtualized images, and reinstalling existing Linux | |
50 | machines. The last two modes require a helper tool called 'koan' that | |
6a99c4df | 51 | integrates with Cobbler. Cobbler's advanced features include importing |
a649639e ER |
52 | distributions from DVDs and rsync mirrors, kickstart templating, |
53 | integrated yum mirroring, and built-in DHCP Management. Cobbler has a | |
54 | Python API for integration with other GPL systems management | |
55 | applications. | |
56 | ||
6a99c4df JB |
57 | %description -l pl.UTF-8 |
58 | Cobbler to sieciowy serwer do uruchamiania i uaktualniania komputerów. | |
59 | Obsługuje PXE, udostępnianie wirtualizowanych obrazów i reinstalowanie | |
60 | istniejących maszyn linuksowych. Dwa ostatnie tryby wymagają pakietu | |
61 | pomocniczego o nazwie "koan", integrującego się z Cobblerem. | |
62 | Zaawansowane możliwości Cobblera obejmują importowanie dystrybucji z | |
63 | płyt DVD i mirrorów rsynca, szablony uruchamiania, zintegrowane | |
64 | mirrorowanie repozytoriów yuma oraz wbudowane zarządzanie DHCP. | |
65 | Cobbler ma API w Pythonie do integracji z innymi aplikacjami | |
66 | zarządzającymi na licencji GPL. | |
67 | ||
30a5fd64 ER |
68 | %package web |
69 | Summary: Web interface for Cobbler | |
70 | Group: Applications/System | |
71 | Requires: %{name} = %{version}-%{release} | |
72 | Requires: apache-mod_wsgi | |
73 | Requires: apache-mod_ssl | |
74 | Requires: python-django >= 1.1.2 | |
75 | ||
76 | %description web | |
77 | Web interface for Cobbler that allows visiting | |
78 | <http://server/cobbler_web> to configure the install server. | |
79 | ||
80 | %package -n koan | |
81 | Summary: Helper tool that performs cobbler orders on remote machines | |
82 | Group: Applications/System | |
83 | Requires: python-simplejson | |
84 | Requires: python-virtinst | |
85 | ||
86 | %description -n koan | |
87 | Koan stands for kickstart-over-a-network and allows for both network | |
88 | installation of new virtualized guests and reinstallation of an | |
89 | existing system. For use with a boot-server configured with Cobbler | |
90 | ||
a649639e | 91 | %prep |
30a5fd64 | 92 | %setup -q -n %{name}-%{name}-%{version}-%{subver} |
a649639e ER |
93 | |
94 | %build | |
95 | %{__python} setup.py build | |
96 | ||
97 | %install | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | install -d $RPM_BUILD_ROOT/etc/rc.d/init.d | |
100 | %{__python} setup.py install \ | |
30a5fd64 | 101 | --optimize=2 \ |
a649639e ER |
102 | --root=$RPM_BUILD_ROOT |
103 | ||
30a5fd64 ER |
104 | %py_postclean |
105 | ||
f6628fdc | 106 | install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp} |
1d4fba00 ER |
107 | #cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
108 | #cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
109 | mv $RPM_BUILD_ROOT{%{_sysconfdir}/httpd/conf.d/cobbler.conf,%{_webapps}/%{_webapp}/apache.conf} | |
30a5fd64 ER |
110 | #mv config/cobbler.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/ |
111 | #mv config/cobbler_web.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/ | |
1d4fba00 | 112 | cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{apache,httpd}.conf |
f6628fdc | 113 | |
30a5fd64 ER |
114 | install -d $RPM_BUILD_ROOT/var/lib/tftpboot/images |
115 | mkdir -p $RPM_BUILD_ROOT/var/spool/koan | |
a649639e | 116 | |
1d4fba00 | 117 | mv $RPM_BUILD_ROOT/''etc/{init.d,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} | |
167 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf | |
168 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.template | |
169 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*/*.template | |
170 | ||
171 | %{py_sitescriptdir}/%{name} | |
172 | # XXX why | |
173 | #%exclude %{py_sitescriptdir}/%{name}/sub_process.py* | |
174 | %{py_sitescriptdir}/%{name}*.egg-info | |
175 | ||
176 | %{_datadir}/augeas/lenses/cobblersettings.aug | |
177 | ||
178 | %config(noreplace) /var/lib/cobbler | |
179 | %exclude /var/lib/cobbler/webui_sessions | |
f6628fdc | 180 | |
30a5fd64 ER |
181 | %{_appdir} |
182 | /var/log/cobbler | |
183 | /var/lib/tftpboot/images | |
184 | ||
185 | # XXX | |
186 | %dir /var/www | |
187 | %dir /var/lib/tftpboot | |
188 | ||
189 | %files web | |
190 | %defattr(644,root,root,755) | |
191 | %doc AUTHORS CHANGELOG README | |
f6628fdc ER |
192 | %dir %attr(750,root,http) %{_webapps}/%{_webapp} |
193 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf | |
194 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf | |
195 | ||
f6628fdc | 196 | %dir %{_datadir}/cobbler |
30a5fd64 ER |
197 | %{_datadir}/cobbler/web |
198 | %dir %attr(700,http,root) /var/lib/cobbler/webui_sessions | |
199 | /var/www/cobbler_webui_content | |
200 | ||
201 | %files -n koan | |
202 | %defattr(644,root,root,755) | |
203 | %doc AUTHORS CHANGELOG README | |
204 | %attr(755,root,root) %{_bindir}/koan | |
205 | %attr(755,root,root) %{_bindir}/ovz-install | |
206 | %attr(755,root,root) %{_bindir}/cobbler-register | |
207 | %{_mandir}/man1/koan.1* | |
208 | %{_mandir}/man1/cobbler-register.1* | |
209 | %{py_sitescriptdir}/koan | |
210 | # XXX why? | |
211 | #%exclude %{py_sitescriptdir}/koan/sub_process.py* | |
212 | #%exclude %{py_sitescriptdir}/koan/opt_parse.py* | |
213 | #%exclude %{py_sitescriptdir}/koan/text_wrap.py* | |
214 | ||
215 | %dir /var/spool/koan | |
216 | %dir /var/lib/koan | |
217 | %dir /var/lib/koan/config | |
218 | %dir /var/log/koan |