]> git.pld-linux.org Git - packages/roundcubemail.git/blobdiff - roundcubemail.spec
avoid .sh ext for .php scripts
[packages/roundcubemail.git] / roundcubemail.spec
index 9d09722aa6c853ff79e338a5db28bb629591c642..df6bb1d6c5e02d5527c363bf816e84549fba96ba 100644 (file)
@@ -1,43 +1,86 @@
 # TODO:
-# - prepare config for lighttpd
-# - it has PEAR boundled inside - use system ones
-# - use pear-deps system?
 # - use system js/tiny_mce
+# - use system js/jquery
 # - package: http://blog.ilohamail.org/ and remove boundled classess from it
-#
+# - test/finish and then enable by default password-anon-ldap-bind patch
+# - bconds does not work for a long time
 #
 %bcond_with    spamfilter      # Build with spamfilter patch
+%bcond_with    postfixadmin    # Build with postfixadmin support patch
+%bcond_with    password_anon_ldap_bind # apply with password-anon-ldap-bind patch.
 
+%define                rcpfa_ver       1.0.5
+%define                php_min_version 5.2.3
+%include       /usr/lib/rpm/macros.php
 Summary:       RoundCube Webmail
 Summary(pl.UTF-8):     RoundCube Webmail - poczta przez WWW
 Name:          roundcubemail
-Version:       0.1.1
-Release:       2.9
-License:       GPL v2
-Group:         Applications/WWW
-Source0:       http://dl.sourceforge.net/roundcubemail/%{name}-%{version}.tar.gz
-# Source0-md5: a2bf665acd7f8a6b2b63c92aedefb23f
-Source1:       %{name}.config
+Version:       1.0.8
+Release:       0.3
+License:       GPL v3+
+Group:         Applications/Mail
+Source0:       http://downloads.sourceforge.net/roundcubemail/%{name}-%{version}-dep.tar.gz
+# Source0-md5: 9465b80be1c13534646a04b0b5562d56
+Source1:       apache.conf
 Source2:       %{name}.logrotate
-Source3:       %{name}-lighttpd.conf
+Source3:       lighttpd.conf
+Source4:       http://nejc.skoberne.net/wp-content/uploads/2008/11/rcpfa-105.tgz
+# Source4-md5: dc23bcd894f693db74fce53b09ab58d6
+Source5:       find-lang.sh
+Source6:       httpd.conf
 Patch0:                %{name}-config.patch
-Patch1:                %{name}-faq-page.patch
-Patch2:                %{name}-tz.patch
-Patch3:                %{name}-spam.patch
+Patch1:                %{name}-spam.patch
+Patch2:                %{name}-postfixadmin-pl_locales.patch
+Patch3:                %{name}-faq-page.patch
+Patch4:                %{name}-password-anon-ldap-bind.patch
 URL:           http://www.roundcube.net/
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpm-php-pearprov >= 4.4.2-11
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.654
 BuildRequires: sed >= 4.0
 Requires:      %{name}-skin
+Requires:      php(core) >= %{php_min_version}
+Requires:      php(date)
+Requires:      php(dom)
+Requires:      php(iconv)
+Requires:      php(imap)
 Requires:      php(pcre)
+Requires:      php(session)
+Requires:      php(simplexml)
 Requires:      php(sockets)
-# Some php-database backend. Suggests?
+Requires:      php(spl)
+Requires:      php(xml)
+Requires:      php-pear-DB
+Requires:      php-pear-Mail_Mime >= 1.8.0
+Requires:      php-pear-Net_IDNA2 >= 0.1.1
+Requires:      php-pear-Net_SMTP
+Requires:      rpm-whiteout >= 1.22
 Requires:      webapps
+Requires:      webserver(alias)
+Requires:      webserver(indexfile)
+Requires:      webserver(php)
+Requires(post):        openssl-tools
+Suggests:      php(exif)
+Suggests:      php(fileinfo)
 Suggests:      php(gd)
-Suggests:      php(iconv)
+Suggests:      php(intl)
+Suggests:      php(json)
+Suggests:      php(mbstring)
 Suggests:      php(mcrypt)
 Suggests:      php(openssl)
