%define name turba %define version 1.1 %define release 2mdk %define apachedir /etc/httpd %define contentdir /var/www %define apacheuser apache %define apachegroup apache Name: %{name} Version: %{version} Release: %{release} Summary: The Horde contact management application. License: LGPL Group: System/Servers Source0: ftp://ftp.horde.org/pub/turba/tarballs/turba-%{version}.tar.bz2 Source1: turba-mdk.conf.bz2 Patch0: turba-1.1-config-imp.patch.bz2 Patch1: turba-1.1-config-sources-ldap.patch.bz2 URL: http://www.horde.org/ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-root Requires: horde2 >= 2.0 Requires: php >= 4.1.0 Prereq: /usr/bin/perl %description Turba is the Horde contact management application, which allows access to and storage of personal contacts (including name, email address, phone number, and other easily customizable fields). Turba integrates with IMP (Horde's webmail application) as its address book. The Horde Project writes web applications in PHP and releases them under Open Source licenses. For more information (including help with Turba) please visit http://www.horde.org/. %prep %setup -q -n %{name}-%{version} %patch0 -p0 -b .imp %patch1 -p0 -b .ldap %build %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{apachedir}/conf \ $RPM_BUILD_ROOT%{contentdir}/html/horde/turba bzcat %{SOURCE1} > $RPM_BUILD_ROOT%{apachedir}/conf/turba.conf cp -pR * $RPM_BUILD_ROOT%{contentdir}/html/horde/turba cd $RPM_BUILD_ROOT%{contentdir}/html/horde/turba/config for d in *.dist; do d0=`basename $d .dist` if [ ! -f "$d0" ]; then cp -p $d $d0 fi done %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %post perl -pi -e 's/$/ index.php/ if (/DirectoryIndex\s.*index\.html/ && !/index\.php/);' %{apachedir}/conf/httpd.conf grep -i 'Include.*turba.conf$' %{apachedir}/conf/httpd.conf >/dev/null 2>&1 if [ $? -eq 0 ]; then perl -pi -e 's/^#+// if (/Include.*turba.conf$/i);' %{apachedir}/conf/httpd.conf else echo "Include %{apachedir}/conf/turba.conf" >>%{apachedir}/conf/httpd.conf fi /sbin/service httpd graceful sleep 1 # settling time vs. installing multiple RPMs at a time # post-install instructions: #cat <<_EOF_ #_EOF_ %postun if [ $1 -eq 0 ]; then perl -pi -e 's/^/#/ if (/^Include.*turba.conf$/i);' %{apachedir}/conf/httpd.conf /sbin/service httpd graceful sleep 1 # settling time vs. installing multiple RPMs at a time fi %files %defattr(-,root,root) # Apache turba.conf file %config(noreplace) %{apachedir}/conf/turba.conf # Include top level with %dir so not all files are sucked in %dir %{contentdir}/html/horde/turba # Include top-level files by hand %{contentdir}/html/horde/turba/*.php # Include these dirs so that all files _will_ get sucked in %{contentdir}/html/horde/turba/graphics %{contentdir}/html/horde/turba/lib %{contentdir}/html/horde/turba/locale %{contentdir}/html/horde/turba/po %{contentdir}/html/horde/turba/scripts %{contentdir}/html/horde/turba/templates # Mark documentation files with %doc and %docdir %doc %{contentdir}/html/horde/turba/COPYING %doc %{contentdir}/html/horde/turba/README %docdir %{contentdir}/html/horde/turba/docs %{contentdir}/html/horde/turba/docs # Mark configuration files with %config and use secure permissions # (note that .dist files are considered software; don't mark %config) %attr(750,root,%{apachegroup}) %dir %{contentdir}/html/horde/turba/config %defattr(640,root,%{apachegroup}) %{contentdir}/html/horde/turba/config/.htaccess %{contentdir}/html/horde/turba/config/*.dist %config %{contentdir}/html/horde/turba/config/*.php %changelog * Tue Jul 02 2002 Guillaume Rousse <g.rousse@linux-mandrake.com> 1.1-2mdk - spec cleanup - removed circular requires on imp3 - removed redundant requires on apache * Wed Jun 19 2002 Lenny Cartier <lenny@mandrakesoft.com> 1.1-1mdk - updated by David Walser <luigiwalser@yahoo.com> : - 1.1 final - Regenerate ldap patch * Sat Mar 18 2002 David Walser <luigiwalser@yahoo.com> 1.1-0.2mdk - Add patch1 (ldap sources) * Sat Mar 18 2002 David Walser <luigiwalser@yahoo.com> 1.1-0.1mdk - Regenerate patch * Mon Mar 11 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.0-3mdk - s/Copyright/License/. * Mon Mar 11 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.0-2mdk - fixed BuildRequires for horde2 and imp3. * Mon Mar 11 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.0-1mdk - initial mandrake release. - added imp in config. * Wed Jan 02 2002 Brent J. Nordquist <bjn@horde.org> - 1.0 release 1 * Mon Dec 24 2001 Brent J. Nordquist <bjn@horde.org> - 1.0-RC4 release 1 * Sun Dec 16 2001 Brent J. Nordquist <bjn@horde.org> - initial RPM for Turba 1.0