sqwebmail.spec
上传用户:s81996212
上传日期:2007-01-04
资源大小:722k
文件大小:6k
- Summary: SqWebMail - Maildir Webmail CGI client.
- Name: sqwebmail
- Version: 0.37a.38pre2
- Release: 1
- Copyright: GPL
- Packager: %{PACKAGER}
- Group: Applications/Mail
- Source: http://www.inter7.com/sqwebmail/sqwebmail-0.37a.38pre2.tar.gz
- Url: http://www.inter7.com/sqwebmail/
- BuildRoot: /tmp/sqwebmail-install
- Requires: /sbin/chkconfig
- %description
- SqWebMail is a Webmail CGI for Maildir mailboxes.
- %define cgibindir /home/httpd/cgi-bin
- %define imagedir /home/httpd/html/webmail
- %define imageurl /webmail/
- %define htmllibdir /usr/local/share/sqwebmail
- %define cachedir /var/cache/sqwebmail
- %define _libexecdir /usr/libexec/sqwebmail
- %prep
- %setup
- %configure --with-htmllibdir=%{htmllibdir} --with-cachedir=%{cachedir}
- --enable-webpass=vpopmail --libexecdir=%{_libexecdir}
- --enable-cgibindir=/home/httpd/cgi-bin
- --enable-imagedir=/home/httpd/html/webmail
- --enable-imageurl=/webmail/
- %build
- make
- make check
- %install
- rm -rf $RPM_BUILD_ROOT
- make install-strip DESTDIR=$RPM_BUILD_ROOT
- mkdir -p $RPM_BUILD_ROOT/etc/pam.d
- /usr/bin/install -m0444 sqwebmail/sqwebmail.pamconf $RPM_BUILD_ROOT/etc/pam.d/webmail
- mkdir -p $RPM_BUILD_ROOT/etc/cron.hourly
- cat >$RPM_BUILD_ROOT/etc/cron.hourly/sqwebmail-cron-cleancache <<EOF
- #!/bin/sh
- su - bin -c %{htmllibdir}/cleancache.pl
- EOF
- #
- # Red Hat /etc/profile.d scripts
- #
- mkdir -p $RPM_BUILD_ROOT/etc/profile.d
- cat >$RPM_BUILD_ROOT/etc/profile.d/sqwebmail.sh <<EOF
- if echo "$MANPATH" | tr ':' ' 12' | fgrep -qx %{htmllibdir}/sbin
- then
- :
- else
- MANPATH="%{htmllibdir}/man:$MANPATH"
- export MANPATH
- if test -w /etc
- then
- PATH="%{htmllibdir}/sbin:$PATH"
- fi
- export PATH
- fi
- EOF
- cat >$RPM_BUILD_ROOT/etc/profile.d/sqwebmail.csh <<EOF
- if ( $?MANPATH ) then
- true
- else
- setenv MANPATH ""
- endif
- echo "$MANPATH" | tr ':' ' 12' | fgrep -qx %{htmllibdir}/sbin
- if ( $? ) then
- true
- else
- setenv MANPATH "%{htmllibdir}/man:$MANPATH"
- test -w /etc
- if ( $? ) then
- true
- else
- setenv PATH "%{htmllibdir}/sbin:$PATH"
- endif
- endif
- EOF
- #
- # Compress everything in man
- #
- find $RPM_BUILD_ROOT%{htmllibdir}/man ! -type d -print | perl -e '
- while (<>)
- {
- chop if /n$/;
- next unless /.[0-9]$/;
- $file=$_;
- if ( -l $file)
- {
- unlink("$file.gz");
- $link=readlink($file) || exit 1;
- (symlink "$link.gz", "$file.gz") || exit 1;
- unlink($file);
- }
- else
- {
- system("gzip <$file >$file.gz") && exit 1;
- unlink($file);
- }
- }
- '
- >filelist
- if test -f $RPM_BUILD_ROOT%{htmllibdir}/authldaprc
- then
- echo '%attr(600, root, root) %config %{htmllibdir}/authldaprc' >>filelist
- fi
- if test -f $RPM_BUILD_ROOT%{htmllibdir}/authmysqlrc
- then
- echo '%attr(600, root, root) %config %{htmllibdir}/authmysqlrc' >>filelist
- fi
- . authlib/authdaemonrc
- if test "$authdaemonvar" != ""
- then
- echo '%attr(755, bin, bin) /etc/rc.d/init.d/sqwebmail' >>filelist
- echo '%dir %attr(700, root, root) ' $authdaemonvar >>filelist
- echo '%config %attr(600, root, root) %{htmllibdir}/authdaemonrc' >>filelist
- touch $RPM_BUILD_ROOT/$authdaemonvar/lock || exit 1
- touch $RPM_BUILD_ROOT/$authdaemonvar/pid || exit 1
-
- authlib/authmksock $RPM_BUILD_ROOT/$authdaemonvar/socket || exit 1
- chmod 777 $RPM_BUILD_ROOT/$authdaemonvar/socket || exit 1
- echo '%ghost %attr(600, root, root) ' $authdaemonvar/lock >>filelist
- echo '%ghost %attr(644, root, root) ' $authdaemonvar/pid >>filelist
- echo '%ghost %attr(-, root, root) ' $authdaemonvar/socket >>filelist
- #
- # Red Hat init.d file
- #
- mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
- cat >$RPM_BUILD_ROOT/etc/rc.d/init.d/sqwebmail <<EOF
- #!/bin/sh
- #
- # chkconfig: 2345 50 50
- # description: Start authdaemon daemon for SqWebMail
- #
- #
- #
- case "$1" in
- start)
- cd /
- touch /var/lock/subsys/sqwebmail
- echo -n "Starting SqWebMail authentication daemon:"
- %{_libexecdir}/authlib/authdaemond start
- echo " authdaemon"
- ;;
- stop)
- echo -n "Stopping SqWebMail authentication daemon:"
- %{_libexecdir}/authlib/authdaemond stop
- echo " authdaemon"
- ;;
- restart)
- echo -n "Restarting SqWebMail authentication daemon:"
- %{_libexecdir}/authlib/authdaemond restart
- echo " authdaemon"
- ;;
- esac
- exit 0
- EOF
- fi
- %post
- test -d %{htmllibdir}/html/en || ln -fs en-us %{htmllibdir}/html/en
- if test -f /etc/rc.d/init.d/sqwebmail
- then
- /sbin/chkconfig --del sqwebmail
- /sbin/chkconfig --add sqwebmail
- fi
- %preun
- if test "$1" = "0"
- then
- if test -f /etc/rc.d/init.d/sqwebmail
- then
- /sbin/chkconfig --del sqwebmail
- fi
- fi
- %postun
- test -d %{htmllibdir}/html/en || rm -f %{htmllibdir}/html/en
- %files -f filelist
- %attr(06555, root, mail) %{cgibindir}
- %attr(755, bin, bin) %dir %{imagedir}
- %attr(444, bin, bin) %{imagedir}/*
- %attr(555, bin, bin) %dir %{htmllibdir}
- %attr(755, root, bin) %config %{htmllibdir}/sendit.sh
- %attr(755, root, bin) %config %{htmllibdir}/ldapsearch
- %attr(644, root, bin) %config %{htmllibdir}/ldapaddressbook
- %attr(755, root, bin) %config %{htmllibdir}/authmodulelist
- %attr(755, bin, bin) %{htmllibdir}/cleancache.pl
- %attr(755, bin, bin) /etc/cron.hourly/sqwebmail-cron-cleancache
- %attr(700, bin, bin) %dir %{cachedir}
- %attr(644, root, bin) %config /etc/pam.d/webmail
- %attr(755, root, bin) %dir %{htmllibdir}/html
- %attr(-, root, bin) %{htmllibdir}/html/en-us
- %attr(-, root, bin) %{htmllibdir}/sbin
- %attr(-, root, bin) %{htmllibdir}/man
- %attr(-, root, bin) %{_libexecdir}
- %attr(755, bin, bin) /etc/profile.d/sqwebmail.sh
- %attr(755, bin, bin) /etc/profile.d/sqwebmail.csh
- %attr(-, bin, bin) %doc AUTHORS sqwebmail/BUGS COPYING INSTALL INSTALL.vchkpw NEWS README sqwebmail/SECURITY sqwebmail/TODO
- %attr(-, bin, bin) %doc sqwebmail/BUGS.html INSTALL.html NEWS.html README.html sqwebmail/SECURITY.html sqwebmail/TODO.html sqwebmail/ChangeLog
- %attr(-, bin, bin) %doc maildir/README*.html
- %clean
- rm -rf $RPM_BUILD_ROOT