petidomo.spec 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## petidomo.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 information
  26. Name: petidomo
  27. Summary: Mailing List Server
  28. URL: http://www.ossp.org/pkg/tool/petidomo/
  29. Vendor: Peter Simons
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Mail
  34. License: GPL
  35. Version: 4.0b6
  36. Release: 20040319
  37. # package options
  38. %option with_fsl yes
  39. # list of sources
  40. Source0: ftp://ftp.ossp.org/pkg/tool/petidomo/petidomo-%{version}.tar.gz
  41. Source1: etc.petidomo.tar
  42. Source2: fsl.petidomo
  43. Source3: rc.petidomo
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, bison, flex
  48. PreReq: OpenPKG, openpkg >= 20040130, MTA
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl >= 1.4.0-20040310
  51. PreReq: fsl >= 1.4.0-20040310
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. Petidomo is a mailing list manager very similar to the popular
  57. package Majordomo. It handles both list un-/subscription and the
  58. address expansion of list postings. The actual delivery of postings
  59. is performed by an MTA like Sendmail.
  60. %track
  61. prog petidomo = {
  62. comment = "rse: 4.0b3 is broken"
  63. version = %{version}
  64. url = ftp://ftp.ossp.org/pkg/tool/petidomo/
  65. regex = petidomo-(__VER__)\.tar\.gz
  66. }
  67. %prep
  68. %setup -q -c
  69. %setup -q -T -D -a 1
  70. %build
  71. # build petidomo
  72. ( cd petidomo-%{version}
  73. CC="%{l_cc}" \
  74. CFLAGS="%{l_cflags}" \
  75. CPPFLAGS="%{l_cppflags}" \
  76. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  77. LIBS="%{l_fsl_libs}" \
  78. ./configure \
  79. --prefix=%{l_prefix} \
  80. --sysconfdir=%{l_prefix}/etc/petidomo
  81. %{l_make} %{l_mflags}
  82. ) || exit $?
  83. %install
  84. rm -rf $RPM_BUILD_ROOT
  85. ( cd petidomo-%{version}
  86. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  87. ) || exit $?
  88. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/petidomo
  89. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo
  90. rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/petidomo
  91. %{l_shtool} mkdir -f -p -m 755 \
  92. $RPM_BUILD_ROOT%{l_prefix}/var/petidomo \
  93. $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo
  94. %{l_shtool} install -c -m 644 \
  95. /dev/null $RPM_BUILD_ROOT%{l_prefix}/var/petidomo/petidomo.log
  96. ( cd etc.petidomo
  97. l_hostname=`%{l_shtool} echo -e '%h%d'`
  98. %{l_shtool} install -c -m - \
  99. -e "s;@l_hostname@;${l_hostname};g" %{l_value -s -a} \
  100. * $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo/
  101. ) || exit $?
  102. # install run-command script
  103. %{l_shtool} mkdir -f -p -m 755 \
  104. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  105. %{l_shtool} install -c -m - %{l_value -s -a} \
  106. %{SOURCE rc.petidomo} \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  108. # install OSSP fsl configuration
  109. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  110. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  111. %{SOURCE fsl.petidomo} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  113. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  114. %{l_files_std} \
  115. '%not %dir %{l_prefix}/etc/fsl' \
  116. '%config %{l_prefix}/etc/fsl/fsl.petidomo' \
  117. '%config %{l_prefix}/etc/petidomo/*' \
  118. '%attr(775,%{l_musr},%{l_rgrp}) %{l_prefix}/var/petidomo/*' \
  119. '%attr(6755,%{l_musr},%{l_mgrp}) %{l_prefix}/bin/petidomo'
  120. %files -f files
  121. %clean
  122. rm -rf $RPM_BUILD_ROOT
  123. %post
  124. # add hook into MTA configuration
  125. if [ ".$1" = .1 ]; then
  126. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  127. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  128. if [ ".$aliases_file" != . ]; then
  129. ( echo "petidomo: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=listserv\""
  130. echo "petidomo-approve: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=approve\""
  131. echo "petidomo-manager: postmaster"
  132. echo "owner-owner: petidomo-manager"
  133. echo "users: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=deliver --listname=users\""
  134. echo "users-request: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=listserv --listname=users\""
  135. echo "users-owner: postmaster"
  136. echo "owner-users: users-owner"
  137. ) |\
  138. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  139. -a -i "$RPM_INSTALL_PREFIX:petidomo" $aliases_file
  140. fi
  141. if [ ".$update_command" != . ]; then
  142. eval $update_command
  143. fi
  144. fi
  145. %postun
  146. # remove hook from MTA configuration
  147. if [ ".$1" = .0 ]; then
  148. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  149. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  150. if [ ".$aliases_file" != . ]; then
  151. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  152. -r -i "$RPM_INSTALL_PREFIX:petidomo" $aliases_file
  153. fi
  154. if [ ".$update_command" != . ]; then
  155. eval $update_command
  156. fi
  157. fi