Wed, 15 Apr 2009 22:49:00 +0200
Import package vendor original specs for necessary manipulations.
michael@157 | 1 | ## |
michael@157 | 2 | ## squirrelmail.spec -- OpenPKG RPM Package Specification |
michael@157 | 3 | ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@157 | 4 | ## |
michael@157 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@157 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@157 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@157 | 8 | ## copies. |
michael@157 | 9 | ## |
michael@157 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@157 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@157 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@157 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@157 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@157 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@157 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@157 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@157 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@157 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@157 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@157 | 21 | ## SUCH DAMAGE. |
michael@157 | 22 | ## |
michael@157 | 23 | |
michael@157 | 24 | # package version |
michael@157 | 25 | %define V_squirrelmail 1.4.17 |
michael@157 | 26 | %define V_locale 1.4.13-20071220 |
michael@157 | 27 | %define V_plugin_compat 2.0.9-1.0 |
michael@157 | 28 | %define V_plugin_logger 1.4.0-1.0.6 |
michael@157 | 29 | %define V_plugin_addgraphics 2.3-1.0.3 |
michael@157 | 30 | %define V_plugin_avelsieve 1.9.7 |
michael@157 | 31 | %define V_plugin_saslpwd 1.4.1-1.4 |
michael@157 | 32 | %define V_plugin_checkquota 2.2-1.4.0 |
michael@157 | 33 | %define V_plugin_foldersize 1.5-1.4.0 |
michael@157 | 34 | %define V_plugin_gnupg 2.0.1-1.4.2 |
michael@157 | 35 | %define V_plugin_ldif 1.4-1.2.x |
michael@157 | 36 | %define V_plugin_update 0.7-1.4.2 |
michael@157 | 37 | %define V_plugin_userip 3.3-re-1.2.2 |
michael@157 | 38 | %define V_plugin_smallcal 0.8-1.2.3 |
michael@157 | 39 | %define V_plugin_vkeyboard 0.9 |
michael@157 | 40 | %define V_plugin_username 2.3-1.0.0 |
michael@157 | 41 | |
michael@157 | 42 | # package information |
michael@157 | 43 | Name: squirrelmail |
michael@157 | 44 | Summary: SquirrelMail Webmail Client |
michael@157 | 45 | URL: http://www.squirrelmail.org/ |
michael@157 | 46 | Vendor: Squirrelmail Developers |
michael@157 | 47 | Packager: OpenPKG Foundation e.V. |
michael@157 | 48 | Distribution: OpenPKG Community |
michael@157 | 49 | Class: EVAL |
michael@157 | 50 | Group: Mail |
michael@157 | 51 | License: GPL |
michael@157 | 52 | Version: %{V_squirrelmail} |
michael@157 | 53 | Release: 20090327 |
michael@157 | 54 | |
michael@157 | 55 | # package options |
michael@157 | 56 | %option with_plugins no |
michael@157 | 57 | %option with_kolab no |
michael@157 | 58 | |
michael@157 | 59 | # list of sources |
michael@157 | 60 | Source0: http://switch.dl.sourceforge.net/squirrelmail/squirrelmail-%{V_squirrelmail}.tar.bz2 |
michael@157 | 61 | Source1: http://switch.dl.sourceforge.net/squirrelmail/all_locales-%{V_locale}.tar.bz2 |
michael@157 | 62 | Source2: http://www.squirrelmail.org/plugins/compatibility-%{V_plugin_compat}.tar.gz |
michael@157 | 63 | Source3: http://www.squeaksoft.com/products/SquirrelLogger/squirrel_logger.%{V_plugin_logger}.tar.gz |
michael@157 | 64 | Source4: http://www.squirrelmail.org/plugins/addgraphics-%{V_plugin_addgraphics}.tar.gz |
michael@157 | 65 | Source5: http://www.squirrelmail.org/plugins/avelsieve-%{V_plugin_avelsieve}.tar.gz |
michael@157 | 66 | Source6: http://www.squirrelmail.org/plugins/chg_sasl_passwd-%{V_plugin_saslpwd}.tar.gz |
michael@157 | 67 | Source7: http://www.squirrelmail.org/plugins/check_quota-%{V_plugin_checkquota}.tar.gz |
michael@157 | 68 | Source8: http://www.squirrelmail.org/plugins/folder_sizes-%{V_plugin_foldersize}.tar.gz |
michael@157 | 69 | Source9: http://www.squirrelmail.org/plugins/gpg.%{V_plugin_gnupg}.tar.gz |
michael@157 | 70 | Source10: http://www.squirrelmail.org/plugins/ldifimport-%{V_plugin_ldif}.tar.gz |
michael@157 | 71 | Source11: http://www.squirrelmail.org/plugins/pupdate.%{V_plugin_update}.tar.gz |
michael@157 | 72 | Source12: http://www.squirrelmail.org/plugins/show_user_and_ip-%{V_plugin_userip}.tar.gz |
michael@157 | 73 | Source13: http://www.squirrelmail.org/plugins/smallcal-%{V_plugin_smallcal}.tar.gz |
michael@157 | 74 | Source14: http://www.squirrelmail.org/plugins/vkeyboard-%{V_plugin_vkeyboard}.tar.gz |
michael@157 | 75 | Source15: http://www.squirrelmail.org/plugins/username-%{V_plugin_username}.tar.gz |
michael@157 | 76 | Source16: config.php |
michael@157 | 77 | Source17: defprefs.txt |
michael@157 | 78 | Source18: opkg_large.png |
michael@157 | 79 | Source19: opkg_small.png |
michael@157 | 80 | Source20: rc.squirrelmail |
michael@157 | 81 | Source21: squirrelmail.conf |
michael@157 | 82 | Source22: config_local_kolab.php |
michael@157 | 83 | Source23: index.php |
michael@157 | 84 | Patch0: squirrelmail.patch |
michael@157 | 85 | Patch1: squirrelmail.patch.plugins |
michael@157 | 86 | |
michael@157 | 87 | # build information |
michael@157 | 88 | Prefix: %{l_prefix} |
michael@157 | 89 | BuildRoot: %{l_buildroot} |
michael@157 | 90 | BuildPreReq: OpenPKG, openpkg >= 20060823 |
michael@157 | 91 | PreReq: OpenPKG, openpkg >= 20060823 |
michael@157 | 92 | PreReq: MTA, apache, apache-php, apache-php::with_xml = yes |
michael@157 | 93 | AutoReq: no |
michael@157 | 94 | AutoReqProv: no |
michael@157 | 95 | |
michael@157 | 96 | %description |
michael@157 | 97 | SquirrelMail is a standards-based webmail package written in PHP. It |
michael@157 | 98 | includes built-in pure PHP support for the IMAP and SMTP protocols, |
michael@157 | 99 | and all pages render in pure HTML 4.0 (with no Javascript) for |
michael@157 | 100 | maximum compatibility across browsers. It has very few requirements |
michael@157 | 101 | and is very easy to configure and install. SquirrelMail has all the |
michael@157 | 102 | functionality you would want from an email client, including strong |
michael@157 | 103 | MIME support, address books, and folder manipulation. |
michael@157 | 104 | |
michael@157 | 105 | %track |
michael@157 | 106 | prog squirrelmail = { |
michael@157 | 107 | version = %{V_squirrelmail} |
michael@157 | 108 | url = http://prdownloads.sourceforge.net/squirrelmail/ |
michael@157 | 109 | regex = squirrelmail-(\d+\.[02468]\.\d+[a-z]?)\.tar\.bz2 |
michael@157 | 110 | } |
michael@157 | 111 | prog squirrelmail:locales = { |
michael@157 | 112 | version = %{V_locale} |
michael@157 | 113 | url = http://prdownloads.sourceforge.net/squirrelmail/ |
michael@157 | 114 | regex = all_locales-(\d+\.[02468]\.\d+-\d+)\.tar\.bz2 |
michael@157 | 115 | } |
michael@157 | 116 | prog squirrelmail:compat = { |
michael@157 | 117 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 118 | disabled |
michael@157 | 119 | version = %{V_plugin_compat} |
michael@157 | 120 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 121 | regex = compatibility-(__VER__)\.tar\.gz |
michael@157 | 122 | } |
michael@157 | 123 | prog squirrelmail:logger = { |
michael@157 | 124 | version = %{V_plugin_logger} |
michael@157 | 125 | url = http://www.squeaksoft.com/products/SquirrelLogger/ |
michael@157 | 126 | regex = squirrel_logger.(__VER__)\.tar\.gz |
michael@157 | 127 | } |
michael@157 | 128 | prog squirrelmail:addgraphics = { |
michael@157 | 129 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 130 | disabled |
michael@157 | 131 | version = %{V_plugin_addgraphics} |
michael@157 | 132 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 133 | regex = addgraphics-(__VER__)\.tar\.gz |
michael@157 | 134 | } |
michael@157 | 135 | prog squirrelmail:avelsieve = { |
michael@157 | 136 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 137 | disabled |
michael@157 | 138 | version = %{V_plugin_avelsieve} |
michael@157 | 139 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 140 | regex = avelsieve-(\d+\.\d+\.\d+)\.tar\.gz |
michael@157 | 141 | } |
michael@157 | 142 | prog squirrelmail:saslpwd = { |
michael@157 | 143 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 144 | disabled |
michael@157 | 145 | version = %{V_plugin_saslpwd} |
michael@157 | 146 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 147 | regex = chg_sasl_passwd-(\d+\.\d+\.\d+-\d+\.\d+)\.tar\.gz |
michael@157 | 148 | } |
michael@157 | 149 | prog squirrelmail:checkquota = { |
michael@157 | 150 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 151 | disabled |
michael@157 | 152 | version = %{V_plugin_checkquota} |
michael@157 | 153 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 154 | regex = check_quota-(__VER__)\.tar\.gz |
michael@157 | 155 | } |
michael@157 | 156 | prog squirrelmail:foldersize = { |
michael@157 | 157 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 158 | disabled |
michael@157 | 159 | version = %{V_plugin_foldersize} |
michael@157 | 160 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 161 | regex = folder_sizes-(__VER__)\.tar\.gz |
michael@157 | 162 | } |
michael@157 | 163 | prog squirrelmail:gnupg = { |
michael@157 | 164 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 165 | disabled |
michael@157 | 166 | version = %{V_plugin_gnupg} |
michael@157 | 167 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 168 | regex = gpg.(\d+\.\d+\.\d+-\d+\.\d+\.\d+)\.tar\.gz |
michael@157 | 169 | } |
michael@157 | 170 | prog squirrelmail:ldif = { |
michael@157 | 171 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 172 | disabled |
michael@157 | 173 | version = %{V_plugin_ldif} |
michael@157 | 174 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 175 | regex = ldifimport-(__VER__)\.tar\.gz |
michael@157 | 176 | } |
michael@157 | 177 | prog squirrelmail:update = { |
michael@157 | 178 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 179 | disabled |
michael@157 | 180 | version = %{V_plugin_update} |
michael@157 | 181 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 182 | regex = pupdate.(__VER__)\.tar\.gz |
michael@157 | 183 | } |
michael@157 | 184 | prog squirrelmail:userip = { |
michael@157 | 185 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 186 | disabled |
michael@157 | 187 | version = %{V_plugin_userip} |
michael@157 | 188 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 189 | regex = show_user_and_ip-(__VER__)\.tar\.gz |
michael@157 | 190 | } |
michael@157 | 191 | prog squirrelmail:smallcal = { |
michael@157 | 192 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 193 | disabled |
michael@157 | 194 | version = %{V_plugin_smallcal} |
michael@157 | 195 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 196 | regex = smallcal-(__VER__)\.tar\.gz |
michael@157 | 197 | } |
michael@157 | 198 | prog squirrelmail:vkeyboard = { |
michael@157 | 199 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 200 | disabled |
michael@157 | 201 | version = %{V_plugin_vkeyboard} |
michael@157 | 202 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 203 | regex = vkeyboard-(__VER__)\.tar\.gz |
michael@157 | 204 | } |
michael@157 | 205 | prog squirrelmail:username = { |
michael@157 | 206 | comment = "cs: untrackable due to CMS generated URLs" |
michael@157 | 207 | disabled |
michael@157 | 208 | version = %{V_plugin_username} |
michael@157 | 209 | url = http://www.squirrelmail.org/plugins_category.php?category_id=all |
michael@157 | 210 | regex = username-(__VER__)\.tar\.gz |
michael@157 | 211 | } |
michael@157 | 212 | |
michael@157 | 213 | %prep |
michael@157 | 214 | %setup -q -c -n squirrelmail |
michael@157 | 215 | %setup -q -D -T -a 1 -c -n squirrelmail/all_locales-%{V_locale} |
michael@157 | 216 | %setup -q -D -T -a 2 -n squirrelmail |
michael@157 | 217 | %setup -q -D -T -a 3 -n squirrelmail |
michael@157 | 218 | mv compatibility squirrelmail-%{V_squirrelmail}/plugins |
michael@157 | 219 | mv squirrel_logger squirrelmail-%{V_squirrelmail}/plugins |
michael@157 | 220 | %if "%{with_plugins}" == "yes" |
michael@157 | 221 | %setup -q -D -T -a 4 -n squirrelmail |
michael@157 | 222 | %setup -q -D -T -a 5 -n squirrelmail |
michael@157 | 223 | %setup -q -D -T -a 6 -n squirrelmail |
michael@157 | 224 | %setup -q -D -T -a 7 -n squirrelmail |
michael@157 | 225 | %setup -q -D -T -a 8 -n squirrelmail |
michael@157 | 226 | %setup -q -D -T -a 9 -n squirrelmail |
michael@157 | 227 | %setup -q -D -T -a 10 -n squirrelmail |
michael@157 | 228 | %setup -q -D -T -a 11 -n squirrelmail |
michael@157 | 229 | %setup -q -D -T -a 12 -n squirrelmail |
michael@157 | 230 | %setup -q -D -T -a 13 -n squirrelmail |
michael@157 | 231 | %setup -q -D -T -a 14 -n squirrelmail |
michael@157 | 232 | %setup -q -D -T -a 15 -n squirrelmail |
michael@157 | 233 | |
michael@157 | 234 | # move additional plugins where other are already placed |
michael@157 | 235 | for plug in addgraphics avelsieve check_quota chg_sasl_passwd \ |
michael@157 | 236 | folder_sizes gpg ldifimport pupdate show_user_and_ip \ |
michael@157 | 237 | smallcal vkeyboard username; do |
michael@157 | 238 | mv $plug squirrelmail-%{V_squirrelmail}/plugins |
michael@157 | 239 | done |
michael@157 | 240 | %endif |
michael@157 | 241 | |
michael@157 | 242 | # clean up login screen of distractions |
michael@157 | 243 | ( cd squirrelmail-%{V_squirrelmail} |
michael@157 | 244 | %patch -p0 |
michael@157 | 245 | ) || exit $? |
michael@157 | 246 | |
michael@157 | 247 | # rearrange documentation and remove archive script |
michael@157 | 248 | ( cd squirrelmail-%{V_squirrelmail} |
michael@157 | 249 | mv AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/ |
michael@157 | 250 | mv ReleaseNotes doc/ReleaseNotes.txt |
michael@157 | 251 | mv themes/README.themes doc/ |
michael@157 | 252 | for fil in `find plugins/ -name "README*" -o -name "Readme*" \ |
michael@157 | 253 | -o -name "INSTALL*" -o -name CHANGES -o -name HISTORY`; do |
michael@157 | 254 | %{l_shtool} mkdir -f -p -m 755 doc/`dirname $fil` |
michael@157 | 255 | mv -f $fil $_ |
michael@157 | 256 | done |
michael@157 | 257 | mv doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell |
michael@157 | 258 | rm -rf doc/plugins/squirrelspell/doc doc/plugins/squirrelspell/index.php |
michael@157 | 259 | mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell |
michael@157 | 260 | rm -rf plugins/squirrelspell/doc |
michael@157 | 261 | rm -f plugins/make_archive.pl |
michael@157 | 262 | %if "%{with_plugins}" == "yes" |
michael@157 | 263 | mv plugins/pupdate/docs/* doc/plugins/pupdate |
michael@157 | 264 | rm -rf plugins/pupdate/docs |
michael@157 | 265 | %endif |
michael@157 | 266 | |
michael@157 | 267 | # postadjustment cosmetics |
michael@157 | 268 | %{l_shtool} subst \ |
michael@157 | 269 | -e 's;\(#ffffff., .border="0" width=\)"350";\1"250";1' \ |
michael@157 | 270 | src/login.php |
michael@157 | 271 | |
michael@157 | 272 | # set default prefs |
michael@157 | 273 | cat %{SOURCE defprefs.txt} >>data/default_pref |
michael@157 | 274 | ) || exit $? |
michael@157 | 275 | |
michael@157 | 276 | %build |
michael@157 | 277 | |
michael@157 | 278 | %install |
michael@157 | 279 | rm -rf $RPM_BUILD_ROOT |
michael@157 | 280 | |
michael@157 | 281 | # create directory structure |
michael@157 | 282 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@157 | 283 | $RPM_BUILD_ROOT%{l_prefix}/bin \ |
michael@157 | 284 | $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail \ |
michael@157 | 285 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs \ |
michael@157 | 286 | $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/spool/attach \ |
michael@157 | 287 | $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/log |
michael@157 | 288 | |
michael@157 | 289 | # install locales |
michael@157 | 290 | ( cd all_locales-%{V_locale} |
michael@157 | 291 | cp -rpf help images locale $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/ |
michael@157 | 292 | ) || exit $? |
michael@157 | 293 | |
michael@157 | 294 | # install program |
michael@157 | 295 | ( cd squirrelmail-%{V_squirrelmail} |
michael@157 | 296 | |
michael@157 | 297 | # install default_pref |
michael@157 | 298 | %{l_shtool} install -c -m 644 \ |
michael@157 | 299 | data/default_pref \ |
michael@157 | 300 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs/ |
michael@157 | 301 | |
michael@157 | 302 | # create initial administrator list |
michael@157 | 303 | echo %{l_musr} >>$RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/admins |
michael@157 | 304 | |
michael@157 | 305 | # copy over most functional directories, a lot of stuff |
michael@157 | 306 | for dir in class doc functions include plugins src themes; do |
michael@157 | 307 | cp -rpf $dir $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/ |
michael@157 | 308 | done |
michael@157 | 309 | cp -rpf images/* $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/ |
michael@157 | 310 | cp -pf locale/timezones.cfg $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/locale/ |
michael@157 | 311 | |
michael@157 | 312 | # install main config files |
michael@157 | 313 | l_fqdm=`%{l_shtool} echo -e %h%d` |
michael@157 | 314 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@157 | 315 | -e 's;config/\(config_local.php\);\1;g' \ |
michael@157 | 316 | -e "s;@l_fqdm@;${l_fqdm};g" \ |
michael@157 | 317 | %{SOURCE config.php} \ |
michael@157 | 318 | config/config_default.php \ |
michael@157 | 319 | config/config_local.php \ |
michael@157 | 320 | $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/ |
michael@157 | 321 | %if "%{with_plugins}" == "yes" |
michael@157 | 322 | ( cd $RPM_BUILD_ROOT%{l_prefix} |
michael@157 | 323 | %{l_patch} -p0 <%{PATCH squirrelmail.patch.plugins} |
michael@157 | 324 | rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/*.orig |
michael@157 | 325 | rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/gpg/*.orig |
michael@157 | 326 | rm -f $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/*.orig |
michael@157 | 327 | ) || exit $? |
michael@157 | 328 | %endif |
michael@157 | 329 | |
michael@157 | 330 | # install plugin config files |
michael@157 | 331 | ( cd $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins |
michael@157 | 332 | %{l_shtool} subst \ |
michael@157 | 333 | -e 's;../data/access_log;../../../var/squirrelmail/log/access.log;' \ |
michael@157 | 334 | -e 's;\(\$sl_dateformat = \)"m/d/Y G:i:s";\1"d/m/Y G:i:s";' \ |
michael@157 | 335 | squirrel_logger/setup.php |
michael@157 | 336 | %if "%{with_plugins}" == "yes" |
michael@157 | 337 | cp -pf check_quota/config.sample.php check_quota/config.php |
michael@157 | 338 | cp -pf chg_sasl_passwd/config.php.sample chg_sasl_passwd/config.php |
michael@157 | 339 | cp -pf show_user_and_ip/config.php.sample show_user_and_ip/config.php |
michael@157 | 340 | %{l_shtool} install -c -m 644 \ |
michael@157 | 341 | -e "s;sm_logo\.png;opkg_small.png;" \ |
michael@157 | 342 | -e "s;SquirrelMail Logo;OpenPKG Logo;" \ |
michael@157 | 343 | -e "s;www\.squirrelmail\.org;www.openpkg.org;" \ |
michael@157 | 344 | -e "s;\/\/\(\$image_width.*\) = 308;\1 = 201;" \ |
michael@157 | 345 | -e "s;\/\/\(\$image_height.*\) = 111;\1 = 62;" \ |
michael@157 | 346 | addgraphics/config.php.typical.one.domain \ |
michael@157 | 347 | addgraphics/config.php |
michael@157 | 348 | %{l_shtool} install -c -m 644 \ |
michael@157 | 349 | -e 's/^\(\$sieve_preferred_sasl_mech =\).*/\1 "PLAIN LOGIN CRAM-MD5 DIGEST-MD5";/' \ |
michael@157 | 350 | -e 's/^\(\$avelsieve_oldcyrus =\).*/\1 false;/' \ |
michael@157 | 351 | -e 's/^\(\$startitems =\).*/\1 4;/' \ |
michael@157 | 352 | avelsieve/config/config_sample.php \ |
michael@157 | 353 | avelsieve/config/config.php |
michael@157 | 354 | %{l_shtool} subst \ |
michael@157 | 355 | -e 's;\(path_to_gpg=\)/usr/bin/gpg.*;\1%{l_prefix}/bin/gpg;' \ |
michael@157 | 356 | gpg/gpg_local_prefs.txt |
michael@157 | 357 | %{l_shtool} install -c -m 644 \ |
michael@157 | 358 | -e 's;\(adminusername = "\)[^"]*;\1%{l_musr};' \ |
michael@157 | 359 | -e 's;corehide = 1;corehide = 0;' \ |
michael@157 | 360 | pupdate/config.php.sample \ |
michael@157 | 361 | pupdate/config.php |
michael@157 | 362 | %{l_shtool} install -c -m 644 \ |
michael@157 | 363 | -e "s;\(\$vkeyboard_msgsize.*\)'medium';\1'x-small';" \ |
michael@157 | 364 | -e "s;\(\$vkeyboard_layout.*\)'us_english';\1'portuguese_abnt2';" \ |
michael@157 | 365 | -e "s;\(\$vkeyboard_height.*\)'250';\1'270';" \ |
michael@157 | 366 | vkeyboard/config.php.sample \ |
michael@157 | 367 | vkeyboard/config.php |
michael@157 | 368 | cp -pf username/config.php.sample username/config.php |
michael@157 | 369 | %{l_shtool} install -c -m 644 \ |
michael@157 | 370 | %{SOURCE opkg_small.png} \ |
michael@157 | 371 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/ |
michael@157 | 372 | %endif |
michael@157 | 373 | ) || exit $? |
michael@157 | 374 | |
michael@157 | 375 | # install squirrelmail configuration perl script |
michael@157 | 376 | %{l_shtool} install -c -m 755 \ |
michael@157 | 377 | -e 's;chdir($dir);chdir("%{l_prefix}/etc/squirrelmail");g' \ |
michael@157 | 378 | -e 's;\.\./plugins;%{l_prefix}/share/squirrelmail/plugins;g' \ |
michael@157 | 379 | -e 's;\.\./themes;%{l_prefix}/share/squirrelmail/themes;g' \ |
michael@157 | 380 | -e 's;config/config_local.php;config_local.php;g' \ |
michael@157 | 381 | config/conf.pl \ |
michael@157 | 382 | $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf |
michael@157 | 383 | |
michael@157 | 384 | # use our own logo, a squirrel next to a OpenPKG package |
michael@157 | 385 | %{l_shtool} install -c -m 644 \ |
michael@157 | 386 | %{SOURCE opkg_large.png} \ |
michael@157 | 387 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/ |
michael@157 | 388 | ) || exit $? |
michael@157 | 389 | |
michael@157 | 390 | # install runcommand script |
michael@157 | 391 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@157 | 392 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
michael@157 | 393 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@157 | 394 | %{SOURCE rc.squirrelmail} \ |
michael@157 | 395 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@157 | 396 | |
michael@157 | 397 | # replace false /etc config paths throughout |
michael@157 | 398 | %{l_shtool} subst \ |
michael@157 | 399 | -e 's;SM_PATH \. \(.\)config/;\1%{l_prefix}/etc/squirrelmail/;g' \ |
michael@157 | 400 | -e 's;require_once(SM_PATH \. \(.*\)%{l_prefix};require_once(\1%{l_prefix};g' \ |
michael@157 | 401 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.php \ |
michael@157 | 402 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/include/*.php \ |
michael@157 | 403 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/abook_take/*.php \ |
michael@157 | 404 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/administrator/*.php \ |
michael@157 | 405 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/calendar/*.php \ |
michael@157 | 406 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.php |
michael@157 | 407 | |
michael@157 | 408 | # integration into Apache under /webmail |
michael@157 | 409 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@157 | 410 | $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d |
michael@157 | 411 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@157 | 412 | %{SOURCE squirrelmail.conf} \ |
michael@157 | 413 | $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/ |
michael@157 | 414 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@157 | 415 | %{SOURCE index.php} \ |
michael@157 | 416 | $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/ |
michael@157 | 417 | |
michael@157 | 418 | # optional KOLAB configuration |
michael@157 | 419 | %if "%{with_kolab}" == "yes" |
michael@157 | 420 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@157 | 421 | %{SOURCE config_local_kolab.php} \ |
michael@157 | 422 | $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/config_local.php |
michael@157 | 423 | %endif |
michael@157 | 424 | |
michael@157 | 425 | # determine package ingredients and tag config files |
michael@157 | 426 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@157 | 427 | %{l_files_std} \ |
michael@157 | 428 | '%config %{l_prefix}/etc/squirrelmail/*' \ |
michael@157 | 429 | '%config %{l_prefix}/share/squirrelmail/prefs/*' \ |
michael@157 | 430 | '%config %{l_prefix}/share/squirrelmail/plugins/squirrelspell/sqspell_config.php' \ |
michael@157 | 431 | %if "%{with_plugins}" == "yes" |
michael@157 | 432 | '%config %{l_prefix}/share/squirrelmail/plugins/addgraphics/config.php' \ |
michael@157 | 433 | '%config %{l_prefix}/share/squirrelmail/plugins/avelsieve/config/config.php' \ |
michael@157 | 434 | '%config %{l_prefix}/share/squirrelmail/plugins/check_quota/config.php' \ |
michael@157 | 435 | '%config %{l_prefix}/share/squirrelmail/plugins/chg_sasl_passwd/config.php' \ |
michael@157 | 436 | '%config %{l_prefix}/share/squirrelmail/plugins/folder_sizes/folder_sizes.php' \ |
michael@157 | 437 | '%config %{l_prefix}/share/squirrelmail/plugins/gpg/gpg_local_prefs.txt' \ |
michael@157 | 438 | '%config %{l_prefix}/share/squirrelmail/plugins/ldifimport/config.php' \ |
michael@157 | 439 | '%config %{l_prefix}/share/squirrelmail/plugins/pupdate/config.php' \ |
michael@157 | 440 | '%config %{l_prefix}/share/squirrelmail/plugins/show_user_and_ip/config.php' \ |
michael@157 | 441 | '%config %{l_prefix}/share/squirrelmail/plugins/vkeyboard/config.php' \ |
michael@157 | 442 | '%config %{l_prefix}/share/squirrelmail/plugins/username/config.php' \ |
michael@157 | 443 | %endif |
michael@157 | 444 | '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/share/squirrelmail/prefs' \ |
michael@157 | 445 | '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/spool/attach' \ |
michael@157 | 446 | '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/log' |
michael@157 | 447 | |
michael@157 | 448 | %files -f files |
michael@157 | 449 | |
michael@157 | 450 | %clean |
michael@157 | 451 | rm -rf $RPM_BUILD_ROOT |
michael@157 | 452 | |
michael@157 | 453 | %preun |
michael@157 | 454 | # before erase, remove log files |
michael@157 | 455 | [ $1 -eq 0 ] || exit 0 |
michael@157 | 456 | rm -f $RPM_INSTALL_PREFIX/var/squirrelmail/log/*.log >/dev/null 2>&1 || true |
michael@157 | 457 |