Code

Created trunk inside of 2.6-lhm
[gosa.git] / trunk / gosa-core / 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.99cvs
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-session,ImageMagick
25 %else
26 Requires:               httpd,php,php-ldap,php-imap,php-snmp,php-mysql,php-mbstring,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 mkntpasswd
68 Group:                  System/Administration
69 Summary:                Schema Definitions for the GOSA package
70 %if %{suse}
71 Requires:               perl-Crypt-SmbHash
72 %else
73 Requires:               perl-Crypt-SmbHash >= 0.02
74 %endif
76 %description mkntpasswd
77 Wrapper Script around perl to create Samba Hashes on the fly, added for completeness only.
78 If in doubt use sambas "native" mkntpwd tool to generate hashes for GOsa.
80 %package help-en
81 Group:                  System/Administration
82 Summary:                English online manual for GOSA package
83 Requires:               gosa >= %{version}
85 %description help-en
86 English online manual page for GOSA package
88 %package help-de
89 Group:                  System/Administration
90 Summary:                German localized online manual for GOSA package
91 Requires:               gosa >= %{version}
93 %description help-de
94 German localized online manual page for GOSA package
96 %package help-fr
97 Group:                  System/Administration
98 Summary:                French localized online manual for GOSA package
99 Requires:               gosa >= %{version}
101 %description help-fr
102 French localized online manual page for GOSA package
104 %package help-nl
105 Group:                  System/Administration
106 Summary:                Dutch localized online manual for GOSA package
107 Requires:               gosa >= %{version}
109 %description help-nl
110 Dutch localized online manual page for GOSA package
112 %prep
113 %setup -q -n %{sourcename}
114 find . -depth -name CVS -type d | xargs rm -rf
116 %build
119 %install
120 # Create buildroot
121 mkdir -p %{buildroot}/usr/share/gosa
123 # Copy
124 DIRS="doc ihtml plugins html include locale setup"
125 for i in $DIRS; do \
126   cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
127 done
128 mkdir %{buildroot}/usr/bin
129 cp bin/mkntpasswd %{buildroot}/usr/bin/
131 # Create files for temporary stuff
132 for i in compile config cache; do \
133   mkdir -p %{buildroot}/var/spool/gosa/$i ; \
134 done
136 # Cleanup manual dirs
137 for i in admin devel; do \
138   rm -rf %{buildroot}/usr/share/gosa/doc/guide/$i ; \
139 done
141 # Remove (some) unneeded files
142 for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
143  rm -rf %{buildroot}/usr/share/gosa/$i ; \
144 done
146 # Cleanup lyx warnings
147 find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
150 # Cleanup guide
151 rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
154 # Copy default config
155 mkdir -p %{buildroot}%{confdir}
156 mkdir -p %{buildroot}%{webconf}
158 cat > %{buildroot}%{webconf}/gosa_include.conf <<EOF
159 # Just to be sure
160 <Directory "/usr/share/gosa/html">
161         Options None
162         AllowOverride None
163         Order allow,deny
164         Allow from all
165 </Directory>
166 # Set alias to gosa
167 Alias /gosa /usr/share/gosa/html
168 EOF
170 mkdir -p %{buildroot}/etc/openldap/schema/gosa
171 mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
172 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
173 mv -f %{buildroot}/usr/share/gosa/include/functions.inc.new %{buildroot}/usr/share/gosa/include/functions.inc
175 mv -f doc manual
176 mkdir -p %{buildroot}/etc/gosa/vacation
177 mv -f %{buildroot}/usr/share/gosa/plugins/personal/mail/sieve-*.txt %{buildroot}/etc/gosa
178 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
179 rm -rf %{buildroot}/usr/share/gosa/contrib
180 #rm -rf %{buildroot}/usr/share/gosa/doc
181 #rmdir contrib/openldap
182 bzip2 -9 contrib/opensides/goSamba.pl
184 %clean
185 rm -rf %{buildroot}
187 %post
188 # Add shells file to /etc/gosa 
189 /bin/cp /etc/shells /etc/gosa
191 %pre
192 # Cleanup compile dir on updates, always exit cleanly even on errors
193 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
195 %postun
196 # Remove temporary files, just to be sure
197 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
199 %files
200 %defattr(-,%{apacheuser},%{apachegroup})
201 %doc %attr(-,root,root) AUTHORS TODO README README.safemode Changelog COPYING INSTALL FAQ
202 %doc %attr(-,root,root) contrib/altlinux contrib/fix_config.sh contrib/gosa.conf contrib/mysql contrib/opensides
203 %doc %attr(-,root,root) contrib/patches contrib/scripts contrib/vacation_example.txt contrib/demo.ldif contrib/openldap
205 %config(noreplace) %attr(0600,%{apacheuser},%{apachegroup}) %{webconf}/gosa_include.conf
206 %config(noreplace) %attr(0700,%{apacheuser},%{apachegroup}) /etc/gosa
207 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
208 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/html
209 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/ihtml
210 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/include
211 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/locale
212 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/setup
213 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/plugins
214 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/doc/guide.xml
216 %files schema
217 %defattr(-,root,root)
218 %doc COPYING AUTHORS README contrib/demo.ldif contrib/openldap
219 /etc/openldap/schema/gosa
221 %files mkntpasswd
222 %defattr(-,root,root)
223 /usr/bin/mkntpasswd
225 %files help-en
226 %defattr(-,root,root)
227 /usr/share/gosa/doc/guide/user/en
229 %files help-de
230 %defattr(-,root,root)
231 /usr/share/gosa/doc/guide/user/de
233 %files help-fr
234 %defattr(-,root,root)
235 /usr/share/gosa/doc/guide/user/fr
237 %files help-nl
238 %defattr(-,root,root)
239 /usr/share/gosa/doc/guide/user/nl
241 %changelog
242 * Mon May 7 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.99cvs
243 - Changed packageversion to reflect CVS status of resulting build
245 * Wed Apr 11 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.10
246 - New upstream
247 - Added new subpackage mkntpasswd
248 - Remove perl dependencies off of GOsa main package
250 * Tue Mar 6 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.9
251 - New upstream
252 - fixed typo in updateprocess
254 * Mon Jan 15 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.8
255 - New upstream release with security fixes
257 * Wed Dec 20 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.7
258 - New upstream
259 - %pre and %postun always end successfully now, even on errors
261 * Fri Nov 17 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.6
262 - New upstream
263 - Cleanup temporary dir after package removal
264 - Cleanup temporary dir before update
266 * Thu Sep 28 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.4
267 - New upstream version
268 - Downgraded SuSE dependencies to php4
270 * Wed Jun 21 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.1
271 - New upstream version
273 * Tue May 30 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5
274 - Updated RedHat dependencies
275 - New upstream version
276 - Spelling errors fixed ;)
277 - Seperation of online manual
279 * Mon Dec 19 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4-2
280 - Updated SuSE dependencies to php5
282 * Mon Nov 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4
283 - New upstream version
284 - Removed %doc for postgresql and openexchange
286 * Wed Jun 01 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4beta1
287 - New upstream version
288 - Added gosa.conf to contrib dir
289 - Rearranged documentation stuff
290 - Updated dependencies
291 - compress some files
293 * Mon Feb 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.3
294 - Update version to 2.3 (upstream)
296 * Mon Dec 13 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2-2
297 - Optionally allow different sourcenames
299 * Mon Nov 22 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2
300 - Update to 2.2 (upstream)
301 - reintroduction of suse detection
302 - small fixes
303 - Corrected URL
304 - Synchronize schema package name with debian
306 * Mon May 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1.1
307 - update to 2.1.1
309 * Mon Apr 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
310 - update to 2.1
312 * Fri Apr 16 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
313 - minor fixes
314 - update to 2.1rc2
316 * Tue Jan 24 2004 Henning P. Schmiedehausen <hps@intermeta.de> 2.1-2t
317 - bumped to 2.1beta2
318 - first INTERMETA internal build
320 * Mon Oct 20 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
321 - Update to new upstream release (2.0rc1)
323 * Fri Oct 17 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
324 - First build of GOsa as an RPM, should work on SuSE and RedHat