petidomo.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ##
  2. ## petidomo.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2001 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/petidomo/
  29. Vendor: Peter Simons
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EXP]
  32. Group: Mail
  33. License: GPL
  34. Version: 4.0b1
  35. Release: 20011201
  36. # list of sources
  37. Source0: ftp://ftp.ossp.org/pkg/petidomo/petidomo-%{version}.tar.gz
  38. Source1: etc.petidomo.tar
  39. Source2: ftp://ftp.openpkg.org/DST/petidomo/fakesyslog.tar.gz
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20011227, bison, flex
  44. PreReq: OpenPKG, openpkg >= 20011227, 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 still performed by an MTA like Sendmail.
  52. %prep
  53. %setup0 -q -c
  54. %setup1 -q -T -D -a 1
  55. %setup2 -q -T -D -a 2
  56. %build
  57. fakesyslogdir="`pwd`/fakesyslog"
  58. ( cd fakesyslog
  59. CC="%{l_cc}" \
  60. CFLAGS="%{l_cflags -O}" \
  61. ./configure \
  62. --with-logfile=%{l_prefix}/var/petidomo/petidomo.log
  63. %{l_make} %{l_mflags}
  64. )
  65. ( cd petidomo-%{version}
  66. PATH="%{l_prefix}/bin:$PATH"
  67. export PATH
  68. CC="%{l_cc}" \
  69. CFLAGS="%{l_cflags -O}" \
  70. LDFLAGS="-L$fakesyslogdir -lfakesyslog" \
  71. LIBS="-lfakesyslog" \
  72. ./configure \
  73. --prefix=%{l_prefix} \
  74. --sysconfdir=%{l_prefix}/etc/petidomo
  75. %{l_make} %{l_mflags}
  76. )
  77. %install
  78. rm -rf $RPM_BUILD_ROOT
  79. ( cd petidomo-%{version}
  80. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  81. )
  82. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/petidomo
  83. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo
  84. rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/petidomo
  85. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo
  86. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/petidomo
  87. %{l_shtool} install -c -m 644 \
  88. /dev/null $RPM_BUILD_ROOT%{l_prefix}/var/petidomo/petidomo.log
  89. ( cd etc.petidomo
  90. l_hostname=`%{l_shtool} echo -e '%h%d'`
  91. %{l_shtool} install -c -m - \
  92. -e "s;@l_hostname@;${l_hostname};g" \
  93. -e "s;@l_prefix@;%{l_prefix};g" \
  94. * $RPM_BUILD_ROOT%{l_prefix}/etc/petidomo/
  95. )
  96. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  97. %{l_files_std} \
  98. '%config %{l_prefix}/etc/petidomo/*' \
  99. '%attr(6755,%{l_fsusr},%{l_fsgrp}) %{l_prefix}/bin/petidomo'
  100. %files -f files
  101. %clean
  102. rm -rf $RPM_BUILD_ROOT
  103. %post
  104. # add hook into MTA configuration
  105. if [ ".$1" = .1 ]; then
  106. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_file`
  107. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_update`
  108. if [ ".$aliases_file" != . ]; then
  109. ( echo "petidomo: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=listserv\""
  110. echo "petidomo-approve: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=approve\""
  111. echo "petidomo-manager: postmaster"
  112. echo "owner-owner: petidomo-manager"
  113. echo "users: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=deliver --listname=users\""
  114. echo "users-request: \"|$RPM_INSTALL_PREFIX/bin/petidomo --mode=listserv --listname=users\""
  115. echo "users-owner: postmaster"
  116. echo "owner-users: users-owner"
  117. ) |\
  118. $RPM_INSTALL_PREFIX/sbin/rpmtool config \
  119. -a -i "$RPM_INSTALL_PREFIX:petidomo" $aliases_file
  120. fi
  121. if [ ".$update_command" != . ]; then
  122. eval $update_command
  123. fi
  124. fi
  125. %postun
  126. # remove hook from MTA configuration
  127. if [ ".$1" = .0 ]; then
  128. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_file`
  129. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query mta_aliases_update`
  130. if [ ".$aliases_file" != . ]; then
  131. $RPM_INSTALL_PREFIX/sbin/rpmtool config \
  132. -r -i "$RPM_INSTALL_PREFIX:petidomo" $aliases_file
  133. fi
  134. if [ ".$update_command" != . ]; then
  135. eval $update_command
  136. fi
  137. fi