Code

Updated gosa.spec (Only SuSE this time)
[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.11a
15 Release:                1
16 License:                GPL
17 Source:                 http://oss.gonicus.de/pub/gosa/%{sourcename}.tar.bz2
18 URL:                    http://www.gosa-project.org
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 >= 5.2.0,php5,php5-gd,php5-ldap,php5-mcrypt,php5-mysql,php5-imap,php5-iconv,php5-mbstring,php5-gettext,php5-mhash,php5-snmp,php5-posix,fping,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.2.0
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. This one is needed
66 on the master LDAP and all slave LDAP Servers.
68 %package mkntpasswd
69 Group:                  System/Administration
70 Summary:                Schema Definitions for the GOSA package
71 %if %{suse}
72 Requires:               perl-Crypt-SmbHash
73 %else
74 Requires:               perl-Crypt-SmbHash >= 0.02
75 %endif
77 %description mkntpasswd
78 Wrapper Script around perl to create Samba Hashes on the fly, added for completeness only.
79 If in doubt use sambas "native" mkntpwd tool to generate hashes for GOsa.
81 %package help-en
82 Group:                  System/Administration
83 Summary:                English online manual for GOSA package
84 Requires:               gosa >= %{version}
86 %description help-en
87 English online manual page for GOSA package
89 %package help-de
90 Group:                  System/Administration
91 Summary:                German localized online manual for GOSA package
92 Requires:               gosa >= %{version}
94 %description help-de
95 German localized online manual page for GOSA package
97 %package help-fr
98 Group:                  System/Administration
99 Summary:                French localized online manual for GOSA package
100 Requires:               gosa >= %{version}
102 %description help-fr
103 French localized online manual page for GOSA package
105 %package help-nl
106 Group:                  System/Administration
107 Summary:                Dutch localized online manual for GOSA package
108 Requires:               gosa >= %{version}
110 %description help-nl
111 Dutch localized online manual page for GOSA package
113 %prep
114 %setup -q -n %{sourcename}
115 find . -depth -name CVS -type d | xargs rm -rf
117 %build
120 %install
121 # Create buildroot
122 mkdir -p %{buildroot}/usr/share/gosa
124 # Copy
125 DIRS="doc ihtml plugins html include setup locale"
126 for i in $DIRS; do \
127   cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
128 done
129 mkdir %{buildroot}/usr/bin
130 cp bin/mkntpasswd %{buildroot}/usr/bin/
132 # Create files for temporary stuff
133 for i in compile config cache; do \
134   mkdir -p %{buildroot}/var/spool/gosa/$i ; \
135 done
137 # Cleanup manual dirs
138 for i in admin devel; do \
139   rm -rf %{buildroot}/usr/share/gosa/doc/guide/$i ; \
140 done
142 # Remove (some) unneeded files
143 for i in gen_locale.sh gen_online_help.sh gen_function_list.php update.sh; do \
144  rm -rf %{buildroot}/usr/share/gosa/$i ; \
145 done
147 # Cleanup lyx warnings
148 find %{buildroot}/usr/share/gosa -name WARNINGS |xargs rm
151 # Cleanup guide
152 rm -rf %{buildroot}/usr/share/gosa/doc/guide/user/*/lyx-source
155 # Copy default config
156 mkdir -p %{buildroot}%{confdir}
157 mkdir -p %{buildroot}%{webconf}
159 cat > %{buildroot}%{webconf}/gosa_include.conf <<EOF
160 # Just to be sure
161 <Directory "/usr/share/gosa/html">
162         Options None
163         AllowOverride None
164         Order allow,deny
165         Allow from all
166 </Directory>
167 # Set alias to gosa
168 Alias /gosa /usr/share/gosa/html
169 EOF
171 mkdir -p %{buildroot}/etc/openldap/schema/gosa
172 mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
173 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
174 mv -f %{buildroot}/usr/share/gosa/include/functions.inc.new %{buildroot}/usr/share/gosa/include/functions.inc
176 mv -f doc manual
177 mkdir -p %{buildroot}/etc/gosa/vacation
178 mv -f %{buildroot}/usr/share/gosa/plugins/personal/mail/sieve-*.txt %{buildroot}/etc/gosa
179 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
180 rm -rf %{buildroot}/usr/share/gosa/contrib
181 #rm -rf %{buildroot}/usr/share/gosa/doc
182 #rmdir contrib/openldap
183 bzip2 -9 contrib/opensides/goSamba.pl
184 cp contrib/encodings %{buildroot}/etc/gosa
186 %clean
187 rm -rf %{buildroot}
189 %post
190 # Add shells file to /etc/gosa 
191 /bin/cp /etc/shells /etc/gosa
193 %pre
194 # Cleanup compile dir on updates, always exit cleanly even on errors
195 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
197 %postun
198 # Remove temporary files, just to be sure
199 [ -d /var/spool/gosa ] && rm -rf /var/spool/gosa/* ; exit 0
201 %files
202 %defattr(-,%{apacheuser},%{apachegroup})
203 %doc %attr(-,root,root) AUTHORS TODO README README.safemode Changelog COPYING INSTALL FAQ
204 %doc %attr(-,root,root) contrib/altlinux contrib/fix_config.sh contrib/gosa.conf contrib/mysql contrib/opensides
205 %doc %attr(-,root,root) contrib/patches contrib/scripts contrib/vacation_example.txt contrib/demo.ldif contrib/openldap
207 %config(noreplace) %attr(0600,%{apacheuser},%{apachegroup}) %{webconf}/gosa_include.conf
208 %config(noreplace) %attr(0700,%{apacheuser},%{apachegroup}) /etc/gosa
209 %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
210 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/setup
211 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/html
212 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/ihtml
213 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/include
214 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/locale
215 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/plugins
216 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa/doc/guide.xml
218 %files schema
219 %defattr(-,root,root)
220 %doc COPYING AUTHORS README contrib/demo.ldif contrib/openldap
221 /etc/openldap/schema/gosa
223 %files mkntpasswd
224 %defattr(-,root,root)
225 /usr/bin/mkntpasswd
227 %files help-en
228 %defattr(-,root,root)
229 /usr/share/gosa/doc/guide/user/en
231 %files help-de
232 %defattr(-,root,root)
233 /usr/share/gosa/doc/guide/user/de
235 %files help-fr
236 %defattr(-,root,root)
237 /usr/share/gosa/doc/guide/user/fr
239 %files help-nl
240 %defattr(-,root,root)
241 /usr/share/gosa/doc/guide/user/nl
243 %changelog
244 * Tue Jun 12 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.11a
245 - New upstream
246 - Added encodings file
247 - Added SuSE dependency for needed php5 >= 5.2.0, and modules
248 - Fixed URLs to GOsa packages and homepage
250 * Wed May 16 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.11
251 - New upstream
252 - Added new setup
254 * Wed Apr 11 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.10
255 - New upstream
256 - Added new subpackage mkntpasswd
257 - Remove perl dependencies off of GOsa main package
259 * Tue Mar 6 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.9
260 - New upstream
261 - fixed typo in updateprocess
263 * Mon Jan 15 2007 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.8
264 - New upstream release with security fixes
266 * Wed Dec 20 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.7
267 - New upstream
268 - %pre and %postun always end successfully now, even on errors
270 * Fri Nov 17 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.6
271 - New upstream
272 - Cleanup temporary dir after package removal
273 - Cleanup temporary dir before update
275 * Thu Sep 28 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.4
276 - New upstream version
277 - Downgraded SuSE dependencies to php4
279 * Wed Jun 21 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5.1
280 - New upstream version
282 * Tue May 30 2006 Lars Scheiter <lars.scheiter@GONICUS.de> 2.5
283 - Updated RedHat dependencies
284 - New upstream version
285 - Spelling errors fixed ;)
286 - Seperation of online manual
288 * Mon Dec 19 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4-2
289 - Updated SuSE dependencies to php5
291 * Mon Nov 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4
292 - New upstream version
293 - Removed %doc for postgresql and openexchange
295 * Wed Jun 01 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4beta1
296 - New upstream version
297 - Added gosa.conf to contrib dir
298 - Rearranged documentation stuff
299 - Updated dependencies
300 - compress some files
302 * Mon Feb 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.3
303 - Update version to 2.3 (upstream)
305 * Mon Dec 13 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2-2
306 - Optionally allow different sourcenames
308 * Mon Nov 22 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2
309 - Update to 2.2 (upstream)
310 - reintroduction of suse detection
311 - small fixes
312 - Corrected URL
313 - Synchronize schema package name with debian
315 * Mon May 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1.1
316 - update to 2.1.1
318 * Mon Apr 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
319 - update to 2.1
321 * Fri Apr 16 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
322 - minor fixes
323 - update to 2.1rc2
325 * Tue Jan 24 2004 Henning P. Schmiedehausen <hps@intermeta.de> 2.1-2t
326 - bumped to 2.1beta2
327 - first INTERMETA internal build
329 * Mon Oct 20 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
330 - Update to new upstream release (2.0rc1)
332 * Fri Oct 17 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
333 - First build of GOsa as an RPM, should work on SuSE and RedHat