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