petidomo.spec 6.1 KB

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