Code

32d9a08af4060ee56d1c7e5d0e8d42d3a6d98b5b
[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.1
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         cat <<-EOF >> %{webconf}/gosa-apache.conf
262         <Directory /usr/share/gosa/html>
263             Options None
264             AllowOverride None
265             Order deny,allow
266             Allow from all
267         </Directory>
268         EOF
269 %endif
271 # Copy manpages
272 mv ./*.1.gz                     %{buildroot}/usr/share/man/man1/
273 gzip -c contrib/gosa.1 > contrib/gosa.1.gz
274 mv contrib/gosa.1.gz            %{buildroot}/usr/share/man/man1/
276 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
277 rm -rf %{buildroot}/usr/share/gosa/contrib
279 ########################
281 %clean
282 rm -rf %{buildroot}
284 ########################
286 %post
287 /usr/sbin/update-gosa
289 ########################
291 %pre
292 # Cleanup compile dir on updates, always exit cleanly even on errors
293 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
295 ########################
297 %postun
298 # Remove temporary files, just to be sure
299 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa ; exit 0
300 [ -d /usr/share/gosa ] && rm -rf /usr/share/gosa ; exit 0
302 ########################
304 %files
305 %defattr(-,root,root)
306 %doc %attr(-,root,root) AUTHORS README README.safemode Changelog COPYING INSTALL FAQ CODING
307 %config %attr(-,root,root) /usr/share/doc/gosa/gosa.conf
308 #%attr(-,root,root) /contrib/openldap
309 %config %attr(-,root,root) /usr/share/doc/gosa/slapd.conf-example
310 %attr(755,root,root) /usr/sbin/update-gosa
311 %attr(755,root,root) /usr/share/man/man1/update-gosa.1.gz
312 %attr(644,root,root) /etc/gosa/shells
313 %attr(644,root,root) /etc/gosa/encodings
314 %attr(755,root,root) /usr/sbin/gosa-encrypt-passwords
315 %config(noreplace) %attr(0644,root,root) %{webconf}/gosa-apache.conf
316 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
317 %attr(0755, root,root) /usr/share/gosa
318 %attr(0755, root,root) /usr/share/gosa/html
319 %attr(0755, root,root) /usr/share/gosa/ihtml
320 %attr(0755, root,root) /usr/share/gosa/include
321 %attr(0755, root,root) /usr/share/gosa/locale
322 %attr(0755, root,root) /usr/share/gosa/plugins
323 %attr(0755, root,root) /usr/share/gosa/setup
324 %attr(0755, root,root) /usr/share/gosa/doc/core/guide.xml
325 %attr(0755, root,root) /var/cache/gosa
326 %attr(0700, root,root) /etc/gosa/gosa.secrets
328 ########################
330 %files dev
331 %defattr(-,root,root)
332 /usr/bin
333 %attr(755,root,root) /usr/share/man/man1/dh-make-gosa.1.gz
334 %attr(755,root,root) /usr/share/man/man1/update-locale.1.gz
335 %attr(755,root,root) /usr/share/man/man1/update-online-help.1.gz
336 %attr(755,root,root) /usr/share/man/man1/update-pdf-help.1.gz
338 ########################
340 %files desktop
341 %defattr(-,root,root)
342 /etc/gosa
343 /usr/bin
344 /usr/share/pixmaps
345 /usr/share/applications
346 %attr(755,root,root) /usr/share/man/man1/gosa.1.gz
348 ########################
350 %files schema
351 %defattr(-,root,root)
352 %doc COPYING AUTHORS README contrib/openldap
353 /etc/openldap/schema/gosa
355 ########################
357 %files help-en
358 %defattr(-,root,root)
359 /usr/share/gosa/doc/core/en
361 ########################
363 %files help-de
364 %defattr(-,root,root)
365 /usr/share/gosa/doc/core/de
367 ########################
369 %files help-fr
370 %defattr(-,root,root)
371 /usr/share/gosa/doc/core/fr
373 ########################
375 %files help-nl
376 %defattr(-,root,root)
377 /usr/share/gosa/doc/core/nl
379 ########################
381 %files help-es
382 %defattr(-,root,root)
383 /usr/share/gosa/doc/core/es
385 ########################
387 %changelog
388 * Fri Nov 17 2008 Stefan Japes <japes@GONICUS.de>
389 - First build of GOsa 2.6 as an RPM, should work on SuSE and RedHat