]> git.pld-linux.org Git - packages/cowiki.git/blob - cowiki.spec
- tabs in preamble
[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-05-08
6 %define _rel 0.17
7 Summary:        Web collaboration tool
8 Summary(pl.UTF-8):      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:  f2843189fc24c854414a3e23a4b9ac95
16 Source1:        %{name}.conf
17 Patch0:         %{name}-FHS.patch
18 Patch1:         %{name}-config.patch
19 Patch2:         %{name}-https.patch
20 Patch3:         %{name}-includepath.patch
21 Patch4:         %{name}-tz.patch
22 Patch5:         %{name}-webapps.patch
23 URL:            http://www.cowiki.org/
24 BuildRequires:  rpmbuild(macros) >= 1.268
25 Requires:       apache(mod_dir)
26 Requires:       diffutils
27 Requires:       php(dom)
28 Requires:       php(mysqli)
29 Requires:       php(pcre)
30 Requires:       webapps
31 Requires:       webserver(php) >= 5.0.2
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         _webapps        /etc/webapps
36 %define         _webapp         %{name}
37 %define         _sysconfdir     %{_webapps}/%{_webapp}
38 %define         _appdir         %{_datadir}/%{_webapp}
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
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.
55
56 %package setup
57 Summary:        coWiki setup package
58 Summary(pl.UTF-8):      Pakiet do wstępnej konfiguracji coWiki
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
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.
71
72 %prep
73 %setup -q %{?_snap:-n %{name}-%{version}-interim-%{_snap}}
74 %patch0 -p1
75 %patch1 -p1
76 %patch2 -p1
77 %patch3 -p1
78 %patch4 -p1
79 %patch5 -p1
80
81 mv includes/cowiki/core.conf-dist .
82 rm {htdocs,includes/cowiki}/.cvsignore
83 mv htdocs/.htaccess .
84 rm htdocs/setup/LICENSE # GPL
85 rm -f htdocs/include.path
86
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
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
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir},/var/cache/%{name}}
102 install -d $RPM_BUILD_ROOT/etc/php/apache{,2handler}.d
103
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
108
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
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
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %post
121 if [ "$1" = 1 ]; then
122 %banner %{name} -e <<EOF
123 Install the database using the appropriate "misc/database/*.sql" schema.
124 You must setup authorization and coWiki root password in:
125 - %{_sysconfdir}/core.conf
126
127 EOF
128 fi
129
130 %preun
131 if [ "$1" = "0" ]; then
132         # nuke cache
133         # FIXME could suffer too many arguments error
134         rm -f /var/cache/%{name}/*
135 fi
136
137 %post setup
138 chgrp http %{_appdir}/{htdocs,includes/cowiki}
139 chmod g+w %{_appdir}/{htdocs,includes/cowiki}
140 rm -f %{_appdir}/htdocs/install.seal
141
142 %postun setup
143 if [ "$1" = "0" ]; then
144         chgrp root %{_appdir}/{htdocs,includes/cowiki}
145         chmod g-w %{_appdir}/{htdocs,includes/cowiki}
146         touch %{_appdir}/htdocs/install.seal
147 fi
148
149 %triggerin -- apache1 < 1.3.37-3, apache1-base
150 %webapp_register apache %{_webapp}
151
152 %triggerun -- apache1 < 1.3.37-3, apache1-base
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
161 %files
162 %defattr(644,root,root,755)
163 %doc ChangeLog INSTALL* NEWS
164 %doc README.IDIOM README.PLUGIN SKEL.PLUGIN
165 %doc misc/database
166 %dir %attr(750,root,http) %{_sysconfdir}
167 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
168 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
169 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/core.conf
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
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
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
This page took 0.079713 seconds and 3 git commands to generate.