Code

Updated locking for users self editing.
[gosa.git] / gosa-core / redhat / gosa_2_6.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.0
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,php4-imap,php5-iconv,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
183 # Copy
184 DIRS="doc ihtml plugins html include locale setup"
185 echo `pwd`
186 for i in $DIRS; do \
187   cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
188 done
190 # Copy files for gosa
191 mkdir -p %{buildroot}/usr/sbin
192 mkdir -p %{buildroot}/etc/gosa
193 mkdir -p %{buildroot}/usr/share/doc/gosa
194 mkdir -p %{buildroot}/etc/httpd/conf.d
196 mv contrib/gosa.conf            %{buildroot}/usr/share/doc/gosa
197 mv update-gosa                  %{buildroot}/usr/sbin
198 mv bin/gosa-encrypt-passwords   %{buildroot}/usr/sbin
199 mv debian/gosa-apache.conf      %{buildroot}/etc/httpd/conf.d
200 mv contrib/shells               %{buildroot}/etc/gosa
201 mv contrib/encodings            %{buildroot}/etc/gosa
202 mv contrib/openldap/slapd.conf  %{buildroot}/usr/share/doc/gosa/slapd.conf-example
203 mv -f doc manual
205 # Cleanup manual dirs
206 for i in admin ; do \
207   rm -rf %{buildroot}/usr/share/gosa/doc/$i ; \
208 done
210 # Remove (some) unneeded files
211 for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
212  rm -rf %{buildroot}/usr/share/gosa/$i ; \
213 done
215 # Cleanup lyx warnings
216 find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
218 # Cleanup guide
219 rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
221 # Copy default config
222 mkdir -p %{buildroot}%{confdir}
223 mkdir -p %{buildroot}%{webconf}
225 # Copy file for gosa-schema
226 mkdir -p %{buildroot}/etc/openldap/schema/gosa
228 mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
230 # Copy files for gosa-dev
231 mkdir -p %{buildroot}/usr/bin
232 mv update-locale %{buildroot}/usr/bin
233 mv update-online-help %{buildroot}/usr/bin
234 mv update-pdf-help %{buildroot}/usr/bin
235 mv dh-make-gosa %{buildroot}/usr/bin
237 # Copy files for desktop
238 mkdir -p %{buildroot}/etc/gosa
239 mkdir -p %{buildroot}/usr/bin
240 mkdir -p %{buildroot}/usr/sbin
241 mkdir -p %{buildroot}/usr/share/pixmaps
242 mkdir -p %{buildroot}/usr/share/applications
243 mkdir -p %{buildroot}/usr/share/man/man1/
245 mv contrib/desktoprc            %{buildroot}/etc/gosa
246 mv contrib/gosa                 %{buildroot}/usr/bin
247 mv debian/gosa.xpm              %{buildroot}/usr/share/pixmaps
248 mv debian/gosa-16.xpm           %{buildroot}/usr/share/pixmaps
249 mv debian/gosa-desktop.desktop  %{buildroot}/usr/share/applications
251 # Gzip manpages from source
252 for x in update-gosa.1 dh-make-gosa.1 update-locale.1 update-online-help.1 update-pdf-help.1
253 do
254         gzip $x
255 done
257 # Copy manpages
258 mv ./*.1.gz                     %{buildroot}/usr/share/man/man1/
259 gzip -c contrib/gosa.1 > contrib/gosa.1.gz
260 mv contrib/gosa.1.gz            %{buildroot}/usr/share/man/man1/
262 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
263 rm -rf %{buildroot}/usr/share/gosa/contrib
265 ########################
267 %clean
268 rm -rf %{buildroot}
270 ########################
272 %post
273 /usr/sbin/update-gosa
275 ########################
277 %pre
278 # Cleanup compile dir on updates, always exit cleanly even on errors
279 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
281 ########################
283 %postun
284 # Remove temporary files, just to be sure
285 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa ; exit 0
286 [ -d /usr/share/gosa ] && rm -rf /usr/share/gosa ; exit 0
288 ########################
290 %files
291 %defattr(-,root,root)
292 %doc %attr(-,root,root) AUTHORS README README.safemode Changelog COPYING INSTALL FAQ CODING
293 %config %attr(-,root,root) /usr/share/doc/gosa/gosa.conf
294 #%attr(-,root,root) /contrib/openldap
295 %config %attr(-,root,root) /usr/share/doc/gosa/slapd.conf-example
296 %attr(755,root,root) /usr/sbin/update-gosa
297 %attr(755,root,root) /usr/share/man/man1/update-gosa.1.gz
298 %attr(644,root,root) /etc/gosa/shells
299 %attr(644,root,root) /etc/gosa/encodings
300 %attr(755,root,root) /usr/sbin/gosa-encrypt-passwords
301 %config(noreplace) %attr(0644,root,root) %{webconf}/gosa-apache.conf
302 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
303 %attr(0755, root,root) /usr/share/gosa
304 %attr(0755, root,root) /usr/share/gosa/html
305 %attr(0755, root,root) /usr/share/gosa/ihtml
306 %attr(0755, root,root) /usr/share/gosa/include
307 %attr(0755, root,root) /usr/share/gosa/locale
308 %attr(0755, root,root) /usr/share/gosa/plugins
309 %attr(0755, root,root) /usr/share/gosa/setup
310 %attr(0755, root,root) /usr/share/gosa/doc/core/guide.xml
312 ########################
314 %files dev
315 %defattr(-,root,root)
316 /usr/bin
317 %attr(755,root,root) /usr/share/man/man1/dh-make-gosa.1.gz
318 %attr(755,root,root) /usr/share/man/man1/update-locale.1.gz
319 %attr(755,root,root) /usr/share/man/man1/update-online-help.1.gz
320 %attr(755,root,root) /usr/share/man/man1/update-pdf-help.1.gz
322 ########################
324 %files desktop
325 %defattr(-,root,root)
326 /etc/gosa
327 /usr/bin
328 /usr/share/pixmaps
329 /usr/share/applications
330 %attr(755,root,root) /usr/share/man/man1/gosa.1.gz
332 ########################
334 %files schema
335 %defattr(-,root,root)
336 %doc COPYING AUTHORS README contrib/openldap
337 /etc/openldap/schema/gosa
339 ########################
341 %files help-en
342 %defattr(-,root,root)
343 /usr/share/gosa/doc/core/en
345 ########################
347 %files help-de
348 %defattr(-,root,root)
349 /usr/share/gosa/doc/core/de
351 ########################
353 %files help-fr
354 %defattr(-,root,root)
355 /usr/share/gosa/doc/core/fr
357 ########################
359 %files help-nl
360 %defattr(-,root,root)
361 /usr/share/gosa/doc/core/nl
363 ########################
365 %files help-es
366 %defattr(-,root,root)
367 /usr/share/gosa/doc/core/es
369 ########################
371 %changelog
372 * Fri Nov 17 2008 Stefan Japes <japes@GONICUS.de>
373 - First build of GOsa 2.6 as an RPM, should work on SuSE and RedHat