milter-dkim.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ##
  2. ## milter-dkim.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: milter-dkim
  26. Summary: Mail Filter for DomainKeys Identified Mail (DKIM)
  27. URL: http://dk-milter.sourceforge.net/
  28. Vendor: Sendmail, Inc.
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: Mail
  33. License: Open Source
  34. Version: 0.6.1
  35. Release: 20070307
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://switch.dl.sourceforge.net/dkim-milter/dkim-milter-%{version}.tar.gz
  40. Source1: rc.milter-dkim
  41. Source2: fsl.milter-dkim
  42. Source3: milter-dkim-genkey.sh
  43. Patch0: milter-dkim.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20060823
  48. PreReq: OpenPKG, openpkg >= 20060823
  49. BuildPreReq: milter, openssl
  50. PreReq: milter, openssl
  51. %if "%{with_fsl}" == "yes"
  52. BuildPreReq: fsl >= 1.2.0
  53. PreReq: fsl >= 1.2.0
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. This is a DomainKeys Identified Mail (DKIM) based mail sender
  59. authentication based on the MILTER API of MTAs. DKIM is the a merger
  60. and enhancement of Yahoo! DomainKeys and Cisco Identified Internet
  61. Mail (IIM). DKIM is upward compatible with existing DomainKeys DNS
  62. records.
  63. %track
  64. prog milter-dkim = {
  65. version = %{version}
  66. url = http://prdownloads.sourceforge.net/dkim-milter/
  67. regex = dkim-milter-(__VER__)\.tar\.gz
  68. }
  69. %prep
  70. %setup -q -n dkim-milter-%{version}
  71. %patch -p0
  72. %build
  73. # configure program
  74. extlibs="%{l_fsl_libs}"
  75. case "%{l_platform -t}" in
  76. *-sunos* ) extlibs="$extlibs -lrt" ;;
  77. esac
  78. ( echo "define(\`confCC', \`%{l_cc} %{l_cflags}')dnl"
  79. echo "APPENDDEF(\`confINCDIRS', \`%{l_cppflags}')dnl"
  80. echo "APPENDDEF(\`confLIBDIRS', \`%{l_ldflags} %{l_fsl_ldflags}')dnl"
  81. echo "APPENDDEF(\`confLIBS', \`$extlibs')dnl"
  82. ) >devtools/Site/site.config.m4
  83. # build program
  84. ./Build
  85. %install
  86. # create installation hierarchy
  87. rm -rf $RPM_BUILD_ROOT
  88. %{l_shtool} mkdir -f -p -m 755 \
  89. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  90. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  91. $RPM_BUILD_ROOT%{l_prefix}/etc/milter-dkim \
  92. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  93. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  94. $RPM_BUILD_ROOT%{l_prefix}/var/milter-dkim/tmp
  95. # install program
  96. %{l_shtool} install -c -s -m 755 \
  97. obj.*/dkim-filter/dkim-filter $RPM_BUILD_ROOT%{l_prefix}/sbin/
  98. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  99. %{SOURCE milter-dkim-genkey.sh} $RPM_BUILD_ROOT%{l_prefix}/sbin/milter-dkim-genkey
  100. # install manual page
  101. %{l_shtool} install -c -m 644 \
  102. dkim-filter/dkim-filter.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  103. # install run-command script
  104. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  105. %{SOURCE rc.milter-dkim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  106. # install OSSP fsl configuration
  107. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  108. %{SOURCE fsl.milter-dkim} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  109. # determine installation files
  110. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  111. %{l_files_std} \
  112. '%config %{l_prefix}/etc/fsl/*' \
  113. '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/milter-dkim/*' \
  114. '%attr(755,%{l_rusr},%{l_mgrp}) %{l_prefix}/var/milter-dkim'
  115. %files -f files
  116. %clean
  117. rm -rf $RPM_BUILD_ROOT
  118. %post
  119. # after upgrade, restart service
  120. if [ $1 -eq 1 ]; then
  121. if [ ! -f $RPM_INSTALL_PREFIX/etc/milter-dkim/main.example.com.pem ]; then
  122. $RPM_INSTALL_PREFIX/sbin/milter-dkim-genkey \
  123. main example.com $RPM_INSTALL_PREFIX/etc/milter-dkim/main.example.com.pem 1024
  124. fi
  125. elif [ $1 -eq 2 ]; then
  126. eval `%{l_rc} milter-dkim status 2>/dev/null`
  127. [ ".$milter_dkim_active" = .yes ] && %{l_rc} milter-dkim restart
  128. fi
  129. exit 0
  130. %preun
  131. # before erase, stop service and remove log files
  132. if [ $1 -eq 0 ]; then
  133. %{l_rc} milter-dkim stop 2>/dev/null
  134. rm -f $RPM_INSTALL_PREFIX/etc/milter-dkim/main.example.com.pem >/dev/null 2>&1 || true
  135. rm -f $RPM_INSTALL_PREFIX/var/milter-dkim/* >/dev/null 2>&1 || true
  136. fi
  137. exit 0