tomcat4-adapter.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## tomcat4-adapter.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. %define V_apr 0.9.4
  26. # package information
  27. Name: tomcat4-adapter
  28. Summary: Apache Jakarta Tomcat Webserver Adapter
  29. URL: http://jakarta.apache.org/
  30. Vendor: Apache Software Foundation
  31. Packager: The OpenPKG Project
  32. Distribution: OpenPKG
  33. Class: EVAL
  34. Group: Web
  35. License: Apache Software License 1.1
  36. Version: 4.1.30
  37. Release: 20040909
  38. # package options
  39. %option with_mod_webapp yes
  40. %option with_mod_jk no
  41. # list of sources
  42. Source0: http://www.apache.org/dist/jakarta/tomcat-4/v%{version}/src/jakarta-tomcat-connectors-%{version}-src.tar.gz
  43. Source1: tomcat4-adapter.conf
  44. Source2: http://www.apache.org/dist/apr/apr-%{V_apr}.tar.gz
  45. Patch0: tomcat4-adapter.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. BuildPreReq: apache, perl, gcc, make
  52. BuildPreReq: autoconf, libtool
  53. %if "%{with_mod_jk}" == "yes"
  54. BuildPreReq: automake
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. Apache Jakarta Tomcat Webserver Adapter %{version} is a glue code
  60. between the Apache webserver and Tomcat. This package contains
  61. mod_webapp and optionally also mod_jk.
  62. %track
  63. prog tomcat4-adapter = {
  64. version = %{version}
  65. url = http://www.apache.org/dist/jakarta/tomcat-4/
  66. regex = (v\d+\.\d+\.\d+)
  67. url = http://www.apache.org/dist/jakarta/tomcat-4/__NEWVER__/src/
  68. regex = jakarta-tomcat-connectors-(__VER__)-src\.tar\.gz
  69. }
  70. %prep
  71. %setup -q -n jakarta-tomcat-connectors-%{version}-src
  72. %setup -q -T -D -a 2 -n jakarta-tomcat-connectors-%{version}-src
  73. %patch -p0
  74. %build
  75. tempdir=`pwd`/tmp
  76. # first build apr
  77. ( cd apr-%{V_apr}
  78. CC="%{l_cc}" \
  79. CFLAGS="%{l_cflags -O}" \
  80. ./configure \
  81. --prefix=%{l_prefix} \
  82. --includedir=%{l_prefix}/include/apr \
  83. --enable-layout=GNU \
  84. --disable-threads \
  85. --disable-shared
  86. %{l_make} %{l_mflags -O}
  87. ) || exit $?
  88. # install apr temporaryly
  89. ( cd apr-%{V_apr}
  90. rm -rf $tempdir/*
  91. %{l_make} %{l_mflags} install DESTDIR=$tempdir
  92. ) || exit $?
  93. # now ready to build the connector
  94. # optionally build mod_webapp connector
  95. %if "%{with_mod_webapp}" == "yes"
  96. ( cd webapp
  97. %{l_shtool} subst \
  98. -e "s;-l\\\$(APR_LIB);`$tempdir%{l_prefix}/bin/apr-config --link-ld --libs`;g" \
  99. apache-1.3/Makefile.in
  100. ./support/buildconf.sh
  101. ./configure \
  102. --prefix=%{l_prefix} \
  103. --disable-java \
  104. --without-ant \
  105. --with-apr=$tempdir%{l_prefix}
  106. %{l_shtool} subst \
  107. -e "s;\\(-I%{prefix}/include/apr\\);-I$tempdir%{l_prefix}/include/apr \\1;g" \
  108. -e "s;\\(-I%{prefix}/lib\\);-L$tempdir%{l_prefix}/lib \\1;g" \
  109. Makedefs
  110. %{l_make} %{l_mflags}
  111. ) || exit $?
  112. %endif
  113. # optionally build mod_jk connector
  114. %if "%{with_mod_jk}" == "yes"
  115. ( cd jk/native
  116. libtoolize --force --automake --copy
  117. aclocal
  118. automake -a --foreign -i --copy
  119. autoconf
  120. ./configure \
  121. --prefix=%{l_prefix} \
  122. --with-apr=$tempdir%{l_prefix} \
  123. --with-apxs=%{l_prefix}/sbin/apxs \
  124. --enable-EAPI
  125. %{l_make} %{l_mflags} LIBTOOL=$PWD/libtool
  126. ) || exit $?
  127. %endif
  128. %install
  129. rm -rf $RPM_BUILD_ROOT
  130. # create installation tree
  131. %{l_shtool} mkdir -f -p -m 755 \
  132. $RPM_BUILD_ROOT%{l_prefix}/etc/tomcat4-adapter \
  133. $RPM_BUILD_ROOT%{l_prefix}/libexec/tomcat4-adapter \
  134. $RPM_BUILD_ROOT%{l_prefix}/var/tomcat4-adapter
  135. # install config
  136. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  137. %{SOURCE tomcat4-adapter.conf} \
  138. $RPM_BUILD_ROOT%{l_prefix}/etc/tomcat4-adapter/
  139. # optionally install mod_webapp DSO
  140. %if "%{with_mod_webapp}" == "yes"
  141. %{l_shtool} install -c -m 755 \
  142. webapp/build/mod_webapp.so \
  143. $RPM_BUILD_ROOT%{l_prefix}/libexec/tomcat4-adapter/
  144. %endif
  145. # optionally install mod_jk DSO
  146. %if "%{with_mod_jk}" == "yes"
  147. %{l_shtool} install -c -m 755 \
  148. jk/native/apache-1.3/mod_jk.so.0 \
  149. $RPM_BUILD_ROOT%{l_prefix}/libexec/tomcat4-adapter/mod_jk.so
  150. %endif
  151. # determine installation files
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  153. %files -f files
  154. %clean
  155. rm -rf $RPM_BUILD_ROOT