sqwebmail.spec.in
上传用户:s81996212
上传日期:2007-01-04
资源大小:722k
文件大小:6k
源码类别:

WEB邮件程序

开发平台:

C/C++

  1. Summary: SqWebMail - Maildir Webmail CGI client.
  2. Name: @PACKAGE@
  3. Version: @VERSION@
  4. Release: 1
  5. Copyright: GPL
  6. Packager: %{PACKAGER}
  7. Group: Applications/Mail
  8. Source: http://www.inter7.com/sqwebmail/@PACKAGE@-@VERSION@.tar.gz
  9. Url: http://www.inter7.com/sqwebmail/
  10. BuildRoot: /tmp/sqwebmail-install
  11. Requires: /sbin/chkconfig
  12. %description
  13. SqWebMail is a Webmail CGI for Maildir mailboxes.
  14. %define cgibindir /home/httpd/cgi-bin
  15. %define imagedir /home/httpd/html/webmail
  16. %define imageurl /webmail/
  17. %define htmllibdir /usr/local/share/sqwebmail
  18. %define cachedir /var/cache/sqwebmail
  19. %define _libexecdir /usr/libexec/sqwebmail
  20. %prep
  21. %setup
  22. %configure --with-htmllibdir=%{htmllibdir} --with-cachedir=%{cachedir} 
  23. --enable-webpass=vpopmail --libexecdir=%{_libexecdir} 
  24. --enable-cgibindir=/home/httpd/cgi-bin 
  25. --enable-imagedir=/home/httpd/html/webmail 
  26. --enable-imageurl=/webmail/
  27. %build
  28. make
  29. make check
  30. %install
  31. rm -rf $RPM_BUILD_ROOT
  32. make install-strip DESTDIR=$RPM_BUILD_ROOT
  33. mkdir -p $RPM_BUILD_ROOT/etc/pam.d
  34. /usr/bin/install -m0444 sqwebmail/sqwebmail.pamconf $RPM_BUILD_ROOT/etc/pam.d/webmail
  35. mkdir -p $RPM_BUILD_ROOT/etc/cron.hourly
  36. cat >$RPM_BUILD_ROOT/etc/cron.hourly/sqwebmail-cron-cleancache <<EOF
  37. #!/bin/sh
  38. su - bin -c %{htmllibdir}/cleancache.pl
  39. EOF
  40. #
  41. # Red Hat /etc/profile.d scripts
  42. #
  43. mkdir -p $RPM_BUILD_ROOT/etc/profile.d
  44. cat >$RPM_BUILD_ROOT/etc/profile.d/sqwebmail.sh <<EOF
  45. if echo "$MANPATH" | tr ':' '12' | fgrep -qx %{htmllibdir}/sbin
  46. then
  47. :
  48. else
  49. MANPATH="%{htmllibdir}/man:$MANPATH"
  50. export MANPATH
  51. if test -w /etc
  52. then
  53. PATH="%{htmllibdir}/sbin:$PATH"
  54. fi
  55. export PATH
  56. fi
  57. EOF
  58. cat >$RPM_BUILD_ROOT/etc/profile.d/sqwebmail.csh <<EOF
  59. if ( $?MANPATH ) then
  60. true
  61. else
  62. setenv MANPATH ""
  63. endif
  64. echo "$MANPATH" | tr ':' '12' | fgrep -qx %{htmllibdir}/sbin
  65. if ( $? ) then
  66. true
  67. else
  68. setenv MANPATH "%{htmllibdir}/man:$MANPATH"
  69. test -w /etc
  70. if ( $? ) then
  71. true
  72.         else
  73. setenv PATH "%{htmllibdir}/sbin:$PATH"
  74. endif
  75. endif
  76. EOF
  77. #
  78. # Compress everything in man
  79. #
  80. find $RPM_BUILD_ROOT%{htmllibdir}/man ! -type d -print | perl -e '
  81. while (<>)
  82. {
  83. chop if /n$/;
  84. next unless /.[0-9]$/;
  85. $file=$_;
  86. if ( -l $file)
  87. {
  88. unlink("$file.gz");
  89. $link=readlink($file) || exit 1;
  90.                         (symlink "$link.gz", "$file.gz") || exit 1;
  91. unlink($file);
  92.                 }
  93.                 else
  94.                 {
  95.                         system("gzip <$file >$file.gz") && exit 1;
  96. unlink($file);
  97. }
  98. }
  99. '
  100. >filelist
  101. if test -f $RPM_BUILD_ROOT%{htmllibdir}/authldaprc
  102. then
  103. echo '%attr(600, root, root) %config %{htmllibdir}/authldaprc' >>filelist
  104. fi
  105. if test -f $RPM_BUILD_ROOT%{htmllibdir}/authmysqlrc
  106. then
  107. echo '%attr(600, root, root) %config %{htmllibdir}/authmysqlrc' >>filelist
  108. fi
  109. . authlib/authdaemonrc
  110. if test "$authdaemonvar" != ""
  111. then
  112. echo '%attr(755, bin, bin) /etc/rc.d/init.d/sqwebmail' >>filelist
  113. echo '%dir %attr(700, root, root) ' $authdaemonvar >>filelist
  114. echo '%config %attr(600, root, root) %{htmllibdir}/authdaemonrc' >>filelist
  115. touch $RPM_BUILD_ROOT/$authdaemonvar/lock || exit 1
  116. touch $RPM_BUILD_ROOT/$authdaemonvar/pid || exit 1
  117. authlib/authmksock $RPM_BUILD_ROOT/$authdaemonvar/socket || exit 1
  118. chmod 777 $RPM_BUILD_ROOT/$authdaemonvar/socket || exit 1
  119. echo '%ghost %attr(600, root, root) ' $authdaemonvar/lock >>filelist
  120. echo '%ghost %attr(644, root, root) ' $authdaemonvar/pid >>filelist
  121. echo '%ghost %attr(-, root, root) ' $authdaemonvar/socket >>filelist
  122. #
  123. # Red Hat init.d file
  124. #
  125. mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
  126. cat >$RPM_BUILD_ROOT/etc/rc.d/init.d/sqwebmail <<EOF
  127. #!/bin/sh
  128. #
  129. # chkconfig: 2345 50 50
  130. # description: Start authdaemon daemon for SqWebMail
  131. #
  132. #
  133. #
  134. case "$1" in
  135. start)
  136.         cd /
  137. touch /var/lock/subsys/sqwebmail
  138. echo -n "Starting SqWebMail authentication daemon:"
  139. %{_libexecdir}/authlib/authdaemond start
  140. echo " authdaemon"
  141. ;;
  142. stop)
  143. echo -n "Stopping SqWebMail authentication daemon:"
  144. %{_libexecdir}/authlib/authdaemond stop
  145. echo " authdaemon"
  146. ;;
  147. restart)
  148. echo -n "Restarting SqWebMail authentication daemon:"
  149. %{_libexecdir}/authlib/authdaemond restart
  150. echo " authdaemon"
  151.         ;;
  152. esac
  153. exit 0
  154. EOF
  155. fi
  156. %post
  157. test -d %{htmllibdir}/html/en || ln -fs en-us %{htmllibdir}/html/en
  158. if test -f /etc/rc.d/init.d/sqwebmail
  159. then
  160. /sbin/chkconfig --del sqwebmail
  161. /sbin/chkconfig --add sqwebmail
  162. fi
  163. %preun
  164. if test "$1" = "0"
  165. then
  166. if test -f /etc/rc.d/init.d/sqwebmail
  167. then
  168. /sbin/chkconfig --del sqwebmail
  169. fi
  170. fi
  171. %postun
  172. test -d %{htmllibdir}/html/en || rm -f %{htmllibdir}/html/en
  173. %files -f filelist
  174. %attr(06555, root, mail) %{cgibindir}
  175. %attr(755, bin, bin) %dir %{imagedir}
  176. %attr(444, bin, bin) %{imagedir}/*
  177. %attr(555, bin, bin) %dir %{htmllibdir}
  178. %attr(755, root, bin) %config %{htmllibdir}/sendit.sh
  179. %attr(755, root, bin) %config %{htmllibdir}/ldapsearch
  180. %attr(644, root, bin) %config %{htmllibdir}/ldapaddressbook
  181. %attr(755, root, bin) %config %{htmllibdir}/authmodulelist
  182. %attr(755, bin, bin) %{htmllibdir}/cleancache.pl
  183. %attr(755, bin, bin) /etc/cron.hourly/sqwebmail-cron-cleancache
  184. %attr(700, bin, bin) %dir %{cachedir}
  185. %attr(644, root, bin) %config /etc/pam.d/webmail
  186. %attr(755, root, bin) %dir %{htmllibdir}/html
  187. %attr(-, root, bin) %{htmllibdir}/html/en-us
  188. %attr(-, root, bin) %{htmllibdir}/sbin
  189. %attr(-, root, bin) %{htmllibdir}/man
  190. %attr(-, root, bin) %{_libexecdir}
  191. %attr(755, bin, bin) /etc/profile.d/sqwebmail.sh
  192. %attr(755, bin, bin) /etc/profile.d/sqwebmail.csh
  193. %attr(-, bin, bin) %doc AUTHORS sqwebmail/BUGS COPYING INSTALL INSTALL.vchkpw NEWS README sqwebmail/SECURITY sqwebmail/TODO
  194. %attr(-, bin, bin) %doc sqwebmail/BUGS.html INSTALL.html NEWS.html README.html sqwebmail/SECURITY.html sqwebmail/TODO.html sqwebmail/ChangeLog
  195. %attr(-, bin, bin) %doc maildir/README*.html
  196. %clean
  197. rm -rf $RPM_BUILD_ROOT