squirrelmail.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. ##
  2. ## squirrelmail.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_sqmail 1.4.4
  27. %define V_locale 20050308
  28. %define V_plugin_compat 1.3
  29. %define V_plugin_addgraphics 2.3-1.0.3
  30. %define V_plugin_saslpwd 1.4.1-1.4
  31. %define V_plugin_checkquota 1.4-1.2.7
  32. %define V_plugin_foldersize 1.4-1.4
  33. %define V_plugin_gnupg 2.0.1-1.4.2
  34. %define V_plugin_ldif 1.4-1.2.x
  35. %define V_plugin_update 0.7-1.4.2
  36. %define V_plugin_userip 3.2-1.2.2
  37. %define V_plugin_smallcal 0.8-1.2.3
  38. %define V_plugin_vkeyboard 0.8
  39. # package information
  40. Name: squirrelmail
  41. Summary: SquirrelMail Webmail Client
  42. URL: http://www.squirrelmail.org/
  43. Vendor: Squirrelmail Developers
  44. Packager: The OpenPKG Project
  45. Distribution: OpenPKG
  46. Class: EVAL
  47. Group: Mail
  48. License: GPL
  49. Version: %{V_sqmail}
  50. Release: 20050316
  51. # package options
  52. %option with_plugins no
  53. # list of sources
  54. Source0: http://osdn.dl.sourceforge.net/squirrelmail/squirrelmail-%{version}.tar.bz2
  55. Source1: http://osdn.dl.sourceforge.net/squirrelmail/all_locales-%{V_sqmail}-%{V_locale}.tar.bz2
  56. Source2: http://www.squirrelmail.org/plugins/compatibility-%{V_plugin_compat}.tar.gz
  57. Source3: http://www.squirrelmail.org/plugins/addgraphics-%{V_plugin_addgraphics}.tar.gz
  58. Source4: http://www.squirrelmail.org/plugins/chg_sasl_passwd-%{V_plugin_saslpwd}.tar.gz
  59. Source5: http://www.squirrelmail.org/plugins/check_quota-%{V_plugin_checkquota}.tar.gz
  60. Source6: http://www.squirrelmail.org/plugins/folder_sizes.%{V_plugin_foldersize}.tar.gz
  61. Source7: http://www.squirrelmail.org/plugins/gpg.%{V_plugin_gnupg}.tar.gz
  62. Source8: http://www.squirrelmail.org/plugins/ldifimport-%{V_plugin_ldif}.tar.gz
  63. Source9: http://www.squirrelmail.org/plugins/pupdate.%{V_plugin_update}.tar.gz
  64. Source10: http://www.squirrelmail.org/plugins/show_user_and_ip-%{V_plugin_userip}.tar.gz
  65. Source11: http://www.squirrelmail.org/plugins/smallcal-%{V_plugin_smallcal}.tar.gz
  66. Source12: http://www.squirrelmail.org/plugins/vkeyboard-%{V_plugin_vkeyboard}.tar.gz
  67. Source13: opkg_large.png
  68. Source14: opkg_small.png
  69. Source15: config.php
  70. Patch0: squirrelmail.patch
  71. Patch1: squirrelmail.patch.plugins
  72. # build information
  73. Prefix: %{l_prefix}
  74. BuildRoot: %{l_buildroot}
  75. BuildPreReq: OpenPKG, openpkg >= 20040130
  76. PreReq: OpenPKG, openpkg >= 20040130, imapd, MTA, apache
  77. PreReq: apache::with_mod_php = yes, apache::with_mod_php_xml = yes
  78. AutoReq: no
  79. AutoReqProv: no
  80. %description
  81. SquirrelMail is a standards-based webmail package written in
  82. PHP4. It includes built-in pure PHP support for the IMAP and
  83. SMTP protocols, and all pages render in pure HTML 4.0 (with no
  84. Javascript) for maximum compatibility across browsers. It has
  85. very few requirements and is very easy to configure and install.
  86. SquirrelMail has all the functionality you would want from an email
  87. client, including strong MIME support, address books, and folder
  88. manipulation.
  89. %track
  90. prog squirrelmail = {
  91. comment = "ms: 1.5.x is the development trunk, so do not update past 1.4.x"
  92. version = %{version}
  93. url = http://prdownloads.sourceforge.net/squirrelmail/
  94. regex = squirrelmail-(__VER__)\.tar\.bz2
  95. }
  96. prog squirrelmail:locales = {
  97. comment = "ms: 1.5.x is the development trunk, so do not update past 1.4.x"
  98. version = %{V_sqmail}-%{V_locale}
  99. url = http://prdownloads.sourceforge.net/squirrelmail/
  100. regex = all_locales-(__VER__)\.tar\.bz2
  101. }
  102. prog squirrelmail:compat = {
  103. version = %{V_plugin_compat}
  104. url = http://www.squirrelmail.org/plugins/
  105. regex = compatibility-(__VER__)\.tar\.gz
  106. }
  107. prog squirrelmail:addgraphics = {
  108. version = %{V_plugin_addgraphics}
  109. url = http://www.squirrelmail.org/plugins/
  110. regex = addgraphics-(__VER__)\.tar\.gz
  111. }
  112. prog squirrelmail:saslpwd = {
  113. version = %{V_plugin_saslpwd}
  114. url = http://www.squirrelmail.org/plugins/
  115. regex = chg_sasl_passwd-(__VER__)\.tar\.gz
  116. }
  117. prog squirrelmail:checkquota = {
  118. version = %{V_plugin_checkquota}
  119. url = http://www.squirrelmail.org/plugins/
  120. regex = check_quota-(__VER__)\.tar\.gz
  121. }
  122. prog squirrelmail:foldersize = {
  123. version = %{V_plugin_foldersize}
  124. url = http://www.squirrelmail.org/plugins/
  125. regex = folder_sizes.(__VER__)\.tar\.gz
  126. }
  127. prog squirrelmail:gnupg = {
  128. version = %{V_plugin_gnupg}
  129. url = http://www.squirrelmail.org/plugins/
  130. regex = gpg.(__VER__)\.tar\.gz
  131. }
  132. prog squirrelmail:ldif = {
  133. version = %{V_plugin_ldif}
  134. url = http://www.squirrelmail.org/plugins/
  135. regex = ldifimport-(__VER__)\.tar\.gz
  136. }
  137. prog squirrelmail:update = {
  138. version = %{V_plugin_update}
  139. url = http://www.squirrelmail.org/plugins/
  140. regex = pupdate.(__VER__)\.tar\.gz
  141. }
  142. prog squirrelmail:userip = {
  143. version = %{V_plugin_userip}
  144. url = http://www.squirrelmail.org/plugins/
  145. regex = show_user_and_ip-(__VER__)\.tar\.gz
  146. }
  147. prog squirrelmail:smallcal = {
  148. version = %{V_plugin_smallcal}
  149. url = http://www.squirrelmail.org/plugins/
  150. regex = smallcal-(__VER__)\.tar\.gz
  151. }
  152. prog squirrelmail:vkeyboard = {
  153. version = %{V_plugin_vkeyboard}
  154. url = http://www.squirrelmail.org/plugins/
  155. regex = vkeyboard-(__VER__)\.tar\.gz
  156. }
  157. %prep
  158. %setup -q -c -n squirrelmail
  159. %setup -q -D -T -a 1 -c -n squirrelmail/all_locales-%{V_sqmail}-%{V_locale}
  160. %if "%{with_plugins}" == "yes"
  161. %setup -q -D -T -a 2 -n squirrelmail
  162. %setup -q -D -T -a 3 -n squirrelmail
  163. %setup -q -D -T -a 4 -n squirrelmail
  164. %setup -q -D -T -a 5 -n squirrelmail
  165. %setup -q -D -T -a 6 -n squirrelmail
  166. %setup -q -D -T -a 7 -n squirrelmail
  167. %setup -q -D -T -a 8 -n squirrelmail
  168. %setup -q -D -T -a 9 -n squirrelmail
  169. %setup -q -D -T -a 10 -n squirrelmail
  170. %setup -q -D -T -a 11 -n squirrelmail
  171. %setup -q -D -T -a 12 -n squirrelmail
  172. # move additional plugins where other are already placed
  173. for plug in addgraphics check_quota chg_sasl_passwd compatibility \
  174. folder_sizes gpg ldifimport pupdate show_user_and_ip \
  175. smallcal vkeyboard; do
  176. mv $plug squirrelmail-%{V_sqmail}/plugins
  177. done
  178. %endif
  179. # clean up login screen of distractions
  180. ( cd %{l_tmpdir}/squirrelmail/squirrelmail-%{V_sqmail}
  181. %patch -p0
  182. ) || exit $?
  183. # rearrange documentation and remove archive script
  184. ( cd %{l_tmpdir}/squirrelmail/squirrelmail-%{V_sqmail}
  185. mv AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/
  186. mv ReleaseNotes doc/ReleaseNotes.txt
  187. mv themes/README.themes doc/
  188. for fil in `find plugins/ -name "README*" -o -name "Readme*" \
  189. -o -name INSTALL -o -name CHANGES -o -name HISTORY`; do
  190. %{l_shtool} mkdir -f -p -m 755 doc/`dirname $fil`
  191. mv -f $fil $_
  192. done
  193. mv doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell
  194. rm -rf doc/plugins/squirrelspell/doc doc/plugins/squirrelspell/index.php
  195. mv plugins/squirrelspell/doc/* doc/plugins/squirrelspell
  196. rm -rf plugins/squirrelspell/doc
  197. rm -f plugins/make_archive.pl
  198. %if "%{with_plugins}" == "yes"
  199. mv plugins/pupdate/docs/* doc/plugins/pupdate
  200. rm -rf plugins/pupdate/docs
  201. %endif
  202. # set default prefs
  203. echo "left_refresh=300" >>data/default_pref
  204. echo "hour_format=1" >>data/default_pref
  205. echo "reply_citation_style=author_said" >>data/default_pref
  206. ) || exit $?
  207. %build
  208. %install
  209. rm -rf $RPM_BUILD_ROOT
  210. # create directory structure
  211. %{l_shtool} mkdir -f -p -m 755 \
  212. $RPM_BUILD_ROOT%{l_prefix}/bin \
  213. $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail \
  214. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs \
  215. $RPM_BUILD_ROOT%{l_prefix}/var/squirrelmail/spool/attach
  216. # install locales
  217. ( cd %{l_tmpdir}/squirrelmail/all_locales-%{V_sqmail}-%{V_locale}
  218. cp -rpf help images locale $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
  219. ) || exit $?
  220. # install program
  221. ( cd %{l_tmpdir}/squirrelmail/squirrelmail-%{V_sqmail}
  222. # install default_pref
  223. %{l_shtool} install -c -m 644 \
  224. data/default_pref \
  225. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/prefs/
  226. # create initial administrator list
  227. echo %{l_musr} >>$RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/admins
  228. # install main index file to view in client browser
  229. %{l_shtool} install -c -m 644 \
  230. index.php \
  231. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
  232. # copy over most functional directories, a lot of stuff
  233. for dir in class functions include plugins src themes; do
  234. cp -rpf $dir $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
  235. done
  236. cp -rpf images/* $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
  237. cp -pf locale/timezones.cfg $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/locale/
  238. # install main config files
  239. l_fqdm=`%{l_shtool} echo -e %h%d`
  240. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  241. -e 's;config/\(config_local.php\);\1;g' \
  242. -e "s;@l_fqdm@;${l_fqdm};g" \
  243. %{SOURCE config.php} \
  244. config/config_default.php \
  245. $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail/
  246. %if "%{with_plugins}" == "yes"
  247. ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/squirrelmail
  248. %{l_patch} -p0 <%{PATCH squirrelmail.patch.plugins}
  249. rm -f *.orig
  250. ) || exit $?
  251. %endif
  252. %{l_shtool} install -c -m 644 \
  253. config/config_local.php \
  254. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/
  255. # install plugin config files
  256. %if "%{with_plugins}" == "yes"
  257. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins
  258. cp -pf check_quota/config.php.sample check_quota/config.php
  259. cp -pf chg_sasl_passwd/config.php.sample chg_sasl_passwd/config.php
  260. cp -pf show_user_and_ip/config.php.sample show_user_and_ip/config.php
  261. %{l_shtool} install -c -m 644 \
  262. -e "s;\(\$vkeyboard_msgsize.*\)'medium';\1'xx-small';" \
  263. -e "s;\(\$vkeyboard_layout.*\)'us_english';\1'portuguese_abnt2';" \
  264. -e "s;\(\$vkeyboard_height.*\)'250';\1'270';" \
  265. vkeyboard/config.php.sample \
  266. vkeyboard/config.php
  267. %{l_shtool} install -c -m 644 \
  268. -e "s;sm_logo\.png;opkg_small.png;" \
  269. -e "s;SquirrelMail Logo;OpenPKG Logo;" \
  270. -e "s;www\.squirrelmail\.org;www.openpkg.org;" \
  271. -e "s;\($image_width.*\) = 308;\1 = 208;" \
  272. -e "s;\($image_height.*\) = 111;\1 = 66;" \
  273. addgraphics/config.php.typical.one.domain \
  274. addgraphics/config.php
  275. %{l_shtool} install -c -m 644 \
  276. %{SOURCE opkg_small.png} \
  277. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
  278. ) || exit $?
  279. %endif
  280. # install squirrelmail configuration perl script
  281. %{l_shtool} install -c -m 755 \
  282. -e 's;chdir($dir);chdir("%{l_prefix}/etc/squirrelmail");g' \
  283. -e 's;\.\./plugins;%{l_prefix}/share/squirrelmail/plugins;g' \
  284. -e 's;\.\./themes;%{l_prefix}/share/squirrelmail/themes;g' \
  285. -e 's;config/config_local.php;config_local.php;g' \
  286. config/conf.pl \
  287. $RPM_BUILD_ROOT%{l_prefix}/bin/squirrelconf
  288. # use our own logo, a squirrel next to a OpenPKG package
  289. %{l_shtool} install -c -m 644 \
  290. %{SOURCE opkg_large.png} \
  291. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/images/
  292. ) || exit $?
  293. # replace false /etc config paths throughout
  294. %{l_shtool} subst \
  295. -e 's;SM_PATH \. \(.\)config/;\1%{l_prefix}/etc/squirrelmail/;g' \
  296. -e 's;require_once(SM_PATH \. \(.*\)%{l_prefix};require_once(\1%{l_prefix};g' \
  297. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/functions/*.php \
  298. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/include/*.php \
  299. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/abook_take/*.php \
  300. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/administrator/*.php \
  301. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/plugins/calendar/*.php \
  302. $RPM_BUILD_ROOT%{l_prefix}/share/squirrelmail/src/*.php
  303. # determine package ingredients and tag config files
  304. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  305. %{l_files_std} \
  306. '%config %{l_prefix}/etc/squirrelmail/*' \
  307. '%config %{l_prefix}/share/squirrelmail/prefs/*' \
  308. %if "%{with_plugins}" == "yes"
  309. '%config %{l_prefix}/share/squirrelmail/plugins/check_quota/config.php' \
  310. '%config %{l_prefix}/share/squirrelmail/plugins/ldifimport/config.php' \
  311. '%config %{l_prefix}/share/squirrelmail/plugins/show_user_and_ip/config.php' \
  312. '%config %{l_prefix}/share/squirrelmail/plugins/vkeyboard/config.php' \
  313. %endif
  314. '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/share/squirrelmail/prefs' \
  315. '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/squirrelmail/spool/attach'
  316. %files -f files
  317. %clean
  318. rm -rf $RPM_BUILD_ROOT