]> git.pld-linux.org Git - packages/cowiki.git/blob - cowiki.spec
- pl
[packages/cowiki.git] / cowiki.spec
1 # TODO
2 #  - lighttpd integration possible <http://wiki.lighttpd.net/33.html>.
3
4 # snapshot: DATE
5 %define _snap 2005-02-20
6
7 %if 0%{?_snap}
8 %define _source http://snaps.cowiki.org/%{name}-%{version}-dev-%{_snap}.tar.gz
9 %else
10 %define _source http://cowiki.org/download/%{name}-%{version}.tar.gz
11 %endif
12 %define _rel 0.20
13
14 Summary:        Web collaboration tool
15 Name:           cowiki
16 Version:        0.3.4
17 Release:        %{?_snap:0.%(echo %{_snap} | tr -d -).}%{_rel}
18 Epoch:          0
19 License:        GPL
20 Group:          Applications/WWW
21 Source0:        %{_source}
22 # Source0-md5:  6351667cdfbf3b6e8937af855a4414ba
23 Patch0:         %{name}-FHS.patch
24 URL:            http://cowiki.org/
25 BuildRequires:  rpmbuild(macros) >= 1.177
26 Requires:       php >= 5.0.2
27 Requires:       php-mysql
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         _appdir %{_datadir}/%{name}
32 %define         _sysconfdir     /etc/%{name}
33 %define         _apache1dir     /etc/apache
34 %define         _apache2dir     /etc/httpd
35
36 %description
37 coWiki is a sophisticated but easy to use web collaboration tool that
38 helps you and your co-workers to create and organize web documents,
39 weblogs and knowledgebases or any other document structures directly
40 in their HTML browser. You may evolve ideas and gain a concomitant XML
41 documentation of your brainstorming without having to concentrate on
42 complicated structural syntaxes.
43
44 %description -l pl
45 coWiki to wyszukane, ale ³atwe w u¿yciu narzêdzie do pracy zespo³owej
46 przez WWW pomagaj±ce wspó³pracownikom tworzyæ i organizowaæ dokumenty
47 WWW, weblogi, bazy wiedzy lub dowolne inne struktury dokumentów
48 bezpo¶rednio w przegl±darce HTML. Mo¿na rozwijaæ idee i otrzymywaæ
49 towarzysz±c± dokumentacjê XML burzy mózgów bez potrzeby koncentrowania
50 siê na skomplikowanej sk³adni strukturalnej.
51
52 %prep
53 %setup -q %{?_snap:-n %{name}-%{version}-dev-%{_snap}}
54 %patch0 -p1
55
56 mv includes/cowiki/core.conf-dist .
57 rm -f {htdocs,includes/cowiki}/.cvsignore
58 mv htdocs/.htaccess .
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir},/var/lib/%{name}}
63
64 cp -a htdocs includes $RPM_BUILD_ROOT%{_appdir}
65
66 sed -e '
67     s,CHECK_INTERVAL = .*,CHECK_INTERVAL = "-1",
68     s,RETURN_PATH = .*,RETURN_PATH = "your.bounce.email@localhost",
69     s,ABUSE_PATH = .*,ABUSE_PATH = "abuse@localhost",
70     s,ROOT_PASSWD = .*,ROOT_PASSWD = "XXX",
71     s,LOOKUP_DNS = .*,LOOKUP_DNS = off,
72     s,TEMP = .*,TEMP = "/var/lib/%{name}/",
73
74 ' core.conf-dist > $RPM_BUILD_ROOT%{_sysconfdir}/core.conf
75 echo -e '\n; vim: ft=dosini' >> $RPM_BUILD_ROOT%{_sysconfdir}/core.conf
76
77 # unfortunately cowiki works only as vhost root
78 cat <<EOF >> $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
79 <Directory /usr/share/cowiki/htdocs>
80     Allow from all
81 </Directory>
82
83 <VirtualHost *>
84         ServerName cowiki
85         DocumentRoot /usr/share/cowiki/htdocs
86
87 EOF
88 sed -ne '/BEGIN/,/END/p' .htaccess >> $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
89 cat <<EOF >> $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
90 </VirtualHost>
91 EOF
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %post
97 # apache1
98 if [ -d %{_apache1dir}/conf.d ]; then
99         ln -sf %{_sysconfdir}/apache.conf %{_apache1dir}/conf.d/99_%{name}.conf
100         if [ -f /var/lock/subsys/apache ]; then
101                 /etc/rc.d/init.d/apache restart 1>&2
102         fi
103 fi
104 # apache2
105 if [ -d %{_apache2dir}/httpd.conf ]; then
106         ln -sf %{_sysconfdir}/apache.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
107         if [ -f /var/lock/subsys/httpd ]; then
108                 /etc/rc.d/init.d/httpd restart 1>&2
109         fi
110 fi
111
112 if [ "$1" = 1 ]; then
113 %banner %{name} -e <<EOF
114 Install the database using the appropriate "misc/database/*.sql" schema.
115 You must setup authorization and root password in:
116 - %{_sysconfdir}/core.conf
117
118 EOF
119 fi
120
121 %preun
122 if [ "$1" = "0" ]; then
123         # apache1
124         if [ -f %{_apache1dir}/apache.conf ]; then
125                 rm -f %{_apache1dir}/conf.d/99_%{name}.conf
126                 if [ -f /var/lock/subsys/apache ]; then
127                         /etc/rc.d/init.d/apache restart 1>&2
128                 fi
129         fi
130         # apache2
131         if [ -d %{_apache2dir}/httpd.conf ]; then
132                 rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
133                 if [ -f /var/lock/subsys/httpd ]; then
134                         /etc/rc.d/init.d/httpd restart 1>&2
135                 fi
136         fi
137
138         # nuke cache
139         # FIXME could suffer too many arguments error
140         rm -f /var/lib/%{name}/*
141 fi
142
143 %files
144 %defattr(644,root,root,755)
145 %doc ChangeLog INSTALL* NEWS 
146 %doc README.IDIOM README.PLUGIN SKEL.PLUGIN
147 %doc misc/database
148 %dir %{_sysconfdir}
149 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
150 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/core.conf
151 %{_appdir}
152 %dir %attr(770,root,http) /var/lib/%{name}
This page took 0.092034 seconds and 3 git commands to generate.