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
42 Summary: Virtualization management tool(Web Application)
43 Summary(ja): オープンソースの仮想ホスト管理アプリケーション
46 #Release: %{release}.%{date}
48 Source0: %{__app}-%{version}.tar.gz
50 Group: Applications/System
51 Url: http://karesansui-project.info/
52 Vendor: Karesansui Project
53 Packager: Taizo ITO <taizo@karesansui-project.info>
54 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
58 Requires: hde-libvirt-python
59 Requires: pysilhouette
63 On the Web for virtualization management software to manage.
64 The guest OS and the management of resources and dynamic changes can be done easily.
65 RESTful Web applications in architecture.
68 Summary: UI data for Karesansui Core
69 Group: Applications/System
71 Requires: %{name} = %{version}
74 UI data for Karesansui Core
77 Summary: Basic gadget collection for Karesansui Core
78 Group: Applications/System
80 Requires: %{name} = %{version}
83 Basic gadget collection for Karesansui Core
86 Summary: Basic command collection for Karesansui Core
87 Group: Applications/System
89 Requires: %{name} = %{version}
92 Basic command collection for Karesansui Core
95 Summary: Unit test environment for Karesansui Core
96 Group: Applications/System
98 Requires: %{name} = %{version}
99 Requires: hde-python-paste
102 Unit test environment for Karesansui Core
105 %setup -n %{__app}-%{version}
108 python setup.py build
111 python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --home=%{python_home}
113 install -d -m 0770 $RPM_BUILD_ROOT%{__sysconfdir}
114 %{__cp} -f doc/application.conf.example $RPM_BUILD_ROOT%{__sysconfdir}/application.conf.example
115 %{__cp} -f $RPM_BUILD_ROOT%{__sysconfdir}/application.conf{.example,}
116 %{__cp} -f doc/log.conf.example $RPM_BUILD_ROOT%{__sysconfdir}/log.conf.example
117 %{__cp} -f $RPM_BUILD_ROOT%{__sysconfdir}/log.conf{.example,}
118 %{__cp} -fr doc/lighttpd/ $RPM_BUILD_ROOT%{__sysconfdir}/lighttpd.example/
119 %{__cp} -f doc/whitelist.conf.example $RPM_BUILD_ROOT%{__sysconfdir}/
121 install -d -m 0770 $RPM_BUILD_ROOT/{etc,var}/opt/karesansui
122 install -d -m 0770 $RPM_BUILD_ROOT/var/log/karesansui
123 install -d -m 0770 $RPM_BUILD_ROOT%{__tmpdir}
125 find $RPM_BUILD_ROOT%{python_sitelib}/karesansui -type d -exec chmod g+rwx \{\} \; 2>/dev/null
128 rm -rf $RPM_BUILD_ROOT
132 getent group | %{__grep} "^%{_group}:" >/dev/null 2>&1
133 if [ $? -ne 0 ]; then
135 while test ${__uid} -le %{_uid_max}
137 getent group | %{__grep} "^[^:]*:x:${__uid}:" >/dev/null 2>&1
138 if [ $? -ne 0 ]; then
142 __uid=`expr ${__uid} + 1`
144 /usr/sbin/groupadd -g ${_gid} -f %{_group}
148 getent passwd | %{__grep} "^%{_user}:" >/dev/null 2>&1
149 if [ $? -ne 0 ]; then
151 while test ${__uid} -le %{_uid_max}
153 getent passwd | %{__grep} "^[^:]*:x:${__uid}:" >/dev/null 2>&1
154 if [ $? -ne 0 ]; then
158 __uid=`expr ${__uid} + 1`
160 /usr/sbin/useradd -c "%{_user_doc}" -u ${_uid} -g %{_group} -s /bin/false -r %{_user} 2> /dev/null || :
163 # Add wwwhde user to %{_group} group member
164 %{__grep} ^wwwhde: /etc/passwd >/dev/null 2>&1
165 if [ $? -eq 0 ]; then
166 gpasswd -a wwwhde %{_group} >/dev/null 2>&1
167 gpasswd -a %{_group} wwwhde >/dev/null 2>&1
171 # Modify libvirt configuration file.
172 sysconfig_libvirt=%{_sysconfdir}/sysconfig/hde-libvirtd
173 if [ -f ${sysconfig_libvirt} ]; then
174 %{__grep} "^PRIVSEP_GROUP=" ${sysconfig_libvirt} >/dev/null 2>&1
175 if [ $? -ne 0 ]; then
176 echo "PRIVSEP_GROUP=%{_group}" >>${sysconfig_libvirt}
179 libvirtd_conf=%{__vendor_sysconfdir}/libvirt/libvirtd.conf
180 if [ -f ${libvirtd_conf} ]; then
181 %{__grep} '^unix_sock_group = "root"' ${libvirtd_conf} >/dev/null 2>&1
182 if [ $? -eq 0 ]; then
183 %{__sed} -e "s#unix_sock_group = \"root\"#unix_sock_group = \"%{_group}\"#" ${libvirtd_conf} >${libvirtd_conf}.$$
184 %{__cp} -f ${libvirtd_conf}.$$ ${libvirtd_conf}
185 %{__rm} -f ${libvirtd_conf}.$$
190 if [ -d %{__vendor_sysconfdir} ]; then
191 %{__mkdir_p} %{__vendor_sysconfdir}/xen/xml/
192 %{__chgrp} -R %{_group} %{__vendor_sysconfdir}/xen/ >/dev/null 2>&1
193 %{__chmod} -R g+rw %{__vendor_sysconfdir}/xen/ >/dev/null 2>&1
195 libvirt_datadir=/var/opt/hde/libvirt
196 if [ -d ${libvirt_datadir} ]; then
197 #for subdir in boot images snapshot disk
198 for subdir in domains
200 %{__mkdir_p} ${libvirt_datadir}/${subdir}
201 %{__chmod} g+rwx ${libvirt_datadir}/${subdir} >/dev/null 2>&1
202 %{__chmod} o-rwx ${libvirt_datadir}/${subdir} >/dev/null 2>&1
204 %{__chgrp} -R %{_group} ${libvirt_datadir}/ >/dev/null 2>&1
205 %{__chmod} g+rwx ${libvirt_datadir}/ >/dev/null 2>&1
208 # Modify lighttpd configuration file.
209 for lighttpd_sysconfdir in %{__vendor_sysconfdir}/lighttpd /etc/lighttpd
211 if [ -d ${lighttpd_sysconfdir} ]; then
212 %{__mkdir_p} ${lighttpd_sysconfdir}/conf.d/karesansui/ >/dev/null 2>&1
213 if [ ! -f ${lighttpd_sysconfdir}/conf.d/karesansui.conf ]; then
214 %{__cp} -f %{__sysconfdir}/lighttpd.example/karesansui.conf ${lighttpd_sysconfdir}/conf.d/
215 %{__cp} -f %{__sysconfdir}/lighttpd.example/{access,port,ssl}.conf ${lighttpd_sysconfdir}/conf.d/karesansui/
216 %{__chgrp} -R %{_group} ${lighttpd_sysconfdir}/conf.d/karesansui*
217 %{__chmod} -R 0660 ${lighttpd_sysconfdir}/conf.d/karesansui/*
222 # Register whitelist commands to pysilhouette service.
223 if [ -d %{__pysilhouette_sysconfdir} ]; then
224 if [ ! -s %{__pysilhouette_sysconfdir}/whitelist.conf ]; then
225 %{__cp} -f %{__sysconfdir}/whitelist.conf.example %{__pysilhouette_sysconfdir}/whitelist.conf
231 /usr/sbin/userdel %{_user} 2> /dev/null || :
232 /usr/sbin/groupdel %{_group} 2> /dev/null || :
234 # Modify libvirt configuration file.
235 sysconfig_libvirt=%{_sysconfdir}/sysconfig/hde-libvirtd
236 if [ -f ${sysconfig_libvirt} ]; then
237 %{__grep} -v "^PRIVSEP_GROUP=" ${sysconfig_libvirt} >${sysconfig_libvirt}.$$
238 %{__cp} -f ${sysconfig_libvirt}.$$ ${sysconfig_libvirt}
239 %{__rm} -f ${sysconfig_libvirt}.$$
241 libvirtd_conf=%{__vendor_sysconfdir}/libvirt/libvirtd.conf
242 if [ -f ${libvirtd_conf} ]; then
243 %{__grep} '^unix_sock_group =' ${libvirtd_conf} >/dev/null 2>&1
244 if [ $? -eq 0 ]; then
245 %{__sed} -e "s#unix_sock_group = .*#unix_sock_group = \"root\"#" ${libvirtd_conf} >${libvirtd_conf}.$$
246 %{__cp} -f ${libvirtd_conf}.$$ ${libvirtd_conf}
247 %{__rm} -f ${libvirtd_conf}.$$
252 #%files -f INSTALLED_FILES
253 #%defattr(-,root,root)
257 %defattr(-,root,%{_group})
258 %doc doc tool AUTHORS COPYING COPYING.LIB INSTALL INSTALL.ja README README.ja
259 %dir %{python_sitelib}/
260 %dir %{python_sitelib}/karesansui/
261 %dir %{python_sitelib}/karesansui/db/
262 %dir %{python_sitelib}/karesansui/lib/
263 %dir %{python_sitelib}/karesansui/static/
264 %{python_sitelib}/karesansui/*.py*
265 %{python_sitelib}/karesansui/db/*.py*
266 %{python_sitelib}/karesansui/db/access/*.py*
267 %{python_sitelib}/karesansui/db/model/*.py*
268 %{python_sitelib}/karesansui/lib/*
269 %{python_sitelib}/karesansui/static/js/*
270 %{python_sitelib}/karesansui/static/lib/*
271 %{__sysconfdir}/*.example
272 %defattr(0770,root,%{_group})
273 %config(noreplace) %{__sysconfdir}/*.conf
274 %dir %{__sysconfdir}/
275 %dir /var/opt/karesansui/
276 %dir /var/log/karesansui/
280 %defattr(-,root,%{_group})
281 %dir %{python_sitelib}/karesansui/static/css/
282 %dir %{python_sitelib}/karesansui/static/icon/
283 %dir %{python_sitelib}/karesansui/static/images/
284 %dir %{python_sitelib}/karesansui/locale/
285 %{python_sitelib}/karesansui/static/css/*
286 %{python_sitelib}/karesansui/static/icon/*
287 %{python_sitelib}/karesansui/static/images/*
288 %{python_sitelib}/karesansui/locale/*/LC_MESSAGES/*.mo
291 %defattr(-,root,%{_group})
292 %dir %{python_sitelib}/karesansui/gadget/
293 %dir %{python_sitelib}/karesansui/templates/default/
294 %{python_sitelib}/karesansui/gadget/*
295 %{python_sitelib}/karesansui/templates/default/*
298 %defattr(0770,root,%{_group})
300 %defattr(0550,root,%{_group})
304 %defattr(-,root,%{_group})
305 %dir %{python_sitelib}/karesansui/tests/
306 %{python_sitelib}/karesansui/tests/*
309 * Thu Oct 29 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.3-2
310 - CentOS(i386/x86_64) support.
311 - RHEL(i386/x86_64) support.
312 * Tue Sep 18 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.3-1
313 - Added checker for keymap selection.
314 - Fixed web server setting bugs.
315 - Fixed the following hungup bug.
316 ** glibc detected *** /usr/bin/python: free(): invalid pointer:
317 - Changed the format of system uri path.
318 fixed error "unexpected Xen URI path '/system', try xen:///" for libvirt-0.6.5.
319 * Thu Jun 18 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.2-1
320 - Sparce file support is now available at creating a guest environment.
321 - Keyboard maps selection is now available at creating a guest environment.
322 - Fixed rpm transaction closing order.
323 - Fixed checking of processor support.
324 - sqlite time to register with the system, had not added the time zone information.
325 - Network database is now available as pysilhouette database.
326 - Addresses an issue which karesansui does not work at multi-host environment.
327 * Tue Jun 9 2009 Kei Funagayama <kei@karesansui-project.info> - 1.0.1-1
328 - Karesansui now works on CentOS5.3 64bit(x86_64), RHEL5.3 64bit(x86_64) and RHEL5.3 32bit(x86).
329 - Added support for AMD Athlon64 or Opteron environment.
331 - Improves VNC console keyboard layout support.
332 - Prevents host environment's FQDN from being resolved.
333 - Highlights required items on input forms.
334 - Buttons turn disabled not to be clicked after clicking at dialog window.
335 - Karesansui now works when PostgreSQL is selected as database at the installation process.
336 - Addresses an issue which could not reach the management console after resetting F/W.
337 - Addresses an issue which could not move to other tabs while displaying guest console.
338 - Delete button is now turned disabled after destroying resources.
339 - Network configuration is now editable without errors.
340 - Addresses an issue which occurs when job search is performanced many times.
341 - Creating guest with empty value in "Memory Size" or "Disk Size" now works.
342 - Prevent input data from being posted to other resources when enter key is pressed on input forms.
343 - Improved a check logic about guest ID.
344 - Improved error handling on nonexistent NIC.
345 * Tue May 19 2009 Taizo ITO <taizo@karesansui-project.info> - 1.0.0-1