ssmtp.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. ##
  2. ## ssmtp.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 version
  26. %define V_major 2.60
  27. %define V_minor 12
  28. # package information
  29. Name: ssmtp
  30. Summary: Simple SMTP Send-Only MTA
  31. URL: ftp://ftp.debian.org/debian/pool/main/s/ssmtp/
  32. Vendor: Matt Ryan
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: BASE
  36. Group: Mail
  37. License: GPL
  38. Version: %{V_major}.%{V_minor}
  39. Release: 20041209
  40. # package options
  41. %option with_fsl yes
  42. %option with_ssl no
  43. # list of sources
  44. Source0: ftp://ftp.debian.org/debian/pool/main/s/ssmtp/ssmtp_%{version}.tar.gz
  45. Source1: ssmtp.conf
  46. Source2: rc.ssmtp
  47. Source3: fsl.ssmtp
  48. Patch0: ssmtp.patch
  49. # build information
  50. Prefix: %{l_prefix}
  51. BuildRoot: %{l_buildroot}
  52. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  53. PreReq: OpenPKG, openpkg >= 20040130
  54. %if "%{with_fsl}" == "yes"
  55. BuildPreReq: fsl >= 1.2.0
  56. PreReq: fsl >= 1.2.0
  57. %endif
  58. %if "%{with_ssl}" == "yes"
  59. BuildPreReq: openssl
  60. PreReq: openssl
  61. %endif
  62. AutoReq: no
  63. AutoReqProv: no
  64. Provides: MTA
  65. Conflicts: exim, postfix, sendmail
  66. %description
  67. This is sSMTP, a program that replaces sendmail on workstations
  68. that should send their mail via the departmental mailhub from which
  69. they pick up their mail (via pop, imap, rsmtp, pop_fetch, NFS... or
  70. the like). This program accepts mail and sends it to the mailhub,
  71. optionally replacing the domain in the From: line with a different
  72. one.
  73. %track
  74. prog ssmtp = {
  75. version = %{version}
  76. url = ftp://ftp.debian.org/debian/pool/main/s/ssmtp/
  77. regex = ssmtp_(__VER__)\.tar\.gz
  78. }
  79. %prep
  80. %setup -q -n ssmtp-%{V_major}
  81. %patch -p0
  82. %build
  83. CC="%{l_cc}" \
  84. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  85. LDFLAGS="%{l_fsl_ldflags}" \
  86. %if "%{with_ssl}" == "yes"
  87. LIBS="%{l_fsl_ldflags} %{l_fsl_libs} %{l_ldflags} -lssl -lcrypto" \
  88. %else
  89. LIBS="%{l_fsl_ldflags} %{l_fsl_libs}" \
  90. %endif
  91. ./configure \
  92. %if "%{with_ssl}" == "yes"
  93. --enable-ssl \
  94. %endif
  95. --prefix=%{l_prefix}
  96. %{l_make} %{l_mflags}
  97. %install
  98. rm -rf $RPM_BUILD_ROOT
  99. %{l_shtool} mkdir -f -p -m 755 \
  100. $RPM_BUILD_ROOT%{l_prefix}/var/ssmtp \
  101. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/ssmtp \
  103. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  104. $RPM_BUILD_ROOT%{l_prefix}/var/ssmtp
  105. %{l_shtool} install -c -s -m 755 \
  106. ssmtp $RPM_BUILD_ROOT%{l_prefix}/sbin/
  107. %{l_shtool} install -c -m 644 \
  108. -e 's;.B ssmtp;.B %{l_prefix}/sbin/ssmtp;' \
  109. -e 's;.B /usr/lib/sendmail;.B %{l_prefix}/sbin/sendmail;' \
  110. ssmtp.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  111. ln $RPM_BUILD_ROOT%{l_prefix}/sbin/ssmtp \
  112. $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail
  113. ln $RPM_BUILD_ROOT%{l_prefix}/man/man8/ssmtp.8 \
  114. $RPM_BUILD_ROOT%{l_prefix}/man/man8/sendmail.8
  115. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  116. %{SOURCE ssmtp.conf} \
  117. $RPM_BUILD_ROOT%{l_prefix}/etc/ssmtp/
  118. %{l_shtool} install -c -m 644 revaliases \
  119. $RPM_BUILD_ROOT%{l_prefix}/etc/ssmtp/ssmtp.revaliases
  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 %{l_value -s -a} \
  124. %{SOURCE rc.ssmtp} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  125. # install OSSP fsl configuration
  126. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  127. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  128. %{SOURCE fsl.ssmtp} \
  129. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  130. # determine installation files
  131. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  132. %{l_files_std} \
  133. '%not %dir %{l_prefix}/etc/fsl' \
  134. '%config %{l_prefix}/etc/fsl/fsl.ssmtp' \
  135. '%config %{l_prefix}/etc/ssmtp/ssmtp.*'
  136. %files -f files
  137. %clean
  138. rm -rf $RPM_BUILD_ROOT