- added template and css for flash warning
[opensuse:yast-web-client.git] / webclient / package / webyast-base-ui.spec
1 #
2 # spec file for package webyast-base-ui (Version 0.1)
3 #
4 # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
7 #
8 # Please submit bugfixes or comments via http://bugs.opensuse.org/
9 #
10
11
12 Name:           webyast-base-ui
13 Provides:       yast2-webclient = %{version}
14 Obsoletes:      yast2-webclient < %{version}
15 Requires:       lighttpd-mod_magnet, ruby-fcgi, sqlite, syslog-ng, check-create-certificate
16 PreReq:         rubygem-rake, rubygem-sqlite3
17 PreReq:         rubygem-rails-2_3 >= 2.3.4
18 PreReq:         rubygem-gettext_rails
19 %if 0%{?suse_version} == 0 || %suse_version > 1110
20 # 11.2 or newer
21 # Require startproc respecting -p, bnc#559534#c44
22 Requires:       sysvinit > 2.86-215.2
23 # Require lighttpd whose postun does not mass kill, bnc#559534#c19
24 # (Updating it later does not work because postun uses the old
25 # version.)
26 PreReq:         lighttpd > 1.4.20-3.6
27 %else
28 # 11.1 or SLES11
29 Requires:       sysvinit > 2.86-195.3.1
30 PreReq:         lighttpd > 1.4.20-2.29.1
31 %endif
32
33 License:        LGPL v2.1;ASLv2.0
34 Group:          Productivity/Networking/Web/Utilities
35 Autoreqprov:    on
36 Version:        0.1.6
37 Release:        0
38 Summary:        YaST2 - Webclient 
39 Source:         www.tar.bz2
40 Source1:        cleanurl-v5.lua
41 Source2:        yastwc
42 Source4:        webyast-ui
43 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
44 BuildRequires:  ruby
45 BuildRequires:  sqlite rubygem-sqlite3
46 BuildRequires:  rubygem-rails-2_3 >= 2.3.4
47 BuildRequires:  rubygem-gettext_rails, rubygem-yast2-webservice-tasks, rubygem-selenium-client
48 BuildRequires:  tidy
49 # we require the lighttpd user to be present when building the rpm
50 BuildRequires:  lighttpd
51 BuildArch:      noarch  
52 %define service_name yastwc
53 #
54
55
56 %description
57 YaST2 - Webclient - Web client for REST based YaST interface.
58
59 Authors:
60 --------
61     Duncan Mac-Vicar Prett <dmacvicar@suse.de>
62     Bjoern Geuken <bgeuken@suse.de>
63     Stefan Schubert <schubi@opensuse.org>
64     Klaus Kaempf <kkaempf@opensuse.org>
65
66 %prep
67 %setup -q -n www
68
69 %build
70 env LANG=en rake makemo
71
72 %install
73
74 #
75 # Install all web and frontend parts.
76 #
77 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/log
78 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/tmp
79 cp -a * $RPM_BUILD_ROOT/srv/www/yast
80 rm -rf $RPM_BUILD_ROOT/srv/www/yast/log/*
81 rm -f $RPM_BUILD_ROOT/srv/www/yast/COPYING
82
83 #
84 # init script
85 #
86 %{__install} -d -m 0755                            \
87     %{buildroot}%{_sbindir}
88
89 %{__install} -D -m 0755 %SOURCE2 \
90     %{buildroot}%{_sysconfdir}/init.d/%{service_name}
91 %{__ln_s} -f %{_sysconfdir}/init.d/%{service_name} %{buildroot}%{_sbindir}/rc%{service_name}
92 #
93
94 # configure lighttpd web service
95 mkdir -p $RPM_BUILD_ROOT/etc/lighttpd
96 install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/etc/lighttpd
97
98 mkdir -p $RPM_BUILD_ROOT/etc/lighttpd/certs
99
100 # firewall service definition, bnc#545627
101 mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services
102 install -m 0644 %SOURCE4 $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services
103
104 #  create empty tmp directory
105 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/tmp
106 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/tmp/cache
107 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/tmp/pids
108 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/tmp/sessions
109 mkdir -p $RPM_BUILD_ROOT/srv/www/yast/tmp/sockets
110
111 %clean
112 rm -rf $RPM_BUILD_ROOT
113
114 %post
115 %fillup_and_insserv %{service_name}
116
117 #
118 # create database 
119 #
120 cd /srv/www/yast
121 RAILS_ENV=production rake db:migrate
122 chgrp lighttpd db db/*.sqlite* log log/*
123 chown lighttpd db db/*.sqlite* log log/*
124 chmod 700 db log
125 chmod 600 db/*.sqlite* log/*
126
127 %preun
128 %stop_on_removal %{service_name}
129
130 %postun
131 %restart_on_update %{service_name}
132 %{insserv_cleanup}
133
134 # restart yastwc on lighttpd update (bnc#559534)
135 %triggerin -- lighttpd
136 %restart_on_update %{service_name}
137
138 %files 
139 %defattr(-,root,root)
140 %dir /srv/www/yast 
141 /srv/www/yast/locale
142 /srv/www/yast/po
143 /srv/www/yast/vendor
144 /srv/www/yast/app  
145 /srv/www/yast/db  
146 /srv/www/yast/doc  
147 /srv/www/yast/lib  
148 /srv/www/yast/public  
149 /srv/www/yast/Rakefile  
150 /srv/www/yast/README*  
151 /srv/www/yast/INSTALL
152 /srv/www/yast/script  
153 /srv/www/yast/config  
154 /srv/www/yast/start.sh
155 %doc README* COPYING  
156 %attr(-,lighttpd,lighttpd) /srv/www/yast/log  
157 %attr(-,lighttpd,lighttpd) /srv/www/yast/tmp
158 %attr(-,lighttpd,root) /srv/www/yast/public/javascripts
159 %config /etc/lighttpd/cleanurl-v5.lua  
160 %config /etc/sysconfig/SuSEfirewall2.d/services/webyast-ui
161 %dir /etc/lighttpd/certs
162 %config(noreplace)  %{_sysconfdir}/init.d/%{service_name}
163 %{_sbindir}/rc%{service_name}
164
165 %changelog  
166 * Tue Nov 27 2008 schubi@suse.de  
167 - initial