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