-Suggests:      php-pecl-fileinfo
-Conflicts:     logrotate < 3.7-4
+Suggests:      php(xml)
+Suggests:      php-pear-Auth_SASL
+# at least one MDB2 db driver needed
+Suggests:      php-pear-MDB2_Driver_mysql
+Suggests:      php-pear-MDB2_Driver_pgsql
+Suggests:      php-pear-MDB2_Driver_sqlite
+Suggests:      php-pear-Net_LDAP2
+Suggests:      php-pear-Net_Sieve
+Suggests:      php-pear-Net_Socket
+Obsoletes:     roundcube-plugin-jqueryui
+Obsoletes:     roundcubemail-skin-default
+Conflicts:     apache-base < 2.4.0-1
+Conflicts:     logrotate < 3.8.0
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -49,6 +92,16 @@ BuildRoot:   %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                _applogdir      /var/log/roundcube
 %define                _archivelogdir  /var/log/archive/roundcube
 
+%define                find_lang       sh %{SOURCE5} %{buildroot}
+
+%define                _noautoreq_pear .*
+
+# exclude optional php dependencies
+%define                _noautophp      php-sqlite php-mysql php-mysqli php-pgsql php-hash php-json php-xml
+
+# put it together for rpmbuild
+%define                _noautoreq      %{?_noautophp}
+
 %description
 RoundCube Webmail is a browser-based multilingual IMAP client with an
 application-like user interface. It provides full functionality you
@@ -78,31 +131,94 @@ This package provides installer script for RoundCube Webmail.
 %description setup -l pl.UTF-8
 Ten pakiet zawiera skrypt instalacyjny RoundCube Webmaila.
 
-%package skin-default
-Summary:       Default skin for RoundCube Webmail
-Summary(pl.UTF-8):     Domyślna skórka dla RoundCube Webmaila
+%package skin-classic
+Summary:       Classic skin for RoundCube Webmail
+Summary(pl.UTF-8):     Klasyczna skórka dla RoundCube Webmaila
+Group:         Applications/WWW
+Requires:      %{name} = %{version}-%{release}
+Provides:      %{name}-skin
+
+%description skin-classic
+Classic skin for RoundCube Webmail.
+
+%description skin-classic -l pl.UTF-8
+Klasyczna skórka dla RoundCube Webmaila.
+
+%package skin-larry
+Summary:       Larry skin for RoundCube Webmail
+Summary(pl.UTF-8):     Skórka Larry dla RoundCube Webmaila
 Group:         Applications/WWW
+Requires:      %{name} = %{version}-%{release}
 Provides:      %{name}-skin
 
-%description skin-default
-Default skin for RoundCube Webmail.
+%description skin-larry
+Larry skin for RoundCube Webmail.
 
-%description skin-default -l pl.UTF-8
-Domyślna skórka dla RoundCube Webmaila.
+%description skin-larry -l pl.UTF-8
+Skórka Larry dla RoundCube Webmaila.
 
 %prep
-%setup -q
+%setup -q -n %{name}-%{version}-dep %{?with_postfixadmin:-a 4}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
 %if %{with spamfilter}
-%patch3 -p1
+%patch1 -p1
+%endif
+%if %{with postfixadmin}
+#patch2 -p1
+%endif
+#%patch3 -p1
+%if %{with password_anon_ldap_bind}
+%patch4 -p1
 %endif
 
 find -name .svn | xargs -r rm -rf
 
 # undos the source
