Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
michael@721 | 1 | ## |
michael@721 | 2 | ## roundcube.spec -- OpenPKG RPM Package Specification |
michael@721 | 3 | ## Copyright (c) 2012-2012 Michael Schloh von Bennewitz <michael@schloh.com> |
michael@721 | 4 | ## |
michael@721 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@721 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@721 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@721 | 8 | ## copies. |
michael@721 | 9 | ## |
michael@721 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@721 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@721 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@721 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@721 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@721 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@721 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@721 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@721 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@721 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@721 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@721 | 21 | ## SUCH DAMAGE. |
michael@721 | 22 | ## |
michael@721 | 23 | |
michael@728 | 24 | # package version |
michael@728 | 25 | %define V_plug_rcguard 0.2.0-39-g6d98249 |
michael@728 | 26 | |
michael@721 | 27 | # package information |
michael@721 | 28 | Name: roundcube |
michael@721 | 29 | Summary: Roundcube Webmail Client |
michael@721 | 30 | URL: http://www.roundcube.net/ |
michael@721 | 31 | Vendor: Thomas Bruederli |
michael@721 | 32 | Packager: Michael Schloh von Bennewitz |
michael@721 | 33 | Distribution: Europalab Networks Production |
michael@721 | 34 | Class: EVAL |
michael@721 | 35 | Group: Mail |
michael@721 | 36 | License: GPL |
michael@728 | 37 | Version: 0.8.2 |
michael@721 | 38 | Release: 20120800 |
michael@721 | 39 | |
michael@721 | 40 | # list of sources |
michael@721 | 41 | Source0: http://switch.dl.sourceforge.net/roundcubemail/%{version}/roundcubemail-%{version}.tar.gz |
michael@728 | 42 | Source1: https://www.github.com/dennylin93/rcguard/tarball/master/dennylin93-rcguard-%{V_plug_rcguard}.tar.gz |
michael@746 | 43 | Source2: roundcube-apache.conf |
michael@746 | 44 | Source3: rc.roundcube |
michael@746 | 45 | Source4: linen_login.png |
michael@728 | 46 | Patch0: roundcube.patch |
michael@721 | 47 | |
michael@721 | 48 | # build information |
michael@721 | 49 | BuildPreReq: OpenPKG, openpkg >= 20100101 |
michael@721 | 50 | PreReq: OpenPKG, openpkg >= 20100101 |
michael@721 | 51 | PreReq: MTA, apache, apache-php |
michael@721 | 52 | PreReq: apache-php::with_xml = yes |
michael@721 | 53 | PreReq: apache-php::with_json = yes |
michael@728 | 54 | PreReq: apache-php::with_exif = yes |
michael@721 | 55 | PreReq: apache-php::with_mcrypt = yes |
michael@721 | 56 | PreReq: apache-php::with_iconv = yes |
michael@721 | 57 | PreReq: apache-php::with_session = yes |
michael@721 | 58 | PreReq: apache-php::with_ssl = yes |
michael@721 | 59 | |
michael@721 | 60 | %description |
michael@721 | 61 | Roundcube webmail is a browser based multilingual IMAP client with |
michael@721 | 62 | an application-like user interface. It provides full functionality |
michael@721 | 63 | expected from a email client, including MIME support, address book, |
michael@721 | 64 | folder manipulation, message searching and spell checking. |
michael@721 | 65 | |
michael@721 | 66 | %track |
michael@721 | 67 | prog roundcube = { |
michael@721 | 68 | version = %{version} |
michael@721 | 69 | url = http://prdownloads.sourceforge.net/roundcubemail/ |
michael@721 | 70 | regex = roundcubemail-(\d+\.\d+\.\d+)\.tar\.gz |
michael@721 | 71 | } |
michael@721 | 72 | |
michael@721 | 73 | %prep |
michael@721 | 74 | %setup -q -n roundcubemail-%{version} |
michael@728 | 75 | %setup -q -n roundcubemail-%{version} -D -T -a 1 |
michael@721 | 76 | %{l_shtool} subst \ |
michael@721 | 77 | -e 's;\(E_ALL&~E_NOTICE\));\1&~E_STRICT);' \ |
michael@721 | 78 | installer/index.php |
michael@728 | 79 | mv dennylin93-rcguard-* plugins/rcguard |
michael@728 | 80 | %patch -p0 |
michael@728 | 81 | %{l_shtool} subst %{l_value -s -a} \ |
michael@728 | 82 | plugins/managesieve/config.inc.php.dist |
michael@721 | 83 | |
michael@721 | 84 | %build |
michael@721 | 85 | |
michael@721 | 86 | %install |
michael@721 | 87 | # create directory structure |
michael@721 | 88 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@746 | 89 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
michael@746 | 90 | $RPM_BUILD_ROOT%{l_prefix}/share/roundcube \ |
michael@746 | 91 | $RPM_BUILD_ROOT%{l_prefix}/var/roundcube/log \ |
michael@746 | 92 | $RPM_BUILD_ROOT%{l_prefix}/var/roundcube/run |
michael@721 | 93 | |
michael@721 | 94 | # install program |
michael@721 | 95 | cp -rpf \ |
michael@721 | 96 | bin config installer logs plugins program skins SQL temp \ |
michael@721 | 97 | $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/ |
michael@721 | 98 | %{l_shtool} install -c -m 644 \ |
michael@721 | 99 | index.php robots.txt \ |
michael@721 | 100 | $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/ |
michael@721 | 101 | |
michael@728 | 102 | # install other components |
michael@728 | 103 | ( cd $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/plugins/rcguard/skins \ |
michael@728 | 104 | && ln -s default larry ) |
michael@728 | 105 | %{l_shtool} install -c -m 644 \ |
michael@728 | 106 | %{SOURCE linen_login.png} \ |
michael@728 | 107 | $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/skins/larry/images/ |
michael@728 | 108 | |
michael@746 | 109 | # install runcommand script |
michael@746 | 110 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@746 | 111 | %{SOURCE rc.roundcube} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@746 | 112 | |
michael@746 | 113 | # install custom Apache configuration |
michael@746 | 114 | l_hostname=`%{l_shtool} echo -e %h` |
michael@746 | 115 | l_domainname=`%{l_shtool} echo -e %d | cut -c2-` |
michael@746 | 116 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@746 | 117 | -e "s;@l_hostname@;$l_hostname;g" \ |
michael@746 | 118 | -e "s;@l_domainname@;$l_domainname;g" \ |
michael@746 | 119 | %{SOURCE roundcube-apache.conf} \ |
michael@746 | 120 | $RPM_BUILD_ROOT%{l_prefix}/etc/roundcube/ |
michael@746 | 121 | |
michael@721 | 122 | # determine package ingredients and tag config files |
michael@721 | 123 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@721 | 124 | %{l_files_std} \ |
michael@728 | 125 | '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/temp' \ |
michael@728 | 126 | '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/logs' \ |
michael@728 | 127 | '%config %attr(640,%{l_mgrp},%{l_ngrp}) %{l_prefix}/share/roundcube/config/*' \ |
michael@728 | 128 | '%config %attr(640,%{l_mgrp},%{l_ngrp}) %{l_prefix}/share/roundcube/plugins/*/*config*' |
michael@721 | 129 | |
michael@721 | 130 | %files -f files |
michael@721 | 131 | |
michael@721 | 132 | %clean |
michael@721 | 133 | |
michael@721 | 134 | %post |
michael@746 | 135 | if [ $1 -eq 1 ]; then |
michael@721 | 136 | # display information about next steps |
michael@721 | 137 | ( echo "Roundcube stores data in SQL and requires an existing" |
michael@721 | 138 | echo "local or remote installation of PostgreSQL, MySQL, or" |
michael@721 | 139 | echo "SQLite. Please refer to online documentation to carry" |
michael@721 | 140 | echo "out the SQL configuration, something like:" |
michael@721 | 141 | echo "" |
michael@721 | 142 | echo "CREATE DATABASE roundcubemail;" |
michael@728 | 143 | echo "CREATE USER 'username'@'localhost' IDENTIFIED BY 'newpwd';" |
michael@721 | 144 | echo "GRANT ALL PRIVILEGES ON roundcubemail.* TO username@localhost IDENTIFIED BY 'newpwd';" |
michael@721 | 145 | echo "FLUSH PRIVILEGES;" |
michael@746 | 146 | echo "" |
michael@746 | 147 | echo "After that, start the database server and finally start Roundcube:" |
michael@746 | 148 | echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc roundcube start" |
michael@746 | 149 | echo "Cconnect with a browser to the URL:" |
michael@746 | 150 | echo " http://127.0.0.1:8080/roundcube/" |
michael@721 | 151 | ) | %{l_rpmtool} msg -b -t notice |
michael@746 | 152 | fi |
michael@746 | 153 | if [ $1 -eq 2 ]; then |
michael@746 | 154 | # after upgrade, restart service |
michael@746 | 155 | eval `%{l_rc} roundcube status 2>/dev/null` |
michael@746 | 156 | [ ".$roundcube_active" = .yes ] && %{l_rc} roundcube restart |
michael@746 | 157 | fi |
michael@746 | 158 | exit 0 |
michael@721 | 159 | |
michael@721 | 160 | %preun |
michael@746 | 161 | # before erase, stop service and remove log files |
michael@721 | 162 | [ $1 -eq 0 ] || exit 0 |
michael@746 | 163 | %{l_rc} roundcube stop 2>/dev/null |
michael@721 | 164 | rm -f $RPM_INSTALL_PREFIX/var/roundcube/log/*.log >/dev/null 2>&1 || true |
michael@746 | 165 | rm -f $RPM_INSTALL_PREFIX/share/roundcube/logs/* >/dev/null 2>&1 || true |
michael@746 | 166 | rm -f $RPM_INSTALL_PREFIX/share/roundcube/temp/* >/dev/null 2>&1 || true |
michael@721 | 167 |