Apache Frontend/Backend buildscript
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
5.9KB

  1. ## ############################################################################
  2. ## common targets:
  3. ## make apache2-fe (worker, mod_proxy, mod_rewrite)
  4. ## make apache2-be (prefork, mod_rpaf, php4)
  5. DESTDIR=/opt/
  6. ## ############################################################################
  7. WGET := /usr/bin/wget --passive-ftp -nd
  8. _SRCBASE=$(shell /bin/pwd)
  9. _DOWNLOADS=$(_SRCBASE)/download
  10. _SOURCES=$(_SRCBASE)/source
  11. ## ############################################################################
  12. PACKAGE_APACHE2=httpd-2.0.59.tar.bz2
  13. DOWNLOAD_APACHE2=http://apache.speedbone.de/httpd/$(PACKAGE_APACHE2)
  14. SOURCE_APACHE2=$(_SOURCES)/httpd-2.0.59
  15. PACKAGE_RPAF=mod_rpaf-0.5.tar.gz
  16. DOWNLOAD_RPAF=http://stderr.net/apache/rpaf/download/$(PACKAGE_RPAF)
  17. SOURCE_RPAF=$(_SOURCES)/mod_rpaf-0.5
  18. PACKAGE_PHP4=php-4.4.4.tar.bz2
  19. DOWNLOAD_PHP4=http://de3.php.net/get/$(PACKAGE_PHP4)/from/this/mirror
  20. SOURCE_PHP4=$(_SOURCES)/php-4.4.4
  21. PACKAGE_EACCELERATOR=eaccelerator-0.9.5.tar.bz2
  22. DOWNLOAD_EACCELERATOR=http://surfnet.dl.sourceforge.net/sourceforge/eaccelerator/$(PACKAGE_EACCELERATOR)
  23. SOURCE_EACCELERATOR=$(_SOURCES)/eaccelerator-0.9.5
  24. ## ############################################################################
  25. all: apache2-fe apache2-be
  26. fetch: $(_DOWNLOADS)/$(PACKAGE_APACHE2) \
  27. $(_DOWNLOADS)/$(PACKAGE_RPAF) \
  28. $(_DOWNLOADS)/$(PACKAGE_PHP4) \
  29. $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
  30. $(_DOWNLOADS)/$(PACKAGE_APACHE2):
  31. $(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_APACHE2)
  32. $(SOURCE_APACHE2)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_APACHE2)
  33. mkdir -p $(SOURCE_APACHE2)
  34. tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_APACHE2)
  35. touch $@
  36. $(_DOWNLOADS)/$(PACKAGE_RPAF):
  37. $(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_RPAF)
  38. $(SOURCE_RPAF)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_RPAF)
  39. mkdir -p $(SOURCE_RPAF)
  40. tar -C $(_SOURCES) -xzf $(_DOWNLOADS)/$(PACKAGE_RPAF)
  41. touch $@
  42. $(_DOWNLOADS)/$(PACKAGE_PHP4):
  43. $(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_PHP4)
  44. $(SOURCE_PHP4)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_PHP4)
  45. mkdir -p $(SOURCE_PHP4)
  46. tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_PHP4)
  47. touch $@
  48. $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR):
  49. $(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_EACCELERATOR)
  50. $(SOURCE_EACCELERATOR)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
  51. mkdir -p $(SOURCE_EACCELERATOR)
  52. tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
  53. touch $@
  54. ## ############################################################################
  55. _BUILD_APACHE2_FRONTEND=$(_SOURCES)/apache2-frontend
  56. apache2-fe: $(_BUILD_APACHE2_FRONTEND)/.installed
  57. $(_BUILD_APACHE2_FRONTEND)/.configured: $(SOURCE_APACHE2)/.unpacked
  58. mkdir -p $(_BUILD_APACHE2_FRONTEND)
  59. ( cd $(_BUILD_APACHE2_FRONTEND); \
  60. $(SOURCE_APACHE2)/configure \
  61. --prefix=$(DESTDIR)/apache2-frontend/ \
  62. --with-mpm=worker \
  63. --enable-proxy \
  64. --enable-proxy-http \
  65. --enable-rewrite \
  66. );
  67. touch $@
  68. $(_BUILD_APACHE2_FRONTEND)/.compiled: $(_BUILD_APACHE2_FRONTEND)/.configured
  69. make -j2 -C $(_BUILD_APACHE2_FRONTEND) all
  70. touch $@
  71. $(_BUILD_APACHE2_FRONTEND)/.installed: $(_BUILD_APACHE2_FRONTEND)/.compiled
  72. make -C $(_BUILD_APACHE2_FRONTEND) install
  73. touch $@
  74. apache2-fe-clean:
  75. rm -rf $(_BUILD_APACHE2_FRONTEND)
  76. ## ############################################################################
  77. _BUILD_APACHE2_BACKEND=$(_SOURCES)/apache2-backend
  78. _BUILD_APACHE2_BACKEND_PHP=$(_SOURCES)/apache2-backend-php
  79. apache2-be: $(_BUILD_APACHE2_BACKEND)/.installed \
  80. $(SOURCE_RPAF)/.installed \
  81. $(_BUILD_APACHE2_BACKEND_PHP)/.installed \
  82. $(SOURCE_EACCELERATOR)/.installed
  83. $(_BUILD_APACHE2_BACKEND)/.configured: $(SOURCE_APACHE2)/.unpacked
  84. mkdir -p $(_BUILD_APACHE2_BACKEND)
  85. ( cd $(_BUILD_APACHE2_BACKEND); \
  86. $(SOURCE_APACHE2)/configure \
  87. --prefix=$(DESTDIR)/apache2-backend/ \
  88. --with-mpm=prefork \
  89. --enable-so \
  90. );
  91. touch $@
  92. $(_BUILD_APACHE2_BACKEND)/.compiled: $(_BUILD_APACHE2_BACKEND)/.configured
  93. make -j2 -C $(_BUILD_APACHE2_BACKEND) all
  94. touch $@
  95. $(_BUILD_APACHE2_BACKEND)/.installed: $(_BUILD_APACHE2_BACKEND)/.compiled
  96. make -C $(_BUILD_APACHE2_BACKEND) install
  97. touch $@
  98. $(SOURCE_RPAF)/.compiled: $(SOURCE_RPAF)/.unpacked $(_BUILD_APACHE2_BACKEND)/.installed
  99. make -C $(SOURCE_RPAF) APXS=$(DESTDIR)/apache2-backend/bin/apxs rpaf-2.0
  100. touch $@
  101. $(SOURCE_RPAF)/.installed: $(SOURCE_RPAF)/.compiled
  102. make -C $(SOURCE_RPAF) APXS=$(DESTDIR)/apache2-backend/bin/apxs install-2.0
  103. touch $@
  104. $(_BUILD_APACHE2_BACKEND_PHP)/.configured: $(SOURCE_PHP4)/.unpacked $(_BUILD_APACHE2_BACKEND)/.installed
  105. mkdir -p $(_BUILD_APACHE2_BACKEND_PHP)
  106. ( cd $(_BUILD_APACHE2_BACKEND_PHP); \
  107. $(SOURCE_PHP4)/configure \
  108. --prefix=$(DESTDIR)/apache2-backend-php/ \
  109. --with-apxs2=$(DESTDIR)/apache2-backend/bin/apxs \
  110. --disable-cli \
  111. --disable-cgi \
  112. --with-layout=GNU \
  113. --disable-rpath \
  114. --disable-ipv6 \
  115. --disable-static \
  116. --enable-sockets \
  117. --enable-inline-optimization \
  118. --with-zlib \
  119. --with-regex=system \
  120. --with-gd \
  121. --with-mysql=/usr \
  122. );
  123. touch $@
  124. $(_BUILD_APACHE2_BACKEND_PHP)/.compiled: $(_BUILD_APACHE2_BACKEND_PHP)/.configured
  125. make -j2 -C $(_BUILD_APACHE2_BACKEND_PHP) all
  126. touch $@
  127. $(_BUILD_APACHE2_BACKEND_PHP)/.installed: $(_BUILD_APACHE2_BACKEND_PHP)/.compiled
  128. make -C $(_BUILD_APACHE2_BACKEND_PHP) install
  129. touch $@
  130. $(SOURCE_EACCELERATOR)/.configured: $(SOURCE_EACCELERATOR)/.unpacked $(_BUILD_APACHE2_BACKEND_PHP)/.installed
  131. ( cd $(SOURCE_EACCELERATOR); \
  132. $(DESTDIR)/apache2-backend-php/bin/phpize; \
  133. ./configure \
  134. --with-eaccelerator=shared \
  135. --with-php-config=$(DESTDIR)/apache2-backend-php/bin/php-config \
  136. );
  137. touch $@
  138. $(SOURCE_EACCELERATOR)/.compiled: $(SOURCE_EACCELERATOR)/.configured
  139. make -j2 -C $(SOURCE_EACCELERATOR) all
  140. touch $@
  141. $(SOURCE_EACCELERATOR)/.installed: $(SOURCE_EACCELERATOR)/.compiled
  142. make -C $(SOURCE_EACCELERATOR) install
  143. touch $@
  144. apache2-be-clean:
  145. rm -rf $(_BUILD_APACHE2_BACKEND)
  146. rm -rf $(SOURCE_RPAF)
  147. rm -rf $(_BUILD_APACHE2_BACKEND_PHP)
  148. rm -rf $(SOURCE_EACCELERATOR)
  149. ## ############################################################################