aa7acdeb9feb26bc434bbd917af5eda0887cfb91
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-mbstring,php5-gettext,php5-session,ImageMagick
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 # Copy manpages
260 mv ./*.1.gz %{buildroot}/usr/share/man/man1/
261 gzip -c contrib/gosa.1 > contrib/gosa.1.gz
262 mv contrib/gosa.1.gz %{buildroot}/usr/share/man/man1/
264 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
265 rm -rf %{buildroot}/usr/share/gosa/contrib
267 ########################
269 %clean
270 rm -rf %{buildroot}
272 ########################
274 %post
275 /usr/sbin/update-gosa
277 ########################
279 %pre
280 # Cleanup compile dir on updates, always exit cleanly even on errors
281 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
283 ########################
285 %postun
286 # Remove temporary files, just to be sure
287 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa ; exit 0
288 [ -d /usr/share/gosa ] && rm -rf /usr/share/gosa ; exit 0
290 ########################
292 %files
293 %defattr(-,root,root)
294 %doc %attr(-,root,root) AUTHORS README README.safemode Changelog COPYING INSTALL FAQ CODING
295 %config %attr(-,root,root) /usr/share/doc/gosa/gosa.conf
296 #%attr(-,root,root) /contrib/openldap
297 %config %attr(-,root,root) /usr/share/doc/gosa/slapd.conf-example
298 %attr(755,root,root) /usr/sbin/update-gosa
299 %attr(755,root,root) /usr/share/man/man1/update-gosa.1.gz
300 %attr(644,root,root) /etc/gosa/shells
301 %attr(644,root,root) /etc/gosa/encodings
302 %attr(755,root,root) /usr/sbin/gosa-encrypt-passwords
303 %config(noreplace) %attr(0644,root,root) %{webconf}/gosa-apache.conf
304 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
305 %attr(0755, root,root) /usr/share/gosa
306 %attr(0755, root,root) /usr/share/gosa/html
307 %attr(0755, root,root) /usr/share/gosa/ihtml
308 %attr(0755, root,root) /usr/share/gosa/include
309 %attr(0755, root,root) /usr/share/gosa/locale
310 %attr(0755, root,root) /usr/share/gosa/plugins
311 %attr(0755, root,root) /usr/share/gosa/setup
312 %attr(0755, root,root) /usr/share/gosa/doc/core/guide.xml
313 %attr(0755, root,root) /var/cache/gosa
314 %attr(0700, root,root) /etc/gosa/gosa.secrets
316 ########################
318 %files dev
319 %defattr(-,root,root)
320 /usr/bin
321 %attr(755,root,root) /usr/share/man/man1/dh-make-gosa.1.gz
322 %attr(755,root,root) /usr/share/man/man1/update-locale.1.gz
323 %attr(755,root,root) /usr/share/man/man1/update-online-help.1.gz
324 %attr(755,root,root) /usr/share/man/man1/update-pdf-help.1.gz
326 ########################
328 %files desktop
329 %defattr(-,root,root)
330 /etc/gosa
331 /usr/bin
332 /usr/share/pixmaps
333 /usr/share/applications
334 %attr(755,root,root) /usr/share/man/man1/gosa.1.gz
336 ########################
338 %files schema
339 %defattr(-,root,root)
340 %doc COPYING AUTHORS README contrib/openldap
341 /etc/openldap/schema/gosa
343 ########################
345 %files help-en
346 %defattr(-,root,root)
347 /usr/share/gosa/doc/core/en
349 ########################
351 %files help-de
352 %defattr(-,root,root)
353 /usr/share/gosa/doc/core/de
355 ########################
357 %files help-fr
358 %defattr(-,root,root)
359 /usr/share/gosa/doc/core/fr
361 ########################
363 %files help-nl
364 %defattr(-,root,root)
365 /usr/share/gosa/doc/core/nl
367 ########################
369 %files help-es
370 %defattr(-,root,root)
371 /usr/share/gosa/doc/core/es
373 ########################
375 %changelog
376 * Fri Nov 17 2008 Stefan Japes <japes@GONICUS.de>
377 - First build of GOsa 2.6 as an RPM, should work on SuSE and RedHat