jitterbug.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ##
  2. ## jitterbug.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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: jitterbug
  27. Summary: Bug Tracking System (OSSP Version)
  28. URL: http://jitterbug.samba.org/
  29. Vendor: Andrew Tridgell
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Database
  33. License: GPL
  34. Version: 1.6.2.3
  35. Release: 20030717
  36. # list of sources
  37. Source0: ossp-jitterbug-%{version}.tar.gz
  38. Source1: config.tar
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20030717
  43. PreReq: OpenPKG, openpkg >= 20030717, MTA, apache, gzip
  44. BuildPreReq: zlib
  45. PreReq: zlib
  46. AutoReq: no
  47. AutoReqProv: no
  48. %description
  49. JitterBug is a web based bug tracking system. It was originally
  50. developed by the Andrew Tridgell to handle bug tracking, problem
  51. reports and queries from Samba users.
  52. %prep
  53. %setup -q -n ossp-jitterbug-%{version}
  54. %build
  55. CC="%{l_cc}" \
  56. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  57. LDFLAGS="%{l_ldflags}" \
  58. ./configure \
  59. --prefix=%{l_prefix} \
  60. --sysconfdir=%{l_prefix}/etc/jitterbug
  61. %{l_shtool} subst \
  62. -e 's;^\(LIBS *=.*\)$;\1 %{l_ldflags} -lz;' \
  63. Makefile
  64. %{l_make} %{l_mflags -O}
  65. %install
  66. rm -rf $RPM_BUILD_ROOT
  67. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  68. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  69. %{l_tar} xvf %{SOURCE config.tar}
  70. ( cd config
  71. l_hostname=`%{l_shtool} echo -e %h`
  72. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  73. %{l_shtool} subst -v \
  74. -e "s;@l_hostname@;$l_hostname;g" \
  75. -e "s;@l_domainname@;$l_domainname;g" \
  76. -e 's;@l_prefix@;%{l_prefix};g' \
  77. -e 's;@l_musr@;%{l_musr};g' \
  78. -e 's;@l_muid@;%{l_muid};g' \
  79. -e 's;@l_mgrp@;%{l_mgrp};g' \
  80. -e 's;@l_mgid@;%{l_mgid};g' \
  81. -e 's;@l_nusr@;%{l_nusr};g' \
  82. -e 's;@l_nuid@;%{l_nuid};g' \
  83. -e 's;@l_ngrp@;%{l_ngrp};g' \
  84. -e 's;@l_ngid@;%{l_ngid};g' \
  85. `find . -type f -print`
  86. rm -rf */*.orig */.[a-z]*.orig >/dev/null 2>&1 || true
  87. %{l_shtool} mkdir -f -p -m 755 \
  88. $RPM_BUILD_ROOT%{l_prefix}/etc/jitterbug
  89. %{l_shtool} mkdir -f -p -m 755 \
  90. $RPM_BUILD_ROOT%{l_prefix}/var/jitterbug/bugdb
  91. %{l_shtool} install -c -m - etc/* \
  92. $RPM_BUILD_ROOT%{l_prefix}/etc/jitterbug/
  93. cp -rp var/* var/.[a-z]* \
  94. $RPM_BUILD_ROOT%{l_prefix}/var/jitterbug/bugdb/
  95. )
  96. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  97. %{l_files_std} \
  98. '%config %{l_prefix}/etc/jitterbug/*' \
  99. '%attr(04755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/jitterbug-*'
  100. %files -f files
  101. %clean
  102. rm -rf $RPM_BUILD_ROOT
  103. %post
  104. if [ ".$1" = .1 ]; then
  105. # add hook into MTA configuration
  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 "bugdb: \"|$RPM_INSTALL_PREFIX/bin/jitterbug-mail bugdb-guest\""
  110. echo "owner-bugdb: postmaster"
  111. ) |\
  112. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  113. -a -i "$RPM_INSTALL_PREFIX:jitterbug" $aliases_file
  114. if [ ".$update_command" != . ]; then
  115. eval $update_command
  116. fi
  117. fi
  118. # add hook into Apache configuration
  119. apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
  120. if [ -f $apacheconf ]; then
  121. ( echo "Alias /bugdb $RPM_INSTALL_PREFIX/var/jitterbug/bugdb"
  122. echo "<Directory $RPM_INSTALL_PREFIX/var/jitterbug/bugdb>"
  123. echo " AllowOverride all"
  124. echo "</Directory>"
  125. ) |\
  126. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  127. -a -i "$RPM_INSTALL_PREFIX:jitterbug" $apacheconf
  128. fi
  129. fi
  130. %postun
  131. if [ ".$1" = .0 ]; then
  132. # remove hook from MTA configuration
  133. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  134. update_command=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  135. if [ ".$aliases_file" != . ]; then
  136. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  137. -r -i "$RPM_INSTALL_PREFIX:jitterbug" $aliases_file
  138. if [ ".$update_command" != . ]; then
  139. eval $update_command
  140. fi
  141. fi
  142. # remove hook from Apache configuration
  143. apacheconf="$RPM_INSTALL_PREFIX/etc/apache/apache.conf"
  144. if [ -f $apacheconf ]; then
  145. $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \
  146. -r -i "$RPM_INSTALL_PREFIX:jitterbug" $apacheconf
  147. fi
  148. fi