petidomo.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##
  2. ## petidomo.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: 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 [EVAL]
  32. Group: Mail
  33. License: GPL
  34. Version: 4.0b1
  35. Release: 20021128
  36. # list of sources
  37. Source0: ftp://ftp.ossp.org/pkg/tool/petidomo/petidomo-%{version}.tar.gz
  38. Source1: etc.petidomo.tar
  39. Source2: fsl.petidomo
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20020206, fsl, bison, flex
  44. PreReq: OpenPKG, openpkg >= 20020206, fsl, MTA
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. Petidomo is a mailing list manager very similar to the popular
  49. package Majordomo. It handles both list un-/subscription and the
  50. address expansion of list postings. The actual delivery of postings
  51. is performed by an MTA like Sendmail.
  52. %prep
  53. %setup0 -q -c
  54. %setup1 -q -T -D -a 1
  55. %build
  56. # build petidomo
  57. ( cd petidomo-%{version}
  58. CC="%{l_cc}" \
  59. CFLAGS="`%{l_prefix}/bin/fsl-config --all --cflags`" \
  60. CPPFLAGS="`%{l_prefix}/bin/fsl-config --all --cflags`" \
  61. LDFLAGS="`%{l_prefix}/bin/fsl-config --all --ldflags`" \
  62. LIBS="`%{l_prefix}/bin/fsl-config --all --libs`" \
  63. ./configure \
  64. --prefix=%{l_prefix} \
  65. --sysconfdir=%{l_prefix}/etc/petidomo
  66. %{l_make} %{l_mflags}
  67. )
  68. %install
  69. rm -rf $RPM_BUILD_ROOT
  70. ( cd petidomo-%{version}
  71. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  72. )
  73. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/petidomo
  74. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo
  75. rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/petidomo
  76. %{l_shtool} mkdir -f -p -m 755 \
  77. $RPM_BUILD_ROOT%{l_prefix}/var/petidomo \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo \
  79. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  80. %{l_shtool} install -c -m 644 \
  81. /dev/null $RPM_BUILD_ROOT%{l_prefix}/var/petidomo/petidomo.log
  82. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  83. %{SOURCE fsl.petidomo} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  84. ( cd etc.petidomo
  85. l_hostname=`%{l_shtool} echo -e '%h%d'`
  86. %{l_shtool} install -c -m - \
  87. -e "s;@l_hostname@;${l_hostname};g" \
  88. -e 's;@l_prefix@;%{l_prefix};g' \
  89. * $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo/
  90. )
  91. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  92. %{l_files_std} \
  93. '%config %{l_prefix}/etc/petidomo/*' \
  94. '%attr(6755,%{l_musr},%{l_mgrp}) %{l_prefix}/bin/petidomo' \
  95. '%config %{l_prefix}/etc/fsl/fsl.petidomo' \
  96. '%not %dir %{l_prefix}/etc/fsl'
  97. %files -f files
  98. %clean
  99. rm -rf $RPM_BUILD_ROOT
  100. %post
  101. # add hook into MTA configuration
  102. if [ ".$1" = .1 ]; then
  103. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_file`
  104. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_update`
  105. if [ ".$aliases_file" != . ]; then
  106. ( echo "petidomo: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=listserv\""
  107. echo "petidomo-approve: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=approve\""
  108. echo "petidomo-manager: postmaster"
  109. echo "owner-owner: petidomo-manager"
  110. echo "users: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=deliver --listname=users\""
  111. echo "users-request: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=listserv --listname=users\""
  112. echo "users-owner: postmaster"
  113. echo "owner-users: users-owner"
  114. ) |\
  115. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  116. -a -i "$RPM_INSTALL_PREFIX:petidomo" $aliases_file
  117. fi
  118. if [ ".$update_command" != . ]; then
  119. eval $update_command
  120. fi
  121. fi
  122. %postun
  123. # remove hook from MTA configuration
  124. if [ ".$1" = .0 ]; then
  125. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_file`
  126. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_update`
  127. if [ ".$aliases_file" != . ]; then
  128. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  129. -r -i "$RPM_INSTALL_PREFIX:petidomo" $aliases_file
  130. fi
  131. if [ ".$update_command" != . ]; then
  132. eval $update_command
  133. fi
  134. fi