Code

Updated gosa.spec file, some more cleanups for current gosa version
[gosa.git] / contrib / 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.5.1
15 Release:                1
16 License:                GPL
17 Source:                 ftp://oss.GONICUS.de/pub/gosa/%{sourcename}.tar.bz2
18 URL:                    http://oss.GONICUS.de/project/?group_id=6
19 Group:                  System/Administration
20 Vendor:                 GONICUS GmbH
21 Packager:               Lars Scheiter <lars.scheiter@GONICUS.de>
22 Buildarch:              noarch
23 %if %{suse}
24 Requires:               apache2,apache2-mod_php5,php5,php5-gd,php5-ldap,php5-mcrypt,php5-mysql,php5-imap,php5-iconv,php5-mbstring,php5-gettext,php5-posix,ImageMagick,perl-Crypt-SmbHash
25 %else
26 Requires:               httpd,php,php-ldap,php-imap,php-snmp,php-mysql,php-mbstring,perl-Crypt-SmbHash >= 0.02,ImageMagick
27 %endif
28 BuildRoot:              %{_tmppath}/%{name}-%{version}-root
29 BuildArch:              noarch
31 %define confdir         /etc/%{name}
33 %if %{suse}
34         %{echo:Building SuSE rpm}
35         %define apacheuser wwwrun
36         %define apachegroup root
37         %define webconf /etc/apache2/conf.d/
38         %define docdir /usr/share/doc/packages/gosa
39 %else
40         %{echo:Building other rpm}
41         %define apacheuser apache 
42         %define apachegroup apache 
43         %define webconf /etc/httpd/conf.d/      
44         %define docdir /usr/share/doc/gosa-%{version}
45 %endif
47 %description
48 GOsa is a combination of system-administrator and end-user web
49 interface, designed to handle LDAP based setups.
50 Provided is access to posix, shadow, samba, proxy, fax, and kerberos
51 accounts. It is able to manage the postfix/cyrus server combination
52 and can write user adapted sieve scripts.
54 %package schema
55 Group:                  System/Administration
56 Summary:                Schema Definitions for the GOSA package
57 %if %{suse}
58 Requires:               openldap2 >= 2.2.6
59 %else
60 Requires:               openldap-servers >= 2.2.0
61 %endif
62 Obsoletes:              gosa-ldap
64 %description schema
65 Contains the Schema definition files for the GOSA admin package.
67 %package help-en
68 Group:                  System/Administration
69 Summary:                English online manual for GOSA package
70 Requires:               gosa >= %{version}
72 %description help-en
73 English online manual page for GOSA package
75 %package help-de
76 Group:                  System/Administration
77 Summary:                German localized online manual for GOSA package
78 Requires:               gosa >= %{version}
80 %description help-de
81 German localized online manual page for GOSA package
83 %package help-fr
84 Group:                  System/Administration
85 Summary:                French localized online manual for GOSA package
86 Requires:               gosa >= %{version}
88 %description help-fr
89 French localized online manual page for GOSA package
91 %package help-nl
92 Group:                  System/Administration
93 Summary:                Dutch localized online manual for GOSA package
94 Requires:               gosa >= %{version}
96 %description help-nl
97 Dutch localized online manual page for GOSA package
99 %prep
100 %setup -q -n %{sourcename}
101 find . -depth -name CVS -type d | xargs rm -rf
103 %build
106 %install
107 # Create buildroot
108 mkdir -p %{buildroot}/usr/share/gosa
110 # Copy
111 DIRS="doc ihtml plugins html include locale"
112 for i in $DIRS; do \
113   cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
114 done
116 # Create files for temporary stuff
117 for i in compile config cache; do \
118   mkdir -p %{buildroot}/var/spool/gosa/$i ; \
119 done
121 # Cleanup manual dirs
122 for i in admin devel; do \
123   rm -rf %{buildroot}/usr/share/gosa/doc/guide/$i ; \
124 done
126 # Remove (some) unneeded files
127 for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
128  rm -rf %{buildroot}/usr/share/gosa/$i ; \
129 done
131 # Cleanup lyx warnings
132 find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
135 # Cleanup guide
136 rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
139 # Copy default config
140 mkdir -p %{buildroot}%{confdir}
141 mkdir -p %{buildroot}%{webconf}
143 cat > %{buildroot}%{webconf}/gosa_include.conf <<EOF
144 # Just to be sure
145 <Directory "/usr/share/gosa/html">
146         Options None
147         AllowOverride None
148         Order allow,deny
149         Allow from all
150 </Directory>
151 # Set alias to gosa
152 Alias /gosa /usr/share/gosa/html
153 EOF
155 mkdir -p %{buildroot}/etc/openldap/schema/gosa
156 mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
157 sed 's§"CONFIG_TEMPLATE_DIR", "../contrib/"§"CONFIG_TEMPLATE_DIR", "%{docdir}/"§g' %{buildroot}/usr/share/gosa/include/functions.inc > %{buildroot}/usr/share/gosa/include/functions.inc.new
158 mv -f %{buildroot}/usr/share/gosa/include/functions.inc.new %{buildroot}/usr/share/gosa/include/functions.inc
160 mv -f doc manual
161 mkdir -p %{buildroot}/etc/gosa/vacation
162 mv -f %{buildroot}/usr/share/gosa/plugins/personal/mail/sieve-*.txt %{buildroot}/etc/gosa
163 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
164 rm -rf %{buildroot}/usr/share/gosa/contrib
165 #rm -rf %{buildroot}/usr/share/gosa/doc
166 #rmdir contrib/openldap
167 bzip2 -9 contrib/opensides/goSamba.pl
169 %clean
170 rm -rf %{buildroot}
172 %post
173 # Add shells file to /etc/gosa 
174 /bin/cp /etc/shells /etc/gosa
176 %files
177 %defattr(-,%{apacheuser},%{apachegroup})
178 %doc %attr(-,root,root) AUTHORS TODO README README.safemode Changelog COPYING INSTALL FAQ
179 %doc %attr(-,root,root) contrib/altlinux contrib/fix_config.sh contrib/gosa.conf contrib/mysql contrib/opensides
180 %doc %attr(-,root,root) contrib/patches contrib/scripts contrib/vacation_example.txt contrib/demo.ldif contrib/openldap
182 %config(noreplace) %attr(0600,%{apacheuser},%{apachegroup}) %{webconf}/gosa_include.conf
183 %config(noreplace) %attr(0700,%{apacheuser},%{apachegroup}) /etc/gosa
184 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
185 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/html
186 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/ihtml
187 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/include
188 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/locale
189 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/plugins
190 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/doc/guide.xml
192 %files schema
193 %defattr(-,root,root)
194 %doc COPYING AUTHORS README contrib/demo.ldif contrib/openldap
195 /etc/openldap/schema/gosa
197 %files help-en
198 %defattr(-,root,root)
199 /usr/share/gosa/doc/guide/user/en
201 %files help-de
202 %defattr(-,root,root)
203 /usr/share/gosa/doc/guide/user/de
205 %files help-fr
206 %defattr(-,root,root)
207 /usr/share/gosa/doc/guide/user/fr
209 %files help-nl
210 %defattr(-,root,root)
211 /usr/share/gosa/doc/guide/user/nl
213 %changelog
214 * Wed Jun 21 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.1
215 - New upstream version
217 * Tue May 30 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5
218 - Updated RedHat dependencies
219 - New upstream version
220 - Spelling errors fixed ;)
221 - Seperation of online manual
223 * Mon Dec 19 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4-2
224 - Updated SuSE dependencies to php5
226 * Mon Nov 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4
227 - New upstream version
228 - Removed %doc for postgresql and openexchange
230 * Wed Jun 01 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4beta1
231 - New upstream version
232 - Added gosa.conf to contrib dir
233 - Rearranged documentation stuff
234 - Updated dependencies
235 - compress some files
237 * Mon Feb 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.3
238 - Update version to 2.3 (upstream)
240 * Mon Dec 13 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2-2
241 - Optionally allow different sourcenames
243 * Mon Nov 22 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2
244 - Update to 2.2 (upstream)
245 - reintroduction of suse detection
246 - small fixes
247 - Corrected URL
248 - Synchronize schema package name with debian
250 * Mon May 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1.1
251 - update to 2.1.1
253 * Mon Apr 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
254 - update to 2.1
256 * Fri Apr 16 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
257 - minor fixes
258 - update to 2.1rc2
260 * Tue Jan 24 2004 Henning P. Schmiedehausen <hps@intermeta.de> 2.1-2t
261 - bumped to 2.1beta2
262 - first INTERMETA internal build
264 * Mon Oct 20 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
265 - Update to new upstream release (2.0rc1)
267 * Fri Oct 17 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
268 - First build of GOsa as an RPM, should work on SuSE and RedHat