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