Code

Updated specfiles
[gosa.git] / gosa-core / redhat / gosa.spec
1 # Some sort of "detection" of suse
2 %{?suse_version:%define suse 1}
3 %{!?suse_version:%define suse 0}
5 # Define Packagename, e.g.:
6 # rpmbuild --rebuild --define 'sourcename gosa' gosa.srpm
7 %{!?sourcename:%define sourcename %{name}-%{version}}
9 #
10 # Distribution
11 #
12 Summary:                Web Based LDAP Administration Program 
13 Name:                   gosa
14 Version:                2.6.9
15 Release:                1
16 License:                GPL
17 Source:                 ftp://oss.GONICUS.de/pub/gosa/%{sourcename}.tar.bz2
18 URL:                    https://oss.GONICUS.de/labs/gosa/
19 Group:                  System/Administration
20 Vendor:                 GONICUS GmbH
21 Packager:               Stefan Japes <japes@GONICUS.de>
22 Buildarch:              noarch
23 Patch:                  01_fix_template_location.patch
24 Patch1:                 02_fix_class_mapping.patch
25 Patch2:                 03_fix_locale_location.patch
26 Patch3:                 04_fix_online_help_location.patch
27 %if %{suse}
28 Requires:               apache2,apache2-mod_php5,php5,php5-gd,php5-ldap,php5-mcrypt,php5-mysql,php5-imap,php5-iconv,php5-hash,php5-posix,php5-mbstring,php5-gettext,ImageMagick,gettext-tools
29 %else
30 Requires:               httpd,php,php-ldap,php-imap,php-snmp,php-mysql,php-mbstring,ImageMagick,php-mhash,perl-Crypt-SmbHash
31 %endif
32 BuildRoot:              %{_tmppath}/%{name}-%{version}-root
33 BuildArch:              noarch
35 ########################
37 %define confdir         /etc/%{name}
39 %if %{suse}
40         %{echo:Building SuSE rpm}
41         %define apacheuser wwwrun
42         %define apachegroup root
43         %define webconf /etc/apache2/conf.d/
44         %define docdir /usr/share/doc/packages/gosa
45 %else
46         %{echo:Building other rpm}
47         %define apacheuser apache 
48         %define apachegroup apache 
49         %define webconf /etc/httpd/conf.d/      
50         %define docdir /usr/share/doc/gosa-%{version}
51 %endif
53 %description
54 GOsa is a combination of system-administrator and end-user web
55 interface, designed to handle LDAP based setups.
56 Provided is access to posix, shadow, samba, proxy, fax, and kerberos
57 accounts. It is able to manage the postfix/cyrus server combination
58 and can write user adapted sieve scripts.
60 ########################
62 %package dev
63 Group:                  System/Administration
64 Summary:                GOsa development utiles
65 %if %{suse}
66 Requires:               lyx
67 %else
68 Requires:               php-cli,latex2html,lyx
69 %endif
70 Obsoletes:              gosa-ldap
72 %description dev
73 This package contains a couple of tools to generate
74 online help, extract localisations and aid developing.
76 ########################
78 %package desktop
79 Group:                  System/Administration
80 Summary:                Desktop integration for GOsa
81 %if %{suse}
82 Requires:               firefox
83 %else
84 Requires:               firefox
85 %endif
86 Obsoletes:              gosa-ldap
88 %description desktop
89 This package includes a menu definition for your
90 desktop environment.
92 ########################
94 %package schema
95 Group:                  System/Administration
96 Summary:                Schema Definitions for the GOSA package
97 %if %{suse}
98 Requires:               gosa >= %{version}
99 %else
100 Requires:               gosa >= %{version}
101 %endif
102 Obsoletes:              gosa-ldap
104 %description schema
105 Contains the Schema definition files for the GOSA admin package.
107 ########################
109 %package help-en
110 Group:                  System/Administration
111 Summary:                English online manual for GOSA package
112 Requires:               gosa >= %{version}
114 %description help-en
115 English online manual page for GOSA package
117 ########################
119 %package help-de
120 Group:                  System/Administration
121 Summary:                German localized online manual for GOSA package
122 Requires:               gosa >= %{version}
124 %description help-de
125 German localized online manual page for GOSA package
127 ########################
129 %package help-fr
130 Group:                  System/Administration
131 Summary:                French localized online manual for GOSA package
132 Requires:               gosa >= %{version}
134 %description help-fr
135 French localized online manual page for GOSA package
137 ########################
139 %package help-nl
140 Group:                  System/Administration
141 Summary:                Dutch localized online manual for GOSA package
142 Requires:               gosa >= %{version}
144 %description help-nl
145 Dutch localized online manual page for GOSA package
147 ########################
149 %package help-es
150 Group:                  System/Administration
151 Summary:                Spain localized online manual for GOSA package
152 Requires:               gosa >= %{version}
154 %description help-es
155 Spain localized online manual page for GOSA package
157 ########################
159 %prep
160 %setup -q -n %{sourcename}
161 %patch -p1
162 %patch1 -p1
163 %patch2 -p1
164 %patch3 -p1
166 find . -depth -name CVS -type d | xargs rm -rf
168 ########################
170 %build
172 ########################
174 %install
175 # Create buildroot
176 mkdir -p %{buildroot}/usr/share/gosa
178 # Create files for temporary stuff
179 for i in compile config cache; do \
180   mkdir -p %{buildroot}/var/spool/gosa/$i ; \
181 done
182 mkdir -p %{buildroot}/var/cache/gosa
184 # Copy
185 DIRS="doc ihtml plugins html include locale setup"
186 echo `pwd`
187 for i in $DIRS; do \
188   cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
189 done
191 # Copy files for gosa
192 mkdir -p %{buildroot}/usr/sbin
193 mkdir -p %{buildroot}/etc/gosa
194 mkdir -p %{buildroot}/usr/share/doc/gosa
195 mkdir -p %{buildroot}%{webconf}
197 touch %{buildroot}/etc/gosa/gosa.secrets
198 mv contrib/gosa.conf            %{buildroot}/usr/share/doc/gosa
199 mv update-gosa                  %{buildroot}/usr/sbin
200 mv bin/gosa-encrypt-passwords   %{buildroot}/usr/sbin
201 mv debian/gosa-apache.conf      %{buildroot}%{webconf}
202 mv contrib/shells               %{buildroot}/etc/gosa
203 mv contrib/encodings            %{buildroot}/etc/gosa
204 mv contrib/openldap/slapd.conf  %{buildroot}/usr/share/doc/gosa/slapd.conf-example
205 mv -f doc manual
207 # Cleanup manual dirs
208 for i in admin ; do \
209   rm -rf %{buildroot}/usr/share/gosa/doc/$i ; \
210 done
212 # Remove (some) unneeded files
213 for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
214  rm -rf %{buildroot}/usr/share/gosa/$i ; \
215 done
217 # Cleanup lyx warnings
218 find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
220 # Cleanup guide
221 rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
223 # Copy default config
224 mkdir -p %{buildroot}%{confdir}
225 mkdir -p %{buildroot}%{webconf}
227 # Copy file for gosa-schema
228 mkdir -p %{buildroot}/etc/openldap/schema/gosa
230 mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
232 # Copy files for gosa-dev
233 mkdir -p %{buildroot}/usr/bin
234 mv update-locale %{buildroot}/usr/bin
235 mv update-online-help %{buildroot}/usr/bin
236 mv update-pdf-help %{buildroot}/usr/bin
237 mv dh-make-gosa %{buildroot}/usr/bin
239 # Copy files for desktop
240 mkdir -p %{buildroot}/etc/gosa
241 mkdir -p %{buildroot}/usr/bin
242 mkdir -p %{buildroot}/usr/sbin
243 mkdir -p %{buildroot}/usr/share/pixmaps
244 mkdir -p %{buildroot}/usr/share/applications
245 mkdir -p %{buildroot}/usr/share/man/man1/
247 mv contrib/desktoprc            %{buildroot}/etc/gosa
248 mv contrib/gosa                 %{buildroot}/usr/bin
249 mv debian/gosa.xpm              %{buildroot}/usr/share/pixmaps
250 mv debian/gosa-16.xpm           %{buildroot}/usr/share/pixmaps
251 mv debian/gosa-desktop.desktop  %{buildroot}/usr/share/applications
253 # Gzip manpages from source
254 for x in update-gosa.1 dh-make-gosa.1 update-locale.1 update-online-help.1 update-pdf-help.1
255 do
256         gzip $x
257 done
259 %if %{suse}
260         sed -i 's#/usr/bin/php#/usr/bin/php5#' %{buildroot}/usr/sbin/update-gosa
261         sed -i 's#/usr/bin/php#/usr/bin/php5#' %{buildroot}/usr/sbin/gosa-encrypt-passwords
262         cat <<-EOF >> %{buildroot}%{webconf}/gosa-apache.conf
263         
264         <Directory /usr/share/gosa/html>
265             Options None
266             AllowOverride None
267             Order deny,allow
268             Allow from all
269         </Directory>
270         EOF
271 %endif
273 # Copy manpages
274 mv ./*.1.gz                     %{buildroot}/usr/share/man/man1/
275 gzip -c contrib/gosa.1 > contrib/gosa.1.gz
276 mv contrib/gosa.1.gz            %{buildroot}/usr/share/man/man1/
278 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
279 rm -rf %{buildroot}/usr/share/gosa/contrib
281 ########################
283 %clean
284 rm -rf %{buildroot}
286 ########################
288 %post
289 /usr/sbin/update-gosa
291 ########################
293 %pre
294 # Cleanup compile dir on updates, always exit cleanly even on errors
295 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
297 ########################
299 %postun
300 # Remove temporary files, just to be sure
301 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa ; exit 0
302 [ -d /usr/share/gosa ] && rm -rf /usr/share/gosa ; exit 0
304 ########################
306 %files
307 %defattr(-,root,root)
308 %doc %attr(-,root,root) AUTHORS README README.safemode Changelog COPYING INSTALL FAQ CODING
309 %config %attr(-,root,root) /usr/share/doc/gosa/gosa.conf
310 #%attr(-,root,root) /contrib/openldap
311 %config %attr(-,root,root) /usr/share/doc/gosa/slapd.conf-example
312 %attr(755,root,root) /usr/sbin/update-gosa
313 %attr(755,root,root) /usr/share/man/man1/update-gosa.1.gz
314 %attr(644,root,root) /etc/gosa/shells
315 %attr(644,root,root) /etc/gosa/encodings
316 %attr(755,root,root) /usr/sbin/gosa-encrypt-passwords
317 %config(noreplace) %attr(0644,root,root) %{webconf}/gosa-apache.conf
318 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
319 %attr(0755, root,root) /usr/share/gosa
320 #%attr(0755, root,root) /usr/share/gosa/html
321 #%attr(0755, root,root) /usr/share/gosa/ihtml
322 #%attr(0755, root,root) /usr/share/gosa/include
323 #%attr(0755, root,root) /usr/share/gosa/locale
324 #%attr(0755, root,root) /usr/share/gosa/plugins
325 #%attr(0755, root,root) /usr/share/gosa/setup
326 %attr(0755, root,root) /usr/share/gosa/doc/core/guide.xml
327 %attr(0755, root,root) /var/cache/gosa
328 %attr(0700, root,root) /etc/gosa/gosa.secrets
330 ########################
332 %files dev
333 %defattr(-,root,root)
334 /usr/bin
335 %attr(755,root,root) /usr/share/man/man1/dh-make-gosa.1.gz
336 %attr(755,root,root) /usr/share/man/man1/update-locale.1.gz
337 %attr(755,root,root) /usr/share/man/man1/update-online-help.1.gz
338 %attr(755,root,root) /usr/share/man/man1/update-pdf-help.1.gz
340 ########################
342 %files desktop
343 %defattr(-,root,root)
344 /etc/gosa
345 /usr/bin
346 /usr/share/pixmaps
347 /usr/share/applications
348 %attr(755,root,root) /usr/share/man/man1/gosa.1.gz
350 ########################
352 %files schema
353 %defattr(-,root,root)
354 %doc COPYING AUTHORS README contrib/openldap
355 /etc/openldap/schema/gosa
357 ########################
359 %files help-en
360 %defattr(-,root,root)
361 /usr/share/gosa/doc/core/en
363 ########################
365 %files help-de
366 %defattr(-,root,root)
367 /usr/share/gosa/doc/core/de
369 ########################
371 %files help-fr
372 %defattr(-,root,root)
373 /usr/share/gosa/doc/core/fr
375 ########################
377 %files help-nl
378 %defattr(-,root,root)
379 /usr/share/gosa/doc/core/nl
381 ########################
383 %files help-es
384 %defattr(-,root,root)
385 /usr/share/gosa/doc/core/es
387 ########################
389 %changelog
390 * Fri Nov 17 2008 Stefan Japes <japes@GONICUS.de>
391 - First build of GOsa 2.6 as an RPM, should work on SuSE and RedHat