Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > e13f3d92d8a4d4c20e5b92e79be67de7 > files > 2

roundcubemail-0.1.1-1mdv2009.0.src.rpm

%define mod_conf 	74_roundcubemail.conf
%define basedir 	/var/www/roundcubemail

%define rel		1
%define beta		0
%if %beta
%define	release		%mkrel 0.%beta.%rel
%define distname	%name-%version-%beta-dep.tar.gz
%define dirname		%name-%version-%beta-dep
%else
%define release		%mkrel %rel
%define distname	%name-%version-dep.tar.gz
%define dirname		%name-%version-dep
%endif

Summary:	A PHP-based webmail server
URL:		http://www.roundcube.net/
Name:		roundcubemail
Version:	0.1.1
Release:	%{release}           
Group:		System/Servers
License:	GPLv2
# Use the -dep tarballs. These use system copies of the PHP stuff
# rather than including them, which is better for our purposes.
# - AdamW 2007/07
Source0:	http://downloads.sourceforge.net/roundcubemail/%{distname}
Epoch:		1
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch:	noarch
#BuildRequires:	apache-devel pcre-devel rpm-helper
Requires:	apache-mod_php
Requires:	php-gettext
Requires:	php-iconv
Requires:	php-mbstring
Requires:	php-openssl
Requires:	php-session
Requires:	php-pear-DB
Requires:	php-pear-Mail_Mime
Requires:	php-pear-Net_SMTP

Requires(post):		rpm-helper
Requires(postun):	rpm-helper

%description
RoundCube Webmail is a browser-based multilingual IMAP client with an 
application-like user interface. It provides full functionality you 
expect from an e-mail client, including MIME support, address book, 
folder manipulation, message searching and spell checking. RoundCube 
Webmail is written in PHP and requires a MySQL or PostgreSQL database.
The user interface is fully skinnable using XHTML and CSS 2.

%prep
%setup -q -n %{dirname}

%build

%install
rm -rf %{buildroot}
# tell it that we're moving the configuration files
sed -i -e 's,config/main.inc.php,%{_sysconfdir}/%{name}/main.inc.php,g' program/include/main.inc
sed -i -e 's,config/db.inc.php,%{_sysconfdir}/%{name}/db.inc.php,g' program/include/main.inc
# use systemwide log dir
sed -i -e 's,logs/,%{_logdir}/%{name}/,g' config/main.inc.php.dist
# and temp dir
sed -i -e 's,temp/,/tmp/,g' config/main.inc.php.dist
mkdir -p %{buildroot}%{basedir}
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
mkdir -p %{buildroot}%{_logdir}/%{name}
cp -a config/db.inc.php.dist %{buildroot}%{_sysconfdir}/%{name}/db.inc.php
cp -a config/main.inc.php.dist %{buildroot}%{_sysconfdir}/%{name}/main.inc.php
rm -rf config
rm -rf temp
rm -rf logs
rm -rf installer
cp -a * %{buildroot}%{basedir}/
rm -f %{buildroot}%{basedir}/CHANGELOG %{buildroot}%{basedir}/INSTALL %{buildroot}%{basedir}/UPGRADING %{buildroot}%{basedir}/LICENSE %{buildroot}%{basedir}/README

cat <<EOF > %{mod_conf}

Alias /%{name} %{basedir}

<Directory %{basedir}>

    Allow from all

</Directory>

EOF

cat <<EOF > README.urpmi

This package conforms to the Mandriva web applications policy:
http://wiki.mandriva.com/Policies/Web_Applications

It therefore differs from a standard installation in the following
ways:

* Logs are stored to /var/log/roundcubemail
* Temporary files are placed in /tmp
* Configuration files (main.inc.php and db.inc.php) are placed in
  /etc/roundcubemail

You will need to edit /etc/roundcubemail/main.inc.php and
/etc/roundcubemail/db.inc.php appropriately for your site before you
can use Roundcube. You must at least configure an appropriate mail
server and port in main.inc.php, and change the 
$rcmail_config['des_key'] setting. In db.inc.php you must configure
an appropriate database location and user; in the most simple
configuration, you would create a new user and database both named
'roundcubemail' on a MySQL server running on the same machine, give
the roundcubemail user full read/write access to the roundcubemail
database, and set db.inc.php appropriately.

EOF

mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d
install -m0644 %{mod_conf} %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/%{mod_conf}

%post
%{_post_webapp}

%postun
%{_postun_webapp}

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root)
%doc %attr(-  root  root) CHANGELOG README README.urpmi
%{basedir}
%{_sysconfdir}/httpd/conf/webapps.d/%{mod_conf}
%dir %{_sysconfdir}/%{name}
%defattr(0775,root,www)
%{_logdir}/%{name}
%defattr(0640,root,www)
%config(noreplace) %{_sysconfdir}/%{name}/db.inc.php
%config(noreplace) %{_sysconfdir}/%{name}/main.inc.php



%changelog
* Mon May 12 2008 Adam Williamson <awilliamson@mandriva.com> 1:0.1.1-1mdv2009.0
+ Revision: 206481
- new release 0.1.1

* Tue Mar 18 2008 Adam Williamson <awilliamson@mandriva.com> 1:0.1-1mdv2008.1
+ Revision: 188649
- don't package the installer
- new release 0.1 final
- prettify pre-release conditionals
- clean spec a little

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Fri Nov 09 2007 Adam Williamson <awilliamson@mandriva.com> 1:0.1-0.rc2.1mdv2008.1
+ Revision: 107158
- new release 0.1rc2

* Thu Jul 26 2007 Adam Williamson <awilliamson@mandriva.com> 1:0.1-0.rc1.4mdv2008.0
+ Revision: 55688
- correct tarball name
- update requirements to pull in all the necessary PHP stuff
- use the new 'pure GPL' tarball which doesn't include its own copies of various PHP libraries
- update license
- update description
- add some comments

* Sun Jun 17 2007 Adam Williamson <awilliamson@mandriva.com> 1:0.1-0.rc1.3mdv2008.0
+ Revision: 40586
- substantial cleanup following webapp policy

* Tue May 22 2007 Adam Williamson <awilliamson@mandriva.com> 1:0.1-0.rc1.2mdv2008.0
+ Revision: 29868
- don't wipe temp dir prior to install

* Tue May 22 2007 Adam Williamson <awilliamson@mandriva.com> 1:0.1-0.rc1.1mdv2008.0
+ Revision: 29856
- 0.1 rc1
- big spec clean based on squirrelmail spec


* Sat Feb 17 2007 Emmanuel Andry <eandry@mandriva.org> 0.1beta2-1mdv2007.0
+ Revision: 122166
- Import roundcubemail