drac.spec 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ##
  2. ## drac.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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: drac
  26. Summary: Dynamic Relay Authorization Control (DRAC)
  27. URL: http://mail.cc.umanitoba.ca/drac/
  28. Vendor: University of Manitoba
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: EVAL
  32. Group: Mail
  33. License: BSD
  34. Version: 1.12
  35. Release: 20061012
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/drac/drac-%{version}.tar.Z
  40. Source1: rc.drac
  41. Source2: fsl.drac
  42. Source3: drac.h
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20060823, gcc
  47. PreReq: OpenPKG, openpkg >= 20060823
  48. %if "%{with_fsl}" == "yes"
  49. BuildPreReq: fsl >= 1.2.0
  50. PreReq: fsl >= 1.2.0
  51. %endif
  52. BuildPreReq: db >= 4.2
  53. PreReq: db >= 4.2
  54. AutoReq: no
  55. AutoReqProv: no
  56. %description
  57. DRAC is a daemon that dynamically updates a relay authorization
  58. map for Sendmail, Postfix and other MTA's that supports it. It
  59. provides a way to allow legitimate users to relay mail through an
  60. SMTP server, while still preventing others from using it as a spam
  61. relay. User's IP addresses are added to the map immediately after
  62. they have authenticated to the POP or IMAP server. By default, map
  63. entries expire after 30 minutes, but can be renewed by additional
  64. authentication. Periodically checking mail on a POP server is
  65. sufficient to do this. The POP and SMTP servers can be on different
  66. hosts.
  67. %track
  68. prog drac = {
  69. version = %{version}
  70. url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/drac/
  71. regex = drac-(__VER__)\.tar\.Z
  72. }
  73. %prep
  74. %setup -q -c
  75. %build
  76. # determine platform dependent flags
  77. cppflags="%{l_cppflags}"
  78. ldflags="%{l_ldflags} -ldb"
  79. ldflags_tst="-L. -ldrac"
  80. case "%{l_platform -t}" in
  81. *-sunos5.[6-9]* )
  82. cppflags="$cppflags -DTI_RPC -DFCNTL_LOCK -DSYSINFO"
  83. ldflags="$ldflags -lnsl"
  84. ldflags_tst="$ldflags_tst -lnsl"
  85. ;;
  86. *-freebsd[45]* | *-linux2* | *-netbsd1* )
  87. cppflags="$cppflags -DSOCK_RPC -DFLOCK_LOCK -DGETHOST -DDASH_C"
  88. ;;
  89. *-irix6* )
  90. cppflags="$cppflags -DTI_RPC -DFCNTL_LOCK -DSYSINFO -D_SVR4_TIRPC"
  91. ldflags="$ldflags -lnsl"
  92. ldflags_tst="$ldflags_tst -lnsl"
  93. ;;
  94. esac
  95. # configure build environment
  96. %{l_shtool} subst \
  97. -e "s;^\(DEFS =\).*\$;\1 $cppflags;" \
  98. -e "s;^\(LDLIBS =\).*\$;\1 %{l_fsl_libs} $ldflags;" \
  99. -e "s;^\(TSTLIBS =\).*\$;\1 $ldflags_tst;" \
  100. -e 's;^\(CC =\).*$;\1 %{l_cc};' \
  101. -e 's;^\(RANLIB =\).*$;\1 ranlib;' \
  102. -e 's;^\(CFLAGS =\).*$;\1 \$(DEFS);' \
  103. -e 's;^\(RPCGENFLAGS =\).*$;\1 -Y %{l_prefix}/bin;' \
  104. Makefile
  105. # configure paths in source
  106. %{l_shtool} subst \
  107. -e "s;/etc/mail;%{l_prefix}/etc/drac;g" \
  108. rpc.dracd.c
  109. # build program and library
  110. %{l_make} %{l_mflags}
  111. %install
  112. # create installation area
  113. rm -rf $RPM_BUILD_ROOT
  114. %{l_shtool} mkdir -f -p -m 755 \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/drac \
  116. $RPM_BUILD_ROOT%{l_prefix}/var/drac \
  117. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  118. $RPM_BUILD_ROOT%{l_prefix}/lib \
  119. $RPM_BUILD_ROOT%{l_prefix}/include \
  120. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  121. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  122. # install program
  123. %{l_shtool} install -c -s -m 755 \
  124. rpc.dracd $RPM_BUILD_ROOT%{l_prefix}/sbin/dracd
  125. %{l_shtool} install -c -m 644 \
  126. rpc.dracd.1m $RPM_BUILD_ROOT%{l_prefix}/man/man8/dracd.8
  127. # install library
  128. %{l_shtool} install -c -m 644 \
  129. %{SOURCE drac.h} $RPM_BUILD_ROOT%{l_prefix}/include/
  130. %{l_shtool} install -c -m 644 \
  131. libdrac.a $RPM_BUILD_ROOT%{l_prefix}/lib/
  132. %{l_shtool} install -c -m 644 \
  133. dracauth.3 $RPM_BUILD_ROOT%{l_prefix}/man/man3/
  134. # install empty database
  135. %{l_shtool} install -c -m 644 \
  136. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/drac/dracd.db
  137. # install run-command script
  138. %{l_shtool} mkdir -f -p -m 755 \
  139. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  140. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  141. %{SOURCE rc.drac} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  142. # install OSSP fsl configuration
  143. %{l_shtool} mkdir -f -p -m 755 \
  144. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  145. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  146. %{SOURCE fsl.drac} \
  147. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  148. # determine installation files
  149. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  150. %{l_files_std} \
  151. '%not %dir %{l_prefix}/etc/fsl' \
  152. '%config %{l_prefix}/etc/fsl/fsl.drac' \
  153. '%config %{l_prefix}/etc/drac/dracd.db'
  154. %files -f files
  155. %clean
  156. rm -rf $RPM_BUILD_ROOT