Code

On the road for updated RPM packages
[gosa.git] / contrib / gosa.spec
1 # Some sort auf "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.4
15 Release:                1
16 License:                GPL
17 Source:                 ftp://oss.GONICUS.de/pub/gosa/beta/%{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,php4,php4-gd,php4-ldap,php4-mcrypt,php4-imap,ImageMagick,perl-Crypt-SmbHash
25 %else
26 Requires:               php,php-ldap,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 %else
39         %{echo:Building other rpm}
40         %define apacheuser apache 
41         %define apachegroup apache 
42         %define webconf /etc/httpd/conf.d/      
43 %endif
45 %description
46 GOsa is a combination of system-administrator and end-user web
47 interface, designed to handle LDAP based setups.
48 Provided is access to posix, shadow, samba, proxy, fax, and kerberos
49 accounts. It is able to manage the postfix/cyrus server combination
50 and can write user adapted sieve scripts.
52 %package schema
53 Group:                  System/Administration
54 Summary:                Schema Definitions for the GOSA package
55 %if %{suse}
56 Requires:               openldap2 >= 2.0.27
57 %else
58 Requires:               openldap >= 2.0.27
59 %endif
60 Obsoletes:              gosa-ldap
62 %description schema
63 Contains the Schema definition files for the GOSA admin package.
66 %prep
67 %setup -q -n %{sourcename}
68 find . -depth -name CVS -type d | xargs rm -rf
70 %build
73 %install
74 # Create buildroot
75 mkdir -p %{buildroot}/usr/share/gosa
77 DIRS="doc ihtml plugins html include locale"
79 for i in $DIRS; do \
80   cp -ua $i %{buildroot}/usr/share/gosa/$i ; \
81 done
83 mkdir -p %{buildroot}/var/spool/gosa
84 # Copy default config
85 mkdir -p %{buildroot}%{confdir}
86 mkdir -p %{buildroot}%{webconf}
88 cat > %{buildroot}%{webconf}/gosa_include.conf <<EOF
89 # Just to be sure
90 <Directory "/usr/share/gosa/html">
91         Options None
92         AllowOverride None
93         Order allow,deny
94         Allow from all
95 </Directory>
96 # Set alias to gosa
97 Alias /gosa /usr/share/gosa/html
98 EOF
100 mkdir -p %{buildroot}/etc/openldap/schema/gosa
101 mv contrib/openldap/*.schema %{buildroot}/etc/openldap/schema/gosa
102 sed 's%"CONFIG_TEMPLATE_DIR", "../contrib/"%"CONFIG_TEMPLATE_DIR", "/usr/share/doc/gosa-%{version}/"%g' %{buildroot}/usr/share/gosa/include/functions.inc > %{buildroot}/usr/share/gosa/include/functions.inc.new
103 mv -f %{buildroot}/usr/share/gosa/include/functions.inc.new %{buildroot}/usr/share/gosa/include/functions.inc
104 mv -f doc manual
105 mkdir -p %{buildroot}/etc/gosa/vacation
106 mv plugins/personal/mail/sieve-*.txt %{buildroot}/etc/gosa
107 mkdir -p %{buildroot}/usr/share/doc/gosa-%{version}
108 rm -rf %{buildroot}/usr/share/gosa/contrib
109 rm -rf %{buildroot}/usr/share/gosa/doc
110 #rmdir contrib/openldap
112 %clean
113 rm -rf %{buildroot}
115 %post
116 # Add shells file to /etc/gosa 
117 /bin/cp /etc/shells /etc/gosa
119 %files
120 %defattr(-,%{apacheuser},%{apachegroup})
121 %doc %attr(-,root,root) AUTHORS TODO README README.openxchange README.safemode Changelog COPYING INSTALL FAQ
122 %doc %attr(-,root,root) manual 
123 %doc %attr(-,root,root) contrib/altlinux contrib/fix_config.sh contrib/gosa.conf contrib/mysql contrib/opensides
124 %doc %attr(-,root,root) contrib/patches contrib/postgresql contrib/scripts contrib/vacation_example.txt
126 %config(noreplace) %attr(0600,%{apacheuser},%{apachegroup}) %{webconf}/gosa_include.conf
127 %config(noreplace) %attr(0700,%{apacheuser},%{apachegroup}) /etc/gosa
128 %dir %attr(0700, %{apacheuser}, %{apachegroup}) /var/spool/gosa
129 %attr(0744, %{apacheuser}, %{apachegroup}) /usr/share/gosa
131 %files schema
132 %defattr(-,root,root)
133 %doc COPYING AUTHORS README contrib/iplanet contrib/demo.ldif contrib/openldap
134 /etc/openldap/schema/gosa
136 %changelog
137 * Mon May 24 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.4
138 - New upstream version
139 - Added gosa.conf to contrib dir
140 - Rearranged documentation stuff
142 * Mon Feb 21 2005 Lars Scheiter <lars.scheiter@GONICUS.de> 2.3
143 - Update version to 2.3 (upstream)
145 * Mon Dec 13 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2-2
146 - Optionally allow different sourcenames
148 * Mon Nov 22 2004 Lars Scheiter <lars.scheiter@GONICUS.de> 2.2
149 - Update to 2.2 (upstream)
150 - reintroduction of suse detection
151 - small fixes
152 - Corrected URL
153 - Synchronize schema package name with debian
155 * Mon May 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1.1
156 - update to 2.1.1
158 * Mon Apr 19 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
159 - update to 2.1
161 * Fri Apr 16 2004 Levente Farkas <lfarkas@lfarkas.org> 2.1
162 - minor fixes
163 - update to 2.1rc2
165 * Tue Jan 24 2004 Henning P. Schmiedehausen <hps@intermeta.de> 2.1-2t
166 - bumped to 2.1beta2
167 - first INTERMETA internal build
169 * Mon Oct 20 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
170 - Update to new upstream release (2.0rc1)
172 * Fri Oct 17 2003 Lars Scheiter <lars.scheiter@GONICUS.de>
173 - First build of GOsa as an RPM, should work on SuSE and RedHat