-find '(' -name '*.php' -o -name '*.inc' -o -name '*.js' -o -name '*.css' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
+%undos -f php,inc,js,css
+
+# fill proper shebang
+%{__sed} -i -e '1s,^#!.*php,#!/usr/bin/php,' bin/*.sh
+# these are php scripts really
+for a in $(grep -l '<?php' bin/*.sh); do
+       mv $a ${a%.sh}
+done
+%{__sed} -i s/indexcontacts.sh/indexcontacts/g bin/update
+%{__sed} -i s/updatedb.sh/updatedb/g bin/update
+
+# tools to pack js
+rm bin/jsshrink.sh
+rm bin/cssshrink.sh
+
+# pear package junk
+rm -v plugins/*/package.xml
+
+mv config/config.inc.php{.sample,}
+
+%if %{with postfixadmin}
+mv rcpfa-%{rcpfa_ver} rcpfa
+cd rcpfa
+cp -p code/forwarding.html ../skins/default/templates
+cp -p code/password.html ../skins/default/templates
+cp -p code/vacation.html ../skins/default/templates
+cp -p code/pfa_forwarding.inc ../program/steps/settings
+cp -p code/pfa_password.inc ../program/steps/settings
+cp -p code/pfa_vacation.inc ../program/steps/settings
+cp -p code/pfa.php ../program/include
+
+%{__patch} -d .. -p1 < diffs/app.js.diff
+%{__patch} -d .. -p1 < diffs/db.inc.php.diff
+%{__patch} -d .. -p1 < diffs/func.inc.diff
+%{__patch} -d .. -p1 < diffs/index.php.diff
+%{__patch} -d .. -p1 < diffs/labels.inc.diff
+%{__patch} -d .. -p1 < diffs/main.inc.diff
+%{__patch} -d .. -p1 < diffs/config.inc.php.diff
+%{__patch} -d .. -p1 < diffs/messages.inc.diff
+%{__patch} -d .. -p1 < diffs/rcube_user.php.diff
+%{__patch} -d .. -p1 < diffs/settingstabs.html.diff
+%endif
+
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -111,7 +227,7 @@ install -d $RPM_BUILD_ROOT{%{_appdatadir},%{_applogdir},%{_archivelogdir},%{_sys
 
 # Main application part:
 cp -a program/* $RPM_BUILD_ROOT%{_appdir}/program
-cp -a bin/*.php $RPM_BUILD_ROOT%{_appdir}/bin
+cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin
 cp -a index.php $RPM_BUILD_ROOT%{_appdir}
 
 # Skins installation
@@ -119,45 +235,76 @@ cp -a skins/* $RPM_BUILD_ROOT%{_appdir}/skins
 
 # Installer part
 cp -a installer/* $RPM_BUILD_ROOT%{_appdir}/installer
+cp -a SQL $RPM_BUILD_ROOT%{_appdir}
 
-## Configuration:
-install config/db.inc.php.dist $RPM_BUILD_ROOT%{_sysconfdir}/db.inc.php
-install config/main.inc.php.dist $RPM_BUILD_ROOT%{_sysconfdir}/main.inc.php
-ln -sf %{_sysconfdir}/db.inc.php $RPM_BUILD_ROOT%{_appdir}/config/db.inc.php
-ln -sf %{_sysconfdir}/main.inc.php $RPM_BUILD_ROOT%{_appdir}/config/main.inc.php
+# Plugins
+cp -a plugins $RPM_BUILD_ROOT%{_appdir}/plugins
 
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
-install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
-install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+## Configuration:
+for a in config/*.php; do
+       cp -p $a $RPM_BUILD_ROOT%{_sysconfdir}
+       ln -s %{_sysconfdir}/$(basename $a) $RPM_BUILD_ROOT%{_appdir}/config
+done
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+
+# find locales
+%find_lang %{name}.lang
+# sed -ne 's/%lang(\([^)]\+\).*/\1/p' %{name}.lang | sort -u | grep _
+
+# now package plugins using filelist as well, as due lang tagging the files
+# section will go unmanageable
+for p in $RPM_BUILD_ROOT%{_appdir}/plugins/*; do
+       echo "%dir ${p#$RPM_BUILD_ROOT}"
+       for p in $p/*; do
+               d=${p##*/}
+               p=${p#$RPM_BUILD_ROOT}
+               case "$d" in
+               localization)
+                       continue
+                       ;;
+               README | Changelog | composer.json | config.inc.php.dist)
+                       echo "%doc $p"
+                       ;;
+               *)
+                       echo "$p"
+                       ;;
+               esac
+       done
+done > plugins.lang
+cat plugins.lang >> %{name}.lang
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%pretrans
-if [ ! -f %{_sysconfdir}/db.inc.php -o ! -f %{_sysconfdir}/main.inc.php ]; then
-       # import configs from previously manually installed site
-       d=/home/services/httpd/html/config
-       echo >&2 "Importing site configs from $d"
-       mkdir -p %{_sysconfdir}
-       if [ -f $d/db.inc.php ]; then
-               [ -f %{_sysconfdir}/db.inc.php ] && mv -f %{_sysconfdir}/db.inc.php{,.rpmorig}
-               cp -af $d/db.inc.php %{_sysconfdir}/db.inc.php
-       fi
-       if [ -f $d/main.inc.php ]; then
-               [ -f %{_sysconfdir}/main.inc.php ] && mv -f %{_sysconfdir}/main.inc.php{,.rpmorig}
-               cp -af $d/main.inc.php %{_sysconfdir}/main.inc.php
+%post
+# replace default des string in config file for better security
+makedesstr() {
+       openssl rand -hex 12
+}
+
+if grep -q '24ByteDESkey' %{_sysconfdir}/config.inc.php; then
+       des=$(makedesstr)
+       # precaution if random str generation failed
+       if [ c$(echo -n "$des" | wc -c) = c24 ]; then
+               %{__sed} -i -e "s/rcmail-\!24ByteDESkey\*Str/$des/" %{_sysconfdir}/config.inc.php
        fi
 fi
 
