Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > 8805dd9cceedfaa5c7d1a6070d55cc5e > files > 6

imp-2.2.8-1mdk.src.rpm

#
#  File: imp.spec
#
#  based on
#
#  $Horde: imp/packaging/redhat/rh7-imp.spec,v 1.1.2.2 2001/02/03 18:05:09 bjn Exp $
#
#  This is the SPEC file for the IMP Mandrake 7.2 (RPM v3) RPMs/SRPM.
#

%define apachedir /etc/httpd
%define apacheuser apache
%define apachegroup apache
%define contentdir /var/www

Summary: The Internet Messaging Program: webmail access to IMAP/POP3 accounts.
Name: imp
Version: 2.2.8
Release: 1mdk
License: GPL
Group: System/Servers
Source: ftp://ftp.horde.org/pub/imp/tarballs/imp-%{version}.tar.bz2
Source1: imp-mdk.conf.bz2
Patch0: imp-2.2.6-poppassd.patch.bz2
Patch1: imp-2.2.6-pgconnect.patch.bz2
Patch2: imp-2.2.6-postconf.patch.bz2
URL: http://www.horde.org/
BuildArchitectures: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
PreReq: mod_php
Requires: php-imap >= 4.0.4pl1
Requires: horde >= 1.2.6, horde-phplib-storage
Requires: apache, php-ldap, poppassd
PreReq: /usr/bin/perl

%description
IMP is the Internet Messaging Program, one of the Horde components.
It provides webmail access to IMAP and POP3 accounts.

The Horde Project writes web applications in PHP and releases them under
the GNU Public License.  For more information (including help with IMP)
please visit http://www.horde.org/.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
# fix documentation user/group
perl -pi -e "s/nobody/%{apachegroup}/g" docs/SECURITY
perl -pi -e "s/nobody/%{apacheuser}/g" docs/DATABASE

%install
mkdir -p %buildroot/%{apachedir}/conf
bzcat %{SOURCE1} > %buildroot/%{apachedir}/conf/imp.conf
mkdir -p %buildroot/%{contentdir}/html/horde/imp
cp -pR * %buildroot/%{contentdir}/html/horde/imp
perl -pi -e "s!root_url = \'\'!root_url = \'/horde/imp\'!;" %buildroot/%{contentdir}/html/horde/imp/config/defaults.php3.dist

%clean
rm -rf %buildroot

%post
grep -i 'Include.*imp.conf$' %{apachedir}/conf/httpd.conf >/dev/null 2>&1
if [ $? -eq 0 ]; then
	perl -pi -e 's/^#+// if (/Include.*imp.conf$/i);' %{apachedir}/conf/httpd.conf
else
	echo "Include conf/imp.conf" >>%{apachedir}/conf/httpd.conf
fi
/sbin/service httpd restart
sleep 1  # settling time vs. installing multiple RPMs at a time

( cd  %{contentdir}/html/horde; sh install.sh; sh secure.sh )

#cat <<_EOF2_
#
#IMPORTANT:  If you are installing for the first time, you must now
#configure IMP.  The following commands (run as root) will do this:
#
## cd %{contentdir}/html/horde
## sh install.sh
#(visit http://example.com/horde/setup.php3 in a browser)
## sh secure.sh
#
#If you are using a database, you also need to set the database password:
#
## sh scripts/database/dbpasswd.sh
#
#(See %{contentdir}/html/horde/imp/docs/INSTALL for more information.)
#
#_EOF2_

%postun
if [ $1 -eq 0 ]; then
    perl -pi -e 's/^/#/ if (/^Include.*imp.conf$/i);' %{apachedir}/conf/httpd.conf
    /sbin/service httpd restart
    sleep 1  # settling time vs. installing multiple RPMs at a time
fi

%files
%defattr(-,root,root)
# Apache imp.conf file
%config(noreplace) %{apachedir}/conf/imp.conf
# Include top level with %dir so not all files are sucked in
%dir %{contentdir}/html/horde/imp
# Include top-level files by hand
%{contentdir}/html/horde/imp/*.css
%{contentdir}/html/horde/imp/*.php3
# Include these dirs so that all files _will_ get sucked in
%{contentdir}/html/horde/imp/graphics
%{contentdir}/html/horde/imp/lib
%{contentdir}/html/horde/imp/locale
%{contentdir}/html/horde/imp/scripts
%{contentdir}/html/horde/imp/templates
# Mark documentation files with %doc and %docdir
%doc %{contentdir}/html/horde/imp/COPYING
%doc %{contentdir}/html/horde/imp/README
%docdir %{contentdir}/html/horde/imp/docs
%{contentdir}/html/horde/imp/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/imp/config
%{contentdir}/html/horde/imp/config/*.dist
%defattr(-,root,%{apachegroup})
%config(noreplace) %{contentdir}/html/horde/imp/config/*.html
%config(noreplace) %{contentdir}/html/horde/imp/config/*.php3
%config(noreplace) %{contentdir}/html/horde/imp/config/*.txt

%changelog
* Thu Apr 11 2002 Yves Duret <yduret@mandrakesoft.com> 2.2.8-1mdk
- 2.2.8 (it fixes three potential security issues).
- %%buildroot macro

* Thu Mar 07 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.2.7-1mdk
- 2.2.7.

* Mon Oct 22 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.2.6-7mdk
- fixed a bug in postconf.php3 causing warnings messages during password
  changes.

* Thu Sep 13 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.2.6-6mdk
- replaced pg_connect to pg_pconnect in lib/db.pgsql, to avoid the
  warning "...is not a valid PostgreSQL link...".

* Tue Sep 11 2001 Philippe Libat <philippe@mandrakesoft.com> 2.2.6-5mdk
- fix mod_php prereq

* Tue Sep 04 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.2.6-4mdk
- modified config files for poppassd support.

* Mon Sep 03 2001 Philippe Libat <philippe@mandrakesoft.com> 2.2.6-3mdk
- fix post-install script.
- Require Apache, php-ldap.

* Wed Aug 29 2001 Philippe Libat <philippe@mandrakesoft.com> 2.2.6-2mdk
- fix httpd.conf entry.

* Wed Aug 01 2001 Lenny Cartier <lenny@mandrakesoft.com> 2.2.6-1mdk
- updated to 2.2.6.

* Sat Feb 24 2001 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.2.4-1mdk
- initial mandrake release.

* Tue Feb 06 2001 Brent J. Nordquist <bjn@horde.org>
- 2.2.4 release 1rh7.