postfix-mailgraph.spec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ##
  2. ## postfix-mailgraph.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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 information
  26. Name: postfix-mailgraph
  27. Summary: Postfix Mail Graphing
  28. URL: http://people.ee.ethz.ch/~dws/software/mailgraph/
  29. Vendor: David Schweikert
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Mail
  34. License: GPL
  35. Version: 1.10
  36. Release: 20041026
  37. # list of sources
  38. Source0: http://people.ee.ethz.ch/~dws/software/mailgraph/pub/mailgraph-%{version}.tar.gz
  39. Source1: rc.postfix-mailgraph
  40. Patch0: postfix-mailgraph.patch
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20040130
  45. PreReq: OpenPKG, openpkg >= 20040130, perl, perl-sys, rrdtool, postfix
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. Mailgraph is a very simple mail statistics RRDtool frontend for the
  50. Postfix MTA that produces daily, weekly, monthly and yearly graphs
  51. of received/sent and bounced/rejected mail.
  52. %track
  53. prog postfix-mailgraph = {
  54. version = %{version}
  55. url = http://people.ee.ethz.ch/~dws/software/mailgraph/pub/
  56. regex = mailgraph-(__VER__)\.tar\.gz
  57. }
  58. %prep
  59. %setup -q -n mailgraph-%{version}
  60. %patch -p0
  61. %build
  62. %install
  63. rm -rf $RPM_BUILD_ROOT
  64. %{l_shtool} mkdir -f -p -m 755 \
  65. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  66. $RPM_BUILD_ROOT%{l_prefix}/cgi \
  67. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  68. $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/rrd \
  69. $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/img \
  70. $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/run
  71. %{l_shtool} install -c -m 755 \
  72. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  73. -e 's;/var/log/mailgraph\.log;%{l_prefix}/var/postfix-mailgraph/run/mailgraph.log;' \
  74. -e 's;/var/run/mailgraph\.pid;%{l_prefix}/var/postfix-mailgraph/run/mailgraph.pid;' \
  75. -e 's;/var/log/syslog;%{l_prefix}/var/postfix/log/postfix.log;' \
  76. -e 's;/var/log;%{l_prefix}/var/postfix-mailgraph/rrd;' \
  77. mailgraph.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/mailgraph
  78. %{l_shtool} install -c -m 755 \
  79. -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
  80. -e 's;mailgraph\.cgi;mailgraph;' \
  81. -e 's;mailgraph\.rrd;%{l_prefix}/var/postfix-mailgraph/rrd/mailgraph.rrd;' \
  82. -e 's;mailgraph_virus\.rrd;%{l_prefix}/var/postfix-mailgraph/rrd/mailgraph_virus.rrd;' \
  83. -e 's;/tmp/mailgraph;%{l_prefix}/var/postfix-mailgraph/img;' \
  84. mailgraph.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/mailgraph
  85. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  86. %{SOURCE rc.postfix-mailgraph} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  87. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  88. %{l_files_std} \
  89. '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/postfix-mailgraph/img'
  90. %files -f files
  91. %clean
  92. rm -rf $RPM_BUILD_ROOT