-%post
-if [ "$1" = 0 ]; then
-%banner -e %{name} <<'EOF'
-To customize installed languages set
- %%_install_langs in /etc/rpm/macros
+# Note this on version upgrade
+%triggerpostun -- %{name} < %{version}-0
+# don't do anything on --downgrade
+if [ $1 -le 1 ]; then
+       exit 0
+fi
+%banner -e %{name}-upgrade <<-EOF
+Run %{_appdir}/bin/update to update to version %{version}.
+(Be sure to have %{name}-setup installed when you run it)
 
+See %{_docdir}/%{name}-%{version}/UPGRADING* for more information.
 EOF
-fi
 
 %triggerin -- apache1 < 1.3.37-3, apache1-base
 %webapp_register apache %{_webapp}
@@ -165,10 +312,10 @@ fi
 %triggerun -- apache1 < 1.3.37-3, apache1-base
 %webapp_unregister apache %{_webapp}
 
-%triggerin -- apache < 2.2.0, apache-base
+%triggerin -- apache-base
 %webapp_register httpd %{_webapp}
 
-%triggerun -- apache < 2.2.0, apache-base
+%triggerun -- apache-base
 %webapp_unregister httpd %{_webapp}
 
 %triggerin -- lighttpd
@@ -177,105 +324,52 @@ fi
 %triggerun -- lighttpd
 %webapp_unregister lighttpd %{_webapp}
 
-%files
+%files -f %{name}.lang
 %defattr(644,root,root,755)
-%doc CHANGELOG INSTALL README UPGRADING SQL
+%doc CHANGELOG INSTALL README.md UPGRADING
 %dir %attr(750,root,http) %{_sysconfdir}
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.inc.php
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/defaults.inc.php
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mimetypes.php
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
 %dir %{_appdir}
 %{_appdir}/*.php
-%dir %{_appdir}/bin
-%{_appdir}/bin/*.php
-%dir %{_appdir}/config
-%{_appdir}/config/*.php
+%{_appdir}/config
 %dir %{_appdir}/program
-%{_appdir}/program/*.gif
 %{_appdir}/program/include
 %{_appdir}/program/js
 %{_appdir}/program/lib
+%{_appdir}/program/resources
 %{_appdir}/program/steps
-%dir %{_appdir}/program/localization
 %{_appdir}/program/localization/index.inc
 
-%lang(am) %{_appdir}/program/localization/am
-%lang(ar) %{_appdir}/program/localization/ar
-%lang(bg) %{_appdir}/program/localization/bg
-%lang(bs) %{_appdir}/program/localization/bs_BA
-%lang(ca) %{_appdir}/program/localization/ca
-%lang(cz) %{_appdir}/program/localization/cz
-%lang(da) %{_appdir}/program/localization/da
-%lang(de) %{_appdir}/program/localization/de_DE
-%lang(de_CH) %{_appdir}/program/localization/de_CH
-%lang(el) %{_appdir}/program/localization/el
-%lang(en_GB) %{_appdir}/program/localization/en_GB
-%lang(en_US) %{_appdir}/program/localization/en_US
-%lang(eo) %{_appdir}/program/localization/eo
-%lang(es) %{_appdir}/program/localization/es
-%lang(et) %{_appdir}/program/localization/et_EE
-%lang(eu) %{_appdir}/program/localization/eu
-%lang(fa) %{_appdir}/program/localization/fa
-%lang(fi) %{_appdir}/program/localization/fi
-%lang(fr) %{_appdir}/program/localization/fr
-%lang(ga) %{_appdir}/program/localization/ga_IE
-%lang(ge) %{_appdir}/program/localization/ge
-%lang(gl) %{_appdir}/program/localization/gl
-%lang(he) %{_appdir}/program/localization/he
-%lang(hi) %{_appdir}/program/localization/hi
-%lang(hr) %{_appdir}/program/localization/hr
-%lang(hu) %{_appdir}/program/localization/hu
-%lang(id) %{_appdir}/program/localization/id_ID
-%lang(is) %{_appdir}/program/localization/is
-%lang(it) %{_appdir}/program/localization/it
-%lang(ja) %{_appdir}/program/localization/ja
-%lang(kr) %{_appdir}/program/localization/kr
-%lang(ku) %{_appdir}/program/localization/ku
-%lang(lt) %{_appdir}/program/localization/lt
-%lang(lv) %{_appdir}/program/localization/lv
-%lang(mk) %{_appdir}/program/localization/mk
-%lang(ms) %{_appdir}/program/localization/ms_MY
-%lang(nb) %{_appdir}/program/localization/nb_NO
-%lang(ne) %{_appdir}/program/localization/ne
-%lang(nl) %{_appdir}/program/localization/nl_NL
-%lang(nl_BE) %{_appdir}/program/localization/nl_BE
-%lang(nn) %{_appdir}/program/localization/nn_NO
-%lang(pl) %{_appdir}/program/localization/pl
-%lang(pt) %{_appdir}/program/localization/pt_PT
-%lang(pt_BR) %{_appdir}/program/localization/pt_BR
-%lang(ro) %{_appdir}/program/localization/ro
-%lang(ru) %{_appdir}/program/localization/ru
-%lang(se) %{_appdir}/program/localization/se
-%lang(si) %{_appdir}/program/localization/si
-%lang(sk) %{_appdir}/program/localization/sk
-%lang(sl) %{_appdir}/program/localization/sl
-%lang(sq) %{_appdir}/program/localization/sq_AL
-%lang(sr) %{_appdir}/program/localization/sr_cyrillic
-%lang(sr@latin) %{_appdir}/program/localization/sr_latin
-%lang(th) %{_appdir}/program/localization/th_TH
-%lang(tr) %{_appdir}/program/localization/tr
-%lang(uk) %{_appdir}/program/localization/uk
-%lang(vn) %{_appdir}/program/localization/vn
-%lang(zh_CN) %{_appdir}/program/localization/zh_CN
-%lang(zh_TW) %{_appdir}/program/localization/zh_TW
+%dir %{_appdir}/plugins
 
 %dir %{_appdir}/skins
 %dir %attr(770,root,http) %{_applogdir}
 %dir %attr(751,root,logs) %{_archivelogdir}
 %dir %attr(770,root,http) %{_appdatadir}
-# %ghost logfile
+
+# TODO: %ghost logfile(s)
 
 %files setup
 %defattr(644,root,root,755)
+%dir %{_appdir}/bin
+%attr(755,root,root) %{_appdir}/bin/*
 %dir %{_appdir}/installer
 %{_appdir}/installer/*.php
 %{_appdir}/installer/client.js
 %{_appdir}/installer/styles.css
-%{_appdir}/installer/welcome.html
 %{_appdir}/installer/images
+%{_appdir}/SQL
+
+%files skin-classic
+%defattr(644,root,root,755)
+%{_appdir}/skins/classic
 
-%files skin-default
+%files skin-larry
 %defattr(644,root,root,755)
-%{_appdir}/skins/default
+%{_appdir}/skins/larry
This page took 0.112765 seconds and 4 git commands to generate.