]> git.pld-linux.org Git - packages/cowiki.git/blob - cowiki.spec
ef66ad30503f328231f74aadd26c85c5629fda46
[packages/cowiki.git] / cowiki.spec
1 # TODO
2 #  - lighttpd integration possible <http://wiki.lighttpd.net/33.html>.
3 #  - theoretically mysql,mysqli,pgsql,sqlite connectors are possible.
4
5 %define _snap 2006-03-17
6 %define _rel 0.7
7 Summary:        Web collaboration tool
8 Summary(pl):    Narzêdzie do wspó³pracy i wspó³tworzenia w sieci
9 Name:           cowiki
10 Version:        0.4.0
11 Release:        %{?_snap:1.%(echo %{_snap} | tr -d -).}%{_rel}
12 License:        GPL
13 Group:          Applications/WWW
14 Source0:        http://snaps.cowiki.org/%{name}-%{version}-interim-%{_snap}.tar.gz
15 # Source0-md5:  2aaf6115460ca1674d6de381f07a4e68
16 Source1:        %{name}.conf
17 Patch0:         %{name}-FHS.patch
18 Patch1:         %{name}-config.patch
19 Patch2:         %{name}-https.patch
20 URL:            http://www.cowiki.org/
21 BuildRequires:  rpmbuild(macros) >= 1.268
22 Requires:       apache(mod_dir)
23 Requires:       diffutils
24 Requires:       php >= 4:5.0.2
25 Requires:       php-dom
26 Requires:       php-mysqli
27 Requires:       php-pcre
28 Requires:       webapps
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %define         _webapps        /etc/webapps
33 %define         _webapp         %{name}
34 %define         _sysconfdir     %{_webapps}/%{_webapp}
35 %define         _appdir         %{_datadir}/%{_webapp}
36
37 %description
38 coWiki is a sophisticated but easy to use web collaboration tool that
39 helps you and your co-workers to create and organize web documents,
40 weblogs and knowledgebases or any other document structures directly
41 in their HTML browser. You may evolve ideas and gain a concomitant XML
42 documentation of your brainstorming without having to concentrate on
43 complicated structural syntaxes.
44
45 %description -l pl
46 coWiki to wyszukane, ale ³atwe w u¿yciu narzêdzie do pracy zespo³owej
47 przez WWW pomagaj±ce wspó³pracownikom tworzyæ i organizowaæ dokumenty
48 WWW, weblogi, bazy wiedzy lub dowolne inne struktury dokumentów
49 bezpo¶rednio w przegl±darce HTML. Mo¿na rozwijaæ idee i otrzymywaæ
50 towarzysz±c± dokumentacjê XML burzy mózgów bez potrzeby koncentrowania
51 siê na skomplikowanej sk³adni strukturalnej.
52
53 %package setup
54 Summary:        coWiki setup package
55 Summary(pl):    Pakiet do wstêpnej konfiguracji coWiki
56 Group:          Applications/WWW
57 Requires:       %{name} = %{version}-%{release}
58
59 %description setup
60 Install this package to configure initial coWiki installation. You
61 should uninstall this package when you're done, as it considered
62 insecure to keep the setup files in place.
63
64 %description setup -l pl
65 Ten pakiet nale¿y zainstalowaæ w celu wstêpnej konfiguracji coWiki po
66 pierwszej instalacji. Potem nale¿y go odinstalowaæ, jako ¿e
67 pozostawienie plików instalacyjnych mog³oby byæ niebezpieczne.
68
69 %prep
70 %setup -q %{?_snap:-n %{name}-%{version}-interim-%{_snap}}
71 %patch0 -p1
72 %patch1 -p1
73 %patch2 -p1
74
75 mv includes/cowiki/core.conf-dist .
76 rm {htdocs,includes/cowiki}/.cvsignore
77 mv htdocs/.htaccess .
78 rm htdocs/setup/LICENSE # GPL
79
80 cat <<'EOF' > misc/database/mysql-grant.sql
81 # this schema will grant MySQL database access
82 GRANT SELECT, INSERT, UPDATE, DELETE ON cowiki.* TO 'cowiki'@'localhost' IDENTIFIED BY 'password
83 ';
84 EOF
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir},/var/cache/%{name}}
89
90 cp -a htdocs includes misc $RPM_BUILD_ROOT%{_appdir}
91 install core.conf-dist $RPM_BUILD_ROOT%{_sysconfdir}/core.conf
92 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
93 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
94
95 # for setup
96 install LICENSE $RPM_BUILD_ROOT%{_appdir}/htdocs/setup
97 install core.conf-dist $RPM_BUILD_ROOT%{_appdir}/includes/cowiki/core.conf-dist
98 touch $RPM_BUILD_ROOT%{_appdir}/htdocs/install.seal
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %post
104 if [ "$1" = 1 ]; then
105 %banner %{name} -e <<EOF
106 Install the database using the appropriate "misc/database/*.sql" schema.
107 You must setup authorization and coWiki root password in:
108 - %{_sysconfdir}/core.conf
109
110 EOF
111 fi
112
113 %preun
114 if [ "$1" = "0" ]; then
115         # nuke cache
116         # FIXME could suffer too many arguments error
117         rm -f /var/cache/%{name}/*
118 fi
119
120 %post setup
121 chgrp http %{_appdir}/{htdocs/include.path,htdocs,includes/cowiki}
122 chmod g+w %{_appdir}/{htdocs/include.path,htdocs,includes/cowiki}
123 rm -f %{_appdir}/htdocs/install.seal
124
125 %postun setup
126 if [ "$1" = "0" ]; then
127         chgrp root %{_appdir}/{htdocs/include.path,htdocs,includes/cowiki}
128         chmod g-w %{_appdir}/{htdocs/include.path,htdocs,includes/cowiki}
129         touch %{_appdir}/htdocs/install.seal
130 fi
131
132 %triggerin -- apache1
133 %webapp_register apache %{_webapp}
134
135 %triggerun -- apache1
136 %webapp_unregister apache %{_webapp}
137
138 %triggerin -- apache < 2.2.0, apache-base
139 %webapp_register httpd %{_webapp}
140
141 %triggerun -- apache < 2.2.0, apache-base
142 %webapp_unregister httpd %{_webapp}
143
144 # cache dir moved
145 %triggerun -- %{name} < 0.4.0-0.20050618.3
146 # FIXME could suffer too many arguments error
147 rm -f /var/lib/%{name}/*
148
149 %triggerpostun -- %{name} < 0.4.0-0.20060206.0.2
150 # rescue app config
151 if [ -f /etc/%{name}/core.conf.rpmsave ]; then
152         mv -f %{_sysconfdir}/core.conf{,.rpmnew}
153         mv -f /etc/%{name}/core.conf.rpmsave %{_sysconfdir}/core.conf
154 fi
155 # migrate from apache-config macros
156 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
157         if [ -d /etc/apache/webapps.d ]; then
158                 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
159                 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/apache.conf
160         fi
161
162         if [ -d /etc/httpd/webapps.d ]; then
163                 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
164                 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
165         fi
166         rm -f /etc/%{name}/apache.conf.rpmsave
167 fi
168
169 # migrating from earlier apache-config?
170 if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
171         rm -f /etc/apache/conf.d/99_%{name}.conf
172         /usr/sbin/webapp register apache %{_webapp}
173         %service -q apache reload
174 fi
175 if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
176         rm -f /etc/httpd/httpd.conf/99_%{name}.conf
177         /usr/sbin/webapp register httpd %{_webapp}
178         %service -q httpd reload
179 fi
180
181 %files
182 %defattr(644,root,root,755)
183 %doc ChangeLog INSTALL* NEWS
184 %doc README.IDIOM README.PLUGIN SKEL.PLUGIN
185 %doc misc/database
186 %dir %attr(750,root,http) %{_sysconfdir}
187 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
188 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
189 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/core.conf
190
191 %dir %{_appdir}
192 %{_appdir}/misc
193 %dir %{_appdir}/includes
194 %dir %{_appdir}/includes/cowiki
195 %{_appdir}/includes/cowiki/class
196 %{_appdir}/includes/cowiki/locale
197 %{_appdir}/includes/cowiki/plugin
198 %{_appdir}/includes/cowiki/*.php
199 %dir %{_appdir}/htdocs
200 %{_appdir}/htdocs/img
201 %{_appdir}/htdocs/tpl
202 %{_appdir}/htdocs/*.txt
203 %{_appdir}/htdocs/*.php
204 %{_appdir}/htdocs/favicon.ico
205 %{_appdir}/htdocs/include.path
206
207 %dir %attr(770,root,http) /var/cache/%{name}
208
209 # setup seal
210 %config(noreplace,missingok) %verify(not md5 mtime size) %{_appdir}/htdocs/install.seal
211
212 %files setup
213 %defattr(644,root,root,755)
214 %{_appdir}/htdocs/setup
215 %{_appdir}/htdocs/install.pending
216 %{_appdir}/includes/cowiki/core.conf-dist
This page took 0.097651 seconds and 3 git commands to generate.