procmail.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. ##
  2. ## procmail.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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: procmail
  27. Summary: Local Mail Filtering and Delivering Tool
  28. URL: http://www.procmail.org/
  29. Vendor: Stephen R. van den Berg
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Mail
  33. License: GPL
  34. Version: 3.22
  35. Release: 20030708
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.procmail.org/pub/procmail/procmail-%{version}.tar.gz
  40. Source1: procmailrc
  41. Source2: rc.procmail
  42. Source3: fsl.procmail
  43. Patch0: procmail.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030415
  48. PreReq: OpenPKG, openpkg >= 20030415
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. Procmail can be used to create mail-servers, mailing lists, sort
  57. your incoming mail into separate folders/files (real convenient
  58. when subscribing to one or more mailing lists or for prioritising
  59. your mail), preprocess your mail, start any programs upon mail
  60. arrival (e.g. to generate different chimes on your workstation for
  61. different types of mail) or selectively forward certain incoming
  62. mail automatically to someone.
  63. %prep
  64. %setup -q
  65. %patch -p0
  66. %{l_shtool} subst \
  67. -e 's;^\(BASENAME[^=]*=\).*;\1 %{l_prefix};' \
  68. -e 's;^CFLAGS0.*=.*$;CFLAGS0 = %{l_cflags -O};' \
  69. -e 's;^LDFLAGS0.*=\(.*\)$;LDFLAGS0 = %{l_ldflags} %{l_fsl_ldflags};' \
  70. -e 's;^LIBS.*=.*$;LIBS = %{l_fsl_libs};' \
  71. -e 's;^[#]*CC.*=.*$;CC = %{l_cc};' \
  72. Makefile
  73. %{l_shtool} subst \
  74. -e 's;^/\*\(#define NO_fcntl_LOCK\);\1;' \
  75. -e 's;^/\*\(#define LMTP\);\1;' \
  76. -e 's;\(#define.*ETCRC[^"]"\)[^"]*\(".*\);\1%{l_prefix}/etc/procmail/procmailrc\2;' \
  77. -e 's;\(#define.*ETCRCS[^"]"\)[^"]*\(".*\);\1%{l_prefix}/etc/procmail/\2;' \
  78. config.h
  79. %if "%{with_fsl}" == "yes"
  80. %{l_shtool} subst \
  81. -e 's;openlog(ident,logopt,facility);openlog(ident,logopt,LOG_USER);' \
  82. src/includes.h
  83. %endif
  84. %build
  85. ( unset LD_LIBRARY_PATH 2>/dev/null || true
  86. dirlist=""
  87. for dir in "$HOME/tmp" /tmp $RPM_SOURCE_DIR $RPM_BUILD_DIR; do
  88. if [ -d $dir ]; then
  89. dirlist="$dirlist $dir"
  90. fi
  91. done
  92. echo "$dirlist" |\
  93. %{l_make} %{l_mflags} autoconf.h CC="%{l_cc}" CFLAGS="%{l_cflags -O}"
  94. )
  95. %{l_shtool} subst \
  96. -e 's;\(#define.*SENDMAIL[^"]*"\)[^"]*\(".*\);\1%{l_prefix}/sbin/sendmail\2;' \
  97. autoconf.h
  98. %{l_make} %{l_mflags}
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. %{l_shtool} mkdir -f -p -m 755 \
  102. $RPM_BUILD_ROOT%{l_prefix}/var/procmail \
  103. $RPM_BUILD_ROOT%{l_prefix}/bin \
  104. $RPM_BUILD_ROOT%{l_prefix}/etc/procmail \
  105. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  106. $RPM_BUILD_ROOT%{l_prefix}/man/man5
  107. %{l_shtool} install -c -s -m 755 \
  108. new/procmail new/lockfile new/formail \
  109. $RPM_BUILD_ROOT%{l_prefix}/bin/
  110. %{l_shtool} install -c -m 755 \
  111. new/mailstat \
  112. $RPM_BUILD_ROOT%{l_prefix}/bin/
  113. %{l_shtool} install -c -m 644 \
  114. new/*.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  115. %{l_shtool} install -c -m 644 \
  116. new/*.5 $RPM_BUILD_ROOT%{l_prefix}/man/man5/
  117. %{l_shtool} install -c -m 644 \
  118. -e 's;@l_prefix@;%{l_prefix};g' \
  119. %{SOURCE procmailrc} $RPM_BUILD_ROOT%{l_prefix}/etc/procmail/
  120. # install run-command script
  121. %{l_shtool} mkdir -f -p -m 755 \
  122. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  123. %{l_shtool} install -c -m 755 \
  124. -e 's;@l_prefix@;%{l_prefix};g' \
  125. -e 's;@l_susr@;%{l_susr};g' \
  126. -e 's;@l_rusr@;%{l_rusr};g' \
  127. -e 's;@l_rgrp@;%{l_rgrp};g' \
  128. %{SOURCE rc.procmail} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  129. # install OSSP fsl configuration
  130. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  131. %{l_shtool} install -c -m 644 \
  132. -e 's;@l_prefix@;%{l_prefix};g' \
  133. %{SOURCE fsl.procmail} \
  134. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  135. # determine installation files
  136. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  137. %{l_files_std} \
  138. '%not %dir %{l_prefix}/etc/fsl' \
  139. '%config %{l_prefix}/etc/fsl/fsl.procmail' \
  140. '%attr(6755,%{l_susr},mail) %{l_prefix}/bin/procmail' \
  141. '%attr(2755,%{l_mgrp},mail) %{l_prefix}/bin/lockfile'
  142. %files -f files
  143. %clean
  144. rm -rf $RPM_BUILD_ROOT