Code

Updated gosa.spec file
[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.9.99
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_php4,php4,php4-gd,php4-ldap,php4-mcrypt,php4-mysql,php4-imap,php4-iconv,php4-mbstring,php4-gettext,php4-session,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.1.22
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 %pre
177 # Cleanup compile dir on updates, always exit cleanly even on errors
178 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
180 %postun
181 # Remove temporary files, just to be sure
182 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
184 %files
185 %defattr(-,%{apacheuser},%{apachegroup})
186 %doc %attr(-,root,root) AUTHORS TODO README README.safemode Changelog COPYING INSTALL FAQ
187 %doc %attr(-,root,root) contrib/altlinux contrib/fix_config.sh contrib/gosa.conf contrib/mysql contrib/opensides
188 %doc %attr(-,root,root) contrib/patches contrib/scripts contrib/vacation_example.txt contrib/demo.ldif contrib/openldap
190 %config(noreplace) %attr(0600,%{apacheuser},%{apachegroup}) %{webconf}/gosa_include.conf
191 %config(noreplace) %attr(0700,%{apacheuser},%{apachegroup}) /etc/gosa
192 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
193 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/html
194 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/ihtml
195 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/include
196 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/locale
197 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/plugins
198 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/doc/guide.xml
200 %files schema
201 %defattr(-,root,root)
202 %doc COPYING AUTHORS README contrib/demo.ldif contrib/openldap
203 /etc/openldap/schema/gosa
205 %files help-en
206 %defattr(-,root,root)
207 /usr/share/gosa/doc/guide/user/en
209 %files help-de
210 %defattr(-,root,root)
211 /usr/share/gosa/doc/guide/user/de
213 %files help-fr
214 %defattr(-,root,root)
215 /usr/share/gosa/doc/guide/user/fr
217 %files help-nl
218 %defattr(-,root,root)
219 /usr/share/gosa/doc/guide/user/nl
221 %changelog
222 * Tue Mar 6 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.9
223 - New upstream
224 - fixed typo in updateprocess
226 * Mon Jan 15 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.8
227 - New upstream release with security fixes
229 * Wed Dec 20 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.7
230 - New upstream
231 - %pre and %postun always end successfully now, even on errors
233 * Fri Nov 17 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.6
234 - New upstream
235 - Cleanup temporary dir after package removal
236 - Cleanup temporary dir before update
238 * Thu Sep 28 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.4
239 - New upstream version
240 - Downgraded SuSE dependencies to php4
242 * Wed Jun 21 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.1
243 - New upstream version
245 * Tue May 30 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5
246 - Updated RedHat dependencies
247 - New upstream version
248 - Spelling errors fixed ;)
249 - Seperation of online manual
251 * Mon Dec 19 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4-2
252 - Updated SuSE dependencies to php5
254 * Mon Nov 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4
255 - New upstream version
256 - Removed %doc for postgresql and openexchange
258 * Wed Jun 01 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4beta1
259 - New upstream version
260 - Added gosa.conf to contrib dir
261 - Rearranged documentation stuff
262 - Updated dependencies
263 - compress some files
265 * Mon Feb 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.3
266 - Update version to 2.3 (upstream)
268 * Mon Dec 13 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2-2
269 - Optionally allow different sourcenames
271 * Mon Nov 22 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2
272 - Update to 2.2 (upstream)
273 - reintroduction of suse detection
274 - small fixes
275 - Corrected URL
276 - Synchronize schema package name with debian
278 * Mon May 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1.1
279 - update to 2.1.1
281 * Mon Apr 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
282 - update to 2.1
284 * Fri Apr 16 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
285 - minor fixes
286 - update to 2.1rc2
288 * Tue Jan 24 2004 Henning P. Schmiedehausen <hps@intermeta.de> 2.1-2t
289 - bumped to 2.1beta2
290 - first INTERMETA internal build
292 * Mon Oct 20 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
293 - Update to new upstream release (2.0rc1)
295 * Fri Oct 17 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
296 - First build of GOsa as an RPM, should work on SuSE and RedHat