michael@721: ## michael@721: ## roundcube.spec -- OpenPKG RPM Package Specification michael@721: ## Copyright (c) 2012-2012 Michael Schloh von Bennewitz michael@721: ## michael@721: ## Permission to use, copy, modify, and distribute this software for michael@721: ## any purpose with or without fee is hereby granted, provided that michael@721: ## the above copyright notice and this permission notice appear in all michael@721: ## copies. michael@721: ## michael@721: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@721: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@721: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@721: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@721: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@721: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@721: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@721: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@721: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@721: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@721: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@721: ## SUCH DAMAGE. michael@721: ## michael@721: michael@728: # package version michael@728: %define V_plug_rcguard 0.2.0-39-g6d98249 michael@728: michael@721: # package information michael@721: Name: roundcube michael@721: Summary: Roundcube Webmail Client michael@721: URL: http://www.roundcube.net/ michael@721: Vendor: Thomas Bruederli michael@721: Packager: Michael Schloh von Bennewitz michael@721: Distribution: Europalab Networks Production michael@721: Class: EVAL michael@721: Group: Mail michael@721: License: GPL michael@728: Version: 0.8.2 michael@721: Release: 20120800 michael@721: michael@721: # list of sources michael@721: Source0: http://switch.dl.sourceforge.net/roundcubemail/%{version}/roundcubemail-%{version}.tar.gz michael@728: Source1: https://www.github.com/dennylin93/rcguard/tarball/master/dennylin93-rcguard-%{V_plug_rcguard}.tar.gz michael@746: Source2: roundcube-apache.conf michael@746: Source3: rc.roundcube michael@746: Source4: linen_login.png michael@728: Patch0: roundcube.patch michael@721: michael@721: # build information michael@721: BuildPreReq: OpenPKG, openpkg >= 20100101 michael@721: PreReq: OpenPKG, openpkg >= 20100101 michael@721: PreReq: MTA, apache, apache-php michael@721: PreReq: apache-php::with_xml = yes michael@721: PreReq: apache-php::with_json = yes michael@728: PreReq: apache-php::with_exif = yes michael@721: PreReq: apache-php::with_mcrypt = yes michael@721: PreReq: apache-php::with_iconv = yes michael@721: PreReq: apache-php::with_session = yes michael@721: PreReq: apache-php::with_ssl = yes michael@721: michael@721: %description michael@721: Roundcube webmail is a browser based multilingual IMAP client with michael@721: an application-like user interface. It provides full functionality michael@721: expected from a email client, including MIME support, address book, michael@721: folder manipulation, message searching and spell checking. michael@721: michael@721: %track michael@721: prog roundcube = { michael@721: version = %{version} michael@721: url = http://prdownloads.sourceforge.net/roundcubemail/ michael@721: regex = roundcubemail-(\d+\.\d+\.\d+)\.tar\.gz michael@721: } michael@721: michael@721: %prep michael@721: %setup -q -n roundcubemail-%{version} michael@728: %setup -q -n roundcubemail-%{version} -D -T -a 1 michael@721: %{l_shtool} subst \ michael@721: -e 's;\(E_ALL&~E_NOTICE\));\1&~E_STRICT);' \ michael@721: installer/index.php michael@728: mv dennylin93-rcguard-* plugins/rcguard michael@728: %patch -p0 michael@728: %{l_shtool} subst %{l_value -s -a} \ michael@728: plugins/managesieve/config.inc.php.dist michael@721: michael@721: %build michael@721: michael@721: %install michael@721: # create directory structure michael@721: %{l_shtool} mkdir -f -p -m 755 \ michael@746: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ michael@746: $RPM_BUILD_ROOT%{l_prefix}/share/roundcube \ michael@746: $RPM_BUILD_ROOT%{l_prefix}/var/roundcube/log \ michael@746: $RPM_BUILD_ROOT%{l_prefix}/var/roundcube/run michael@721: michael@721: # install program michael@721: cp -rpf \ michael@721: bin config installer logs plugins program skins SQL temp \ michael@721: $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/ michael@721: %{l_shtool} install -c -m 644 \ michael@721: index.php robots.txt \ michael@721: $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/ michael@721: michael@728: # install other components michael@728: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/plugins/rcguard/skins \ michael@728: && ln -s default larry ) michael@728: %{l_shtool} install -c -m 644 \ michael@728: %{SOURCE linen_login.png} \ michael@728: $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/skins/larry/images/ michael@728: michael@746: # install runcommand script michael@746: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@746: %{SOURCE rc.roundcube} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@746: michael@746: # install custom Apache configuration michael@746: l_hostname=`%{l_shtool} echo -e %h` michael@746: l_domainname=`%{l_shtool} echo -e %d | cut -c2-` michael@746: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@746: -e "s;@l_hostname@;$l_hostname;g" \ michael@746: -e "s;@l_domainname@;$l_domainname;g" \ michael@746: %{SOURCE roundcube-apache.conf} \ michael@746: $RPM_BUILD_ROOT%{l_prefix}/etc/roundcube/ michael@746: michael@721: # determine package ingredients and tag config files michael@721: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@721: %{l_files_std} \ michael@728: '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/temp' \ michael@728: '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/logs' \ michael@728: '%config %attr(640,%{l_mgrp},%{l_ngrp}) %{l_prefix}/share/roundcube/config/*' \ michael@728: '%config %attr(640,%{l_mgrp},%{l_ngrp}) %{l_prefix}/share/roundcube/plugins/*/*config*' michael@721: michael@721: %files -f files michael@721: michael@721: %clean michael@721: michael@721: %post michael@746: if [ $1 -eq 1 ]; then michael@721: # display information about next steps michael@721: ( echo "Roundcube stores data in SQL and requires an existing" michael@721: echo "local or remote installation of PostgreSQL, MySQL, or" michael@721: echo "SQLite. Please refer to online documentation to carry" michael@721: echo "out the SQL configuration, something like:" michael@721: echo "" michael@721: echo "CREATE DATABASE roundcubemail;" michael@728: echo "CREATE USER 'username'@'localhost' IDENTIFIED BY 'newpwd';" michael@721: echo "GRANT ALL PRIVILEGES ON roundcubemail.* TO username@localhost IDENTIFIED BY 'newpwd';" michael@721: echo "FLUSH PRIVILEGES;" michael@746: echo "" michael@746: echo "After that, start the database server and finally start Roundcube:" michael@746: echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc roundcube start" michael@746: echo "Cconnect with a browser to the URL:" michael@746: echo " http://127.0.0.1:8080/roundcube/" michael@721: ) | %{l_rpmtool} msg -b -t notice michael@746: fi michael@746: if [ $1 -eq 2 ]; then michael@746: # after upgrade, restart service michael@746: eval `%{l_rc} roundcube status 2>/dev/null` michael@746: [ ".$roundcube_active" = .yes ] && %{l_rc} roundcube restart michael@746: fi michael@746: exit 0 michael@721: michael@721: %preun michael@746: # before erase, stop service and remove log files michael@721: [ $1 -eq 0 ] || exit 0 michael@746: %{l_rc} roundcube stop 2>/dev/null michael@721: rm -f $RPM_INSTALL_PREFIX/var/roundcube/log/*.log >/dev/null 2>&1 || true michael@746: rm -f $RPM_INSTALL_PREFIX/share/roundcube/logs/* >/dev/null 2>&1 || true michael@746: rm -f $RPM_INSTALL_PREFIX/share/roundcube/temp/* >/dev/null 2>&1 || true michael@721: