2 %if %{?commerce:0}%{!?commerce:1}
6 %define __python $(which python)
7 %define __app karesansui
10 %define date %(echo `LANG=C date +%%Y%%m%%d%%H%%M%%S`)
13 %define _vendor_name hde
14 %define name %{_vendor_name}-karesansui
15 %define __prefix /opt/%{_vendor_name}
16 %define __sysconfdir %{_sysconfdir}/opt/%{_vendor_name}/%{__app}
17 %define python_home %{__prefix}
19 %define _vendor_name %{nil}
21 %define name karesansui
22 %define __sysconfdir %{_sysconfdir}/opt/%{__app}
23 %define python_home %{__prefix}/%{__app}
26 %define __bindir %{__prefix}/%{__app}/bin
27 %define __tmpdir %{__prefix}/%{__app}/tmp
28 %define _defaultdocdir %{__prefix}/%{__app}/share/doc
29 %define python_sitelib %{python_home}/lib/python
31 %define __pysilhouette_prefix %{__prefix}/pysilhouette
32 %define __pysilhouette_sysconfdir %{_sysconfdir}/opt/pysilhouette
34 %define __vendor_sysconfdir %{_sysconfdir}/opt/hde
38 %define _user_doc Karesansui Project
41 %define _group_member wwwhde
43 Summary: Virtualization management tool(Web Application)
44 Summary(ja): オープンソースの仮想ホスト管理アプリケーション
47 #Release: %{release}.%{date}
49 Source0: %{__app}-%{version}.tar.gz
51 Group: Applications/System
52 Url: http://karesansui-project.info/
53 Vendor: Karesansui Project
54 Packager: Taizo ITO <taizo@karesansui-project.info>
55 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
59 Requires: hde-libvirt-python
60 Requires: pysilhouette
64 On the Web for virtualization management software to manage.
65 The guest OS and the management of resources and dynamic changes can be done easily.
66 RESTful Web applications in architecture.
69 Summary: UI data for Karesansui Core
70 Group: Applications/System
72 Requires: %{name} = %{version}
75 UI data for Karesansui Core
78 Summary: Basic gadget collection for Karesansui Core
79 Group: Applications/System
81 Requires: %{name} = %{version}
84 Basic gadget collection for Karesansui Core
87 Summary: Basic command collection for Karesansui Core
88 Group: Applications/System
90 Requires: %{name} = %{version}
93 Basic command collection for Karesansui Core
96 Summary: Unit test environment for Karesansui Core
97 Group: Applications/System
99 Requires: %{name} = %{version}
100 Requires: hde-python-paste
103 Unit test environment for Karesansui Core
106 Summary: additional packages that extend functionality of existing packages
107 Group: Applications/System
108 License: See the source code
109 Requires: %{name} = %{version}
114 additional packages that extend functionality of existing packages
117 %setup -n %{__app}-%{version}
120 python setup.py build
123 python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --home=%{python_home}
125 install -d -m 0770 $RPM_BUILD_ROOT%{__sysconfdir}
126 %{__cp} -f doc/application.conf.example $RPM_BUILD_ROOT%{__sysconfdir}/application.conf.example
127 %{__cp} -f $RPM_BUILD_ROOT%{__sysconfdir}/application.conf{.example,}
128 %{__cp} -f doc/log.conf.example $RPM_BUILD_ROOT%{__sysconfdir}/log.conf.example
129 %{__cp} -f $RPM_BUILD_ROOT%{__sysconfdir}/log.conf{.example,}
130 %{__cp} -fr doc/lighttpd/ $RPM_BUILD_ROOT%{__sysconfdir}/lighttpd.example/
131 %{__cp} -f doc/whitelist.conf.example $RPM_BUILD_ROOT%{__sysconfdir}/
132 %{__cp} -f doc/service.xml.example $RPM_BUILD_ROOT%{__sysconfdir}/service.xml
133 %{__cp} -fr doc/template/ $RPM_BUILD_ROOT%{__sysconfdir}/template/
135 install -d -m 0770 $RPM_BUILD_ROOT/{etc,var}/opt/karesansui
136 install -d -m 0770 $RPM_BUILD_ROOT/var/log/karesansui
137 install -d -m 0770 $RPM_BUILD_ROOT%{__tmpdir}
139 find $RPM_BUILD_ROOT%{python_sitelib}/karesansui -type d -exec chmod g+rwx \{\} \; 2>/dev/null
141 install -d -m 0770 $RPM_BUILD_ROOT/{etc,var}/opt/karesansui/cache
142 install -d -m 0770 $RPM_BUILD_ROOT/{etc,var}/opt/karesansui/cache/yum
145 rm -rf $RPM_BUILD_ROOT
149 getent group | %{__grep} "^%{_group}:" >/dev/null 2>&1
150 if [ $? -ne 0 ]; then
152 while test ${__uid} -le %{_uid_max}
154 getent group | %{__grep} "^[^:]*:x:${__uid}:" >/dev/null 2>&1
155 if [ $? -ne 0 ]; then
159 __uid=`expr ${__uid} + 1`
161 /usr/sbin/groupadd -g ${_gid} -f %{_group}
165 getent passwd | %{__grep} "^%{_user}:" >/dev/null 2>&1
166 if [ $? -ne 0 ]; then
168 while test ${__uid} -le %{_uid_max}
170 getent passwd | %{__grep} "^[^:]*:x:${__uid}:" >/dev/null 2>&1
171 if [ $? -ne 0 ]; then
175 __uid=`expr ${__uid} + 1`
177 /usr/sbin/useradd -c "%{_user_doc}" -u ${_uid} -g %{_group} -s /bin/false -r %{_user} 2> /dev/null || :
180 # Add %{_group_member} user to %{_group} group member
181 %{__grep} ^%{_group_member}: /etc/passwd >/dev/null 2>&1
182 if [ $? -eq 0 ]; then
183 gpasswd -a %{_group_member} %{_group} >/dev/null 2>&1
184 gpasswd -a %{_group} %{_group_member} >/dev/null 2>&1
188 # Modify libvirt configuration file.
189 sysconfig_libvirt=%{_sysconfdir}/sysconfig/hde-libvirtd
190 if [ -f ${sysconfig_libvirt} ]; then
191 %{__grep} "^PRIVSEP_GROUP=" ${sysconfig_libvirt} >/dev/null 2>&1
192 if [ $? -ne 0 ]; then
193 echo "PRIVSEP_GROUP=%{_group}" >>${sysconfig_libvirt}
196 libvirtd_conf=%{__vendor_sysconfdir}/libvirt/libvirtd.conf
197 if [ -f ${libvirtd_conf} ]; then
198 %{__grep} '^unix_sock_group = "root"' ${libvirtd_conf} >/dev/null 2>&1
199 if [ $? -eq 0 ]; then
200 %{__sed} -e "s#unix_sock_group = \"root\"#unix_sock_group = \"%{_group}\"#" ${libvirtd_conf} >${libvirtd_conf}.$$
201 %{__cp} -f ${libvirtd_conf}.$$ ${libvirtd_conf}
202 %{__rm} -f ${libvirtd_conf}.$$
207 if [ -d %{__vendor_sysconfdir} ]; then
208 %{__mkdir_p} %{__vendor_sysconfdir}/xen/xml/
209 %{__chgrp} -R %{_group} %{__vendor_sysconfdir}/xen/ >/dev/null 2>&1
210 %{__chmod} -R g+rw %{__vendor_sysconfdir}/xen/ >/dev/null 2>&1
212 libvirt_datadir=/var/opt/hde/libvirt
213 if [ -d ${libvirt_datadir} ]; then
214 #for subdir in boot images snapshot disk
215 for subdir in domains
217 %{__mkdir_p} ${libvirt_datadir}/${subdir}
218 %{__chmod} g+rwx ${libvirt_datadir}/${subdir} >/dev/null 2>&1
219 %{__chmod} o-rwx ${libvirt_datadir}/${subdir} >/dev/null 2>&1
221 %{__chgrp} -R %{_group} ${libvirt_datadir}/ >/dev/null 2>&1
222 %{__chmod} g+rwx ${libvirt_datadir}/ >/dev/null 2>&1
225 # Modify lighttpd configuration file.
226 for lighttpd_sysconfdir in %{__vendor_sysconfdir}/lighttpd /etc/lighttpd
228 if [ -d ${lighttpd_sysconfdir} ]; then
229 %{__mkdir_p} ${lighttpd_sysconfdir}/conf.d/karesansui/ >/dev/null 2>&1
230 if [ ! -f ${lighttpd_sysconfdir}/conf.d/karesansui.conf ]; then
231 %{__cp} -f %{__sysconfdir}/lighttpd.example/karesansui.conf ${lighttpd_sysconfdir}/conf.d/
232 %{__cp} -f %{__sysconfdir}/lighttpd.example/{access,port,ssl}.conf ${lighttpd_sysconfdir}/conf.d/karesansui/
233 %{__chgrp} -R %{_group} ${lighttpd_sysconfdir}/conf.d/karesansui*
234 %{__chmod} -R 0660 ${lighttpd_sysconfdir}/conf.d/karesansui/*
239 # Register whitelist commands to pysilhouette service.
240 if [ -d %{__pysilhouette_sysconfdir} ]; then
241 if [ ! -s %{__pysilhouette_sysconfdir}/whitelist.conf ]; then
242 %{__cp} -f %{__sysconfdir}/whitelist.conf.example %{__pysilhouette_sysconfdir}/whitelist.conf
248 /usr/sbin/userdel %{_user} 2> /dev/null || :
249 /usr/sbin/groupdel %{_group} 2> /dev/null || :
251 # Modify libvirt configuration file.
252 sysconfig_libvirt=%{_sysconfdir}/sysconfig/hde-libvirtd
253 if [ -f ${sysconfig_libvirt} ]; then
254 %{__grep} -v "^PRIVSEP_GROUP=" ${sysconfig_libvirt} >${sysconfig_libvirt}.$$
255 %{__cp} -f ${sysconfig_libvirt}.$$ ${sysconfig_libvirt}
256 %{__rm} -f ${sysconfig_libvirt}.$$
258 libvirtd_conf=%{__vendor_sysconfdir}/libvirt/libvirtd.conf
259 if [ -f ${libvirtd_conf} ]; then
260 %{__grep} '^unix_sock_group =' ${libvirtd_conf} >/dev/null 2>&1
261 if [ $? -eq 0 ]; then
262 %{__sed} -e "s#unix_sock_group = .*#unix_sock_group = \"root\"#" ${libvirtd_conf} >${libvirtd_conf}.$$
263 %{__cp} -f ${libvirtd_conf}.$$ ${libvirtd_conf}
264 %{__rm} -f ${libvirtd_conf}.$$
269 #%files -f INSTALLED_FILES
270 #%defattr(-,root,root)
274 %defattr(-,root,%{_group})
275 %doc doc tool AUTHORS COPYING COPYING.LIB INSTALL INSTALL.ja README README.ja
276 %dir %{python_sitelib}/
277 %dir %{python_sitelib}/karesansui/
278 %dir %{python_sitelib}/karesansui/db/
279 %dir %{python_sitelib}/karesansui/lib/
280 %dir %{python_sitelib}/karesansui/static/
281 %{python_sitelib}/karesansui/*.py*
282 %{python_sitelib}/karesansui/db/*.py*
283 %{python_sitelib}/karesansui/db/access/*.py*
284 %{python_sitelib}/karesansui/db/model/*.py*
285 %{python_sitelib}/karesansui/lib/*
286 %{python_sitelib}/karesansui/static/js/*
287 %{python_sitelib}/karesansui/static/lib/*
288 %{__sysconfdir}/*.example
289 %defattr(0770,root,%{_group})
290 %config(noreplace) %{__sysconfdir}/*.conf
291 %config(noreplace) %{__sysconfdir}/*.xml
292 %dir %{__sysconfdir}/
293 %dir %{__sysconfdir}/template/
294 %{__sysconfdir}/template/*
295 %dir /var/opt/karesansui/
296 %dir /var/log/karesansui/
298 %defattr(0770,root,%{_group})
299 %dir /var/opt/karesansui/cache
300 %defattr(0770,%{_group_member},%{_group})
301 %dir /var/opt/karesansui/cache/yum
304 %defattr(-,root,%{_group})
305 %dir %{python_sitelib}/karesansui/static/css/
306 %dir %{python_sitelib}/karesansui/static/icon/
307 %dir %{python_sitelib}/karesansui/static/images/
308 %dir %{python_sitelib}/karesansui/locale/
309 %{python_sitelib}/karesansui/static/css/*
310 %{python_sitelib}/karesansui/static/icon/*
311 %{python_sitelib}/karesansui/static/images/*
312 %{python_sitelib}/karesansui/locale/*/LC_MESSAGES/*.mo
315 %defattr(-,root,%{_group})
316 %dir %{python_sitelib}/karesansui/gadget/
317 %dir %{python_sitelib}/karesansui/templates/default/
318 %{python_sitelib}/karesansui/gadget/*
319 %{python_sitelib}/karesansui/templates/default/*
322 %defattr(0770,root,%{_group})
324 %defattr(0550,root,%{_group})
328 %defattr(-,root,%{_group})
329 %dir %{python_sitelib}/karesansui/tests/
330 %{python_sitelib}/karesansui/tests/*
333 %defattr(-,root,%{_group})
334 %dir %{python_sitelib}/karesansui/plus/
335 %{python_sitelib}/karesansui/plus/*
338 * Mon May 24 2010 Taizo ITO <taizo@karesansui-project.info> - 2.0.0-1
339 - version 2.0.0 beta release.
341 * Wed Jan 06 2010 Kei Funagayama <kei@karesansui-project.info> - 1.1.0-4
342 - version 1.1.0 beta release.
344 * Fri Dec 25 2009 Taizo ITO <taizo@karesansui-project.info> - 1.1.0-3
345 - Fixed attach/detach device.
347 * Mon Dec 14 2009 Kei Funagayama <kei@karesansui-project.info> - 1.1.0-2
348 - Add "plus" package.
349 - Add Software Update feature.
351 * Thu Dec 10 2009 Taizo ITO <taizo@karesansui-project.info> - 1.1.0-1
353 - Changed paths for domain's image data.
355 * Thu Oct 29 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.3-2
356 - CentOS(i386/x86_64) support.
357 - RHEL(i386/x86_64) support.
359 * Tue Sep 18 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.3-1
360 - Added checker for keymap selection.
361 - Fixed web server setting bugs.
362 - Fixed the following hungup bug.
363 ** glibc detected *** /usr/bin/python: free(): invalid pointer:
364 - Changed the format of system uri path.
365 fixed error "unexpected Xen URI path '/system', try xen:///" for libvirt-0.6.5.
367 * Thu Jun 18 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.2-1
368 - Sparce file support is now available at creating a guest environment.
369 - Keyboard maps selection is now available at creating a guest environment.
370 - Fixed rpm transaction closing order.
371 - Fixed checking of processor support.
372 - sqlite time to register with the system, had not added the time zone information.
373 - Network database is now available as pysilhouette database.
374 - Addresses an issue which karesansui does not work at multi-host environment.
376 * Tue Jun 9 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.1-1
377 - Karesansui now works on CentOS5.3 64bit(x86_64), RHEL5.3 64bit(x86_64) and RHEL5.3 32bit(x86).
378 - Added support for AMD Athlon64 or Opteron environment.
380 - Improves VNC console keyboard layout support.
381 - Prevents host environment's FQDN from being resolved.
382 - Highlights required items on input forms.
383 - Buttons turn disabled not to be clicked after clicking at dialog window.
384 - Karesansui now works when PostgreSQL is selected as database at the installation process.
385 - Addresses an issue which could not reach the management console after resetting F/W.
386 - Addresses an issue which could not move to other tabs while displaying guest console.
387 - Delete button is now turned disabled after destroying resources.
388 - Network configuration is now editable without errors.
389 - Addresses an issue which occurs when job search is performanced many times.
390 - Creating guest with empty value in "Memory Size" or "Disk Size" now works.
391 - Prevent input data from being posted to other resources when enter key is pressed on input forms.
392 - Improved a check logic about guest ID.
393 - Improved error handling on nonexistent NIC.
395 * Tue May 19 2009 Taizo ITO <taizo@karesansui-project.info> - 1.0.0-1