ssmtp.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ##
  2. ## ssmtp.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: ssmtp
  27. Summary: Simple SMTP MTA
  28. URL: ftp://metalab.unc.edu/pub/Linux/system/mail/mta/
  29. Vendor: Matt Ryan
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Mail
  33. License: GPL
  34. Version: 2.48
  35. Release: 20030708
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://metalab.unc.edu/pub/Linux/system/mail/mta/ssmtp-%{version}.tar.gz
  40. Source1: ssmtp.conf
  41. Source2: rc.ssmtp
  42. Source3: fsl.ssmtp
  43. Patch0: ssmtp.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030603, make, gcc
  48. PreReq: OpenPKG, openpkg >= 20030603
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. Provides: MTA
  56. Conflicts: sendmail, exim, postfix
  57. %description
  58. This is sSMTP, a program that replaces sendmail on workstations
  59. that should send their mail via the departmental mailhub from which
  60. they pick up their mail (via pop, imap, rsmtp, pop_fetch, NFS... or
  61. the like). This program accepts mail and sends it to the mailhub,
  62. optionally replacing the domain in the From: line with a different
  63. one.
  64. %prep
  65. %setup -q
  66. rm -rf RCS
  67. %patch -p0
  68. rm -f config.cache
  69. %build
  70. CC="%{l_cc}" \
  71. CFLAGS="%{l_cflags -O}" \
  72. LDFLAGS="%{l_fsl_ldflags}" \
  73. LIBS="%{l_fsl_libs}" \
  74. ./configure \
  75. --prefix=%{l_prefix}
  76. %{l_make} %{l_mflags} \
  77. SSMTPCONFDIR="%{l_prefix}/etc/ssmtp" \
  78. CONFIGURATION_FILE="%{l_prefix}/etc/ssmtp/ssmtp.conf" \
  79. REVALIASES_FILE="%{l_prefix}/etc/ssmtp/ssmtp.revaliases"
  80. %install
  81. rm -rf $RPM_BUILD_ROOT
  82. %{l_shtool} mkdir -f -p -m 755 \
  83. $RPM_BUILD_ROOT%{l_prefix}/var/ssmtp \
  84. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/ssmtp \
  86. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  87. $RPM_BUILD_ROOT%{l_prefix}/var/ssmtp
  88. %{l_shtool} install -c -s -m 755 \
  89. ssmtp $RPM_BUILD_ROOT%{l_prefix}/sbin/
  90. %{l_shtool} install -c -m 644 \
  91. -e 's;.B ssmtp;.B %{l_prefix}/sbin/ssmtp;' \
  92. -e 's;.B /usr/lib/sendmail;.B %{l_prefix}/sbin/sendmail;' \
  93. ssmtp.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  94. ln $RPM_BUILD_ROOT%{l_prefix}/sbin/ssmtp \
  95. $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail
  96. ln $RPM_BUILD_ROOT%{l_prefix}/man/man8/ssmtp.8 \
  97. $RPM_BUILD_ROOT%{l_prefix}/man/man8/sendmail.8
  98. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  99. %{SOURCE ssmtp.conf} \
  100. $RPM_BUILD_ROOT%{l_prefix}/etc/ssmtp/
  101. %{l_shtool} install -c -m 644 revaliases \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/ssmtp/ssmtp.revaliases
  103. # install run-command script
  104. %{l_shtool} mkdir -f -p -m 755 \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  106. %{l_shtool} install -c -m 755 \
  107. -e 's;@l_prefix@;%{l_prefix};g' \
  108. -e 's;@l_susr@;%{l_susr};g' \
  109. -e 's;@l_rusr@;%{l_rusr};g' \
  110. -e 's;@l_rgrp@;%{l_rgrp};g' \
  111. %{SOURCE rc.ssmtp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  112. # install OSSP fsl configuration
  113. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  114. %{l_shtool} install -c -m 644 \
  115. -e 's;@l_prefix@;%{l_prefix};g' \
  116. %{SOURCE fsl.ssmtp} \
  117. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  118. # determine installation files
  119. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  120. %{l_files_std} \
  121. '%not %dir %{l_prefix}/etc/fsl' \
  122. '%config %{l_prefix}/etc/fsl/fsl.ssmtp' \
  123. '%config %{l_prefix}/etc/ssmtp/ssmtp.conf'
  124. %files -f files
  125. %clean
  126. rm -rf $RPM_BUILD_ROOT