squirrelmail.spec 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. ##
  2. # $Id$
  3. %define spec_release 1
  4. ##
  5. # Rebuild with:
  6. # rpmbuild --rebuild --define 'rhl7 1' squirrelmail-1.4.x.src.rpm
  7. # to build for rhl7.
  8. %{!?rhl7:%define rhl7 0}
  9. %if %{rhl7}
  10. %define webserver apache
  11. %define rpm_release %{spec_release}.7.x
  12. %else
  13. %define webserver httpd
  14. %define rpm_release %{spec_release}
  15. %endif
  16. Summary: SquirrelMail webmail client
  17. Name: squirrelmail
  18. Version: 1.4.0
  19. Release: %{rpm_release}
  20. License: GPL
  21. URL: http://www.squirrelmail.org/
  22. Vendor: squirrelmail.org
  23. Group: Applications/Internet
  24. Source: %{name}-%{version}.tar.bz2
  25. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  26. BuildArch: noarch
  27. Requires: %{webserver}, php >= 4.0.4, perl, tmpwatch >= 2.8, aspell
  28. Requires: /usr/sbin/sendmail
  29. Prereq: %{webserver}, perl
  30. BuildPrereq: perl
  31. %description
  32. SquirrelMail is a standards-based webmail package written in PHP4. It
  33. includes built-in pure PHP support for the IMAP and SMTP protocols, and
  34. all pages render in pure HTML 4.0 (with no Javascript) for maximum
  35. compatibility across browsers. It has very few requirements and is very
  36. easy to configure and install. SquirrelMail has all the functionality
  37. you would want from an email client, including strong MIME support,
  38. address books, and folder manipulation.
  39. %prep
  40. %setup -q
  41. %{__rm} -f plugins/make_archive.pl
  42. # Rearrange the documentation
  43. %{__mv} AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/
  44. %{__mv} ReleaseNotes doc/ReleaseNotes.txt
  45. %{__mv} themes/README.themes doc/
  46. for f in `find plugins -name "README*" -or -name INSTALL \
  47. -or -name CHANGES -or -name HISTORY`; do
  48. %{__mkdir_p} doc/`dirname $f`
  49. %{__mv} $f $_
  50. done
  51. %{__mv} doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell
  52. %{__rm} -rf doc/plugins/squirrelspell/doc
  53. %{__mv} plugins/squirrelspell/doc/* doc/plugins/squirrelspell
  54. %{__rm} -f doc/plugins/squirrelspell/index.php
  55. %{__rm} -rf plugins/squirrelspell/doc
  56. # Fixup various files
  57. echo "left_refresh=300" >> data/default_pref
  58. for f in contrib/RPM/squirrelmail.cron contrib/RPM/config.php.redhat; do
  59. %{__perl} -pi \
  60. -e "s|__ATTDIR__|%{_localstatedir}/spool/squirrelmail/attach/|g;" \
  61. -e "s|__PREFSDIR__|%{_localstatedir}/lib/squirrelmail/prefs/|g;" $f
  62. done
  63. # Fix the version
  64. %{__perl} -pi -e "s|^(\s*\\\$version\s*=\s*).*|\1'%{version}-%{release}';|g"\
  65. functions/strings.php
  66. %install
  67. rm -rf %{buildroot}
  68. %{__mkdir_p} -m 755 %{buildroot}%{_sysconfdir}/squirrelmail
  69. %{__mkdir_p} -m 755 %{buildroot}%{_localstatedir}/lib/squirrelmail/prefs
  70. %{__mkdir_p} -m 755 %{buildroot}%{_localstatedir}/spool/squirrelmail/attach
  71. %{__mkdir_p} -m 755 %{buildroot}%{_datadir}/squirrelmail
  72. # install default_pref
  73. %{__install} -m 644 data/default_pref \
  74. %{buildroot}%{_localstatedir}/lib/squirrelmail/prefs/
  75. # install the config files
  76. %{__mkdir_p} -m 755 %{buildroot}%{_datadir}/squirrelmail/config
  77. %{__install} -m 644 contrib/RPM/config.php.redhat \
  78. %{buildroot}%{_sysconfdir}/squirrelmail/config.php
  79. %{__ln_s} %{_sysconfdir}/squirrelmail/config.php \
  80. %{buildroot}%{_datadir}/squirrelmail/config/config.php
  81. %{__install} -m 644 config/config_local.php \
  82. %{buildroot}%{_sysconfdir}/squirrelmail/config_local.php
  83. %{__ln_s} %{_sysconfdir}/squirrelmail/config_local.php \
  84. %{buildroot}%{_datadir}/squirrelmail/config/config_local.php
  85. %{__rm} -f config/config_local.php config/config.php
  86. %{__install} -m 644 config/*.php %{buildroot}%{_datadir}/squirrelmail/config/
  87. %{__install} -m 755 config/*.pl %{buildroot}%{_datadir}/squirrelmail/config/
  88. # install index.php
  89. %{__install} -m 644 index.php %{buildroot}%{_datadir}/squirrelmail/
  90. # Copy over the rest
  91. for DIR in class functions help images include locale plugins src themes; do
  92. %{__cp} -rp $DIR %{buildroot}%{_datadir}/squirrelmail/
  93. done
  94. # install the cron script
  95. %{__mkdir_p} -m 755 %{buildroot}%{_sysconfdir}/cron.daily
  96. %{__install} -m 755 contrib/RPM/squirrelmail.cron \
  97. %{buildroot}/%{_sysconfdir}/cron.daily/
  98. %if %{rhl7}
  99. # symlink from /var/www/html/webmail to /usr/share/squirrelmail
  100. %{__mkdir_p} -m 755 %{buildroot}/var/www/html
  101. %{__ln_s} %{_datadir}/squirrelmail %{buildroot}/var/www/html/webmail
  102. %else
  103. # install the config file
  104. %{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d
  105. %{__install} -m 644 contrib/RPM/squirrelmail.conf \
  106. %{buildroot}%{_sysconfdir}/httpd/conf.d/
  107. %endif
  108. %clean
  109. %{__rm} -rf %{buildroot}
  110. %files
  111. %defattr(-,root,root)
  112. %config %dir %{_sysconfdir}/squirrelmail
  113. %config(noreplace) %{_sysconfdir}/squirrelmail/*
  114. %if %{rhl7}
  115. /var/www/html/webmail
  116. %else
  117. %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
  118. %endif
  119. %doc doc/*
  120. %dir %{_datadir}/squirrelmail
  121. %{_datadir}/squirrelmail/index.php
  122. %{_datadir}/squirrelmail/class
  123. %{_datadir}/squirrelmail/functions
  124. %{_datadir}/squirrelmail/help
  125. %{_datadir}/squirrelmail/images
  126. %{_datadir}/squirrelmail/include
  127. %{_datadir}/squirrelmail/locale
  128. %{_datadir}/squirrelmail/src
  129. %{_datadir}/squirrelmail/themes
  130. %{_datadir}/squirrelmail/config
  131. %dir %{_datadir}/squirrelmail/plugins
  132. %{_datadir}/squirrelmail/plugins/*
  133. %dir %{_localstatedir}/lib/squirrelmail
  134. %dir %{_localstatedir}/spool/squirrelmail
  135. %attr(0770, root, apache) %dir %{_localstatedir}/lib/squirrelmail/prefs
  136. %attr(0730, root, apache) %dir %{_localstatedir}/spool/squirrelmail/attach
  137. %{_localstatedir}/lib/squirrelmail/prefs/default_pref
  138. %{_sysconfdir}/cron.daily/squirrelmail.cron
  139. %changelog
  140. * Tue Mar 26 2003 Konstantin Riabitsev <icon@duke.edu> 1.4.0-1
  141. - Build for 1.4.0
  142. * Thu Feb 13 2003 Konstantin Riabitsev <icon@duke.edu> 1.4.0-0.2pre
  143. - Initial release for 1.4.0 prerelease
  144. * Tue Feb 04 2003 Konstantin Riabitsev <icon@duke.edu> 1.2.11-1
  145. - Upping version number.
  146. * Tue Oct 29 2002 Konstantin Riabitsev <icon@duke.edu> 1.2.9-1
  147. - Upping version number.
  148. * Sat Sep 14 2002 Konstantin Riabitsev <icon@duke.edu> 1.2.8-1
  149. - adopted RH's spec file so we don't duplicate effort.
  150. - Removed rh'ized splash screen.
  151. - Adding fallbacks for building rhl7 version as well with the same
  152. specfile. Makes the spec file not as clean, but hey.
  153. - remove workarounds for #68669 (rh bugzilla), since 1.2.8 works with
  154. register_globals = Off.
  155. - Hardwiring localhost into the default config file. Makes sense.
  156. - No more such file MIRRORS.
  157. - Adding aspell as one of the req's, since squirrelspell is enabled by
  158. default
  159. - Added Vendor: line to distinguish ourselves from RH.
  160. - Doing the uglies with the release numbers.
  161. * Tue Aug 6 2002 Preston Brown <pbrown@redhat.com> 1.2.7-4
  162. - replacement splash screen.
  163. * Mon Jul 22 2002 Gary Benson <gbenson@redhat.com> 1.2.7-3
  164. - get rid of long lines in the specfile.
  165. - remove symlink in docroot and use an alias in conf.d instead.
  166. - work with register_globals off (#68669)
  167. * Tue Jul 09 2002 Gary Benson <gbenson@redhat.com> 1.2.7-2
  168. - hardwire the hostname (well, localhost) into the config file (#67635)
  169. * Mon Jun 24 2002 Gary Benson <gbenson@redhat.com> 1.2.7-1
  170. - hardwire the locations into the config file and cron file.
  171. - install squirrelmail-cleanup.cron as squirrelmail.cron.
  172. - make symlinks relative.
  173. - upgrade to 1.2.7.
  174. - more dependency fixes.
  175. * Fri Jun 21 2002 Gary Benson <gbenson@redhat.com>
  176. - summarize the summary, fix deps, and remove some redundant stuff.
  177. - tidy up the prep section.
  178. - replace directory definitions with standard RHL ones.
  179. * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 1.2.6-3
  180. - automated rebuild
  181. * Wed Jun 19 2002 Preston Brown <pbrown@redhat.com> 1.2.6-2
  182. - adopted Konstantin Riabitsev <icon@duke.edu>'s package for Red Hat
  183. Linux. Nice job Konstantin!