apache-build/Makefile

196 lines
5.9 KiB
Makefile
Raw Normal View History

2006-11-04 13:18:42 +01:00
## ############################################################################
## common targets:
## make apache2-fe (worker, mod_proxy, mod_rewrite)
## make apache2-be (prefork, mod_rpaf, php4)
DESTDIR=/opt/
## ############################################################################
WGET := /usr/bin/wget --passive-ftp -nd
_SRCBASE=$(shell /bin/pwd)
_DOWNLOADS=$(_SRCBASE)/download
_SOURCES=$(_SRCBASE)/source
## ############################################################################
2006-11-05 16:08:05 +01:00
PACKAGE_APACHE2=httpd-2.0.59.tar.bz2
DOWNLOAD_APACHE2=http://apache.speedbone.de/httpd/$(PACKAGE_APACHE2)
2006-11-05 16:03:36 +01:00
SOURCE_APACHE2=$(_SOURCES)/httpd-2.0.59
2006-11-04 13:18:42 +01:00
2006-11-05 16:08:05 +01:00
PACKAGE_RPAF=mod_rpaf-0.5.tar.gz
DOWNLOAD_RPAF=http://stderr.net/apache/rpaf/download/$(PACKAGE_RPAF)
2006-11-04 13:18:42 +01:00
SOURCE_RPAF=$(_SOURCES)/mod_rpaf-0.5
2006-11-05 16:08:05 +01:00
PACKAGE_PHP4=php-4.4.4.tar.bz2
2006-11-05 16:21:42 +01:00
DOWNLOAD_PHP4=http://de3.php.net/get/$(PACKAGE_PHP4)/from/this/mirror
2006-11-05 16:03:36 +01:00
SOURCE_PHP4=$(_SOURCES)/php-4.4.4
2006-11-04 13:18:42 +01:00
2006-11-05 16:08:05 +01:00
PACKAGE_EACCELERATOR=eaccelerator-0.9.5.tar.bz2
DOWNLOAD_EACCELERATOR=http://surfnet.dl.sourceforge.net/sourceforge/eaccelerator/$(PACKAGE_EACCELERATOR)
2006-11-05 16:03:36 +01:00
SOURCE_EACCELERATOR=$(_SOURCES)/eaccelerator-0.9.5
2006-11-04 13:18:42 +01:00
## ############################################################################
2006-11-05 16:08:05 +01:00
all: apache2-fe apache2-be
2006-11-05 16:21:42 +01:00
fetch: $(_DOWNLOADS)/$(PACKAGE_APACHE2) \
$(_DOWNLOADS)/$(PACKAGE_RPAF) \
$(_DOWNLOADS)/$(PACKAGE_PHP4) \
$(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
2006-11-05 16:08:05 +01:00
$(_DOWNLOADS)/$(PACKAGE_APACHE2):
2006-11-04 13:18:42 +01:00
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_APACHE2)
2006-11-05 16:08:05 +01:00
$(SOURCE_APACHE2)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_APACHE2)
2006-11-05 16:21:42 +01:00
mkdir -p $(SOURCE_APACHE2)
2006-11-05 16:08:05 +01:00
tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_APACHE2)
2006-11-04 13:18:42 +01:00
touch $@
2006-11-05 16:08:05 +01:00
$(_DOWNLOADS)/$(PACKAGE_RPAF):
2006-11-04 13:18:42 +01:00
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_RPAF)
2006-11-05 16:08:05 +01:00
$(SOURCE_RPAF)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_RPAF)
2006-11-05 16:21:42 +01:00
mkdir -p $(SOURCE_RPAF)
2006-11-05 16:08:05 +01:00
tar -C $(_SOURCES) -xzf $(_DOWNLOADS)/$(PACKAGE_RPAF)
2006-11-04 13:18:42 +01:00
touch $@
2006-11-05 16:08:05 +01:00
$(_DOWNLOADS)/$(PACKAGE_PHP4):
2006-11-04 13:18:42 +01:00
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_PHP4)
2006-11-05 16:08:05 +01:00
$(SOURCE_PHP4)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_PHP4)
2006-11-05 16:21:42 +01:00
mkdir -p $(SOURCE_PHP4)
2006-11-05 16:08:05 +01:00
tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_PHP4)
2006-11-04 13:18:42 +01:00
touch $@
2006-11-05 16:08:05 +01:00
$(_DOWNLOADS)/$(PACKAGE_EACCELERATOR):
2006-11-04 13:18:42 +01:00
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_EACCELERATOR)
2006-11-05 16:08:05 +01:00
$(SOURCE_EACCELERATOR)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
2006-11-05 16:21:42 +01:00
mkdir -p $(SOURCE_EACCELERATOR)
2006-11-05 16:08:05 +01:00
tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
2006-11-04 13:18:42 +01:00
touch $@
## ############################################################################
_BUILD_APACHE2_FRONTEND=$(_SOURCES)/apache2-frontend
apache2-fe: $(_BUILD_APACHE2_FRONTEND)/.installed
$(_BUILD_APACHE2_FRONTEND)/.configured: $(SOURCE_APACHE2)/.unpacked
mkdir -p $(_BUILD_APACHE2_FRONTEND)
( cd $(_BUILD_APACHE2_FRONTEND); \
$(SOURCE_APACHE2)/configure \
--prefix=$(DESTDIR)/apache2-frontend/ \
--with-mpm=worker \
--enable-proxy \
--enable-proxy-http \
--enable-rewrite \
);
touch $@
$(_BUILD_APACHE2_FRONTEND)/.compiled: $(_BUILD_APACHE2_FRONTEND)/.configured
make -j2 -C $(_BUILD_APACHE2_FRONTEND) all
touch $@
$(_BUILD_APACHE2_FRONTEND)/.installed: $(_BUILD_APACHE2_FRONTEND)/.compiled
make -C $(_BUILD_APACHE2_FRONTEND) install
touch $@
apache2-fe-clean:
rm -rf $(_BUILD_APACHE2_FRONTEND)
## ############################################################################
_BUILD_APACHE2_BACKEND=$(_SOURCES)/apache2-backend
_BUILD_APACHE2_BACKEND_PHP=$(_SOURCES)/apache2-backend-php
apache2-be: $(_BUILD_APACHE2_BACKEND)/.installed \
$(SOURCE_RPAF)/.installed \
$(_BUILD_APACHE2_BACKEND_PHP)/.installed \
$(SOURCE_EACCELERATOR)/.installed
$(_BUILD_APACHE2_BACKEND)/.configured: $(SOURCE_APACHE2)/.unpacked
mkdir -p $(_BUILD_APACHE2_BACKEND)
( cd $(_BUILD_APACHE2_BACKEND); \
$(SOURCE_APACHE2)/configure \
--prefix=$(DESTDIR)/apache2-backend/ \
--with-mpm=prefork \
--enable-so \
);
touch $@
$(_BUILD_APACHE2_BACKEND)/.compiled: $(_BUILD_APACHE2_BACKEND)/.configured
make -j2 -C $(_BUILD_APACHE2_BACKEND) all
touch $@
$(_BUILD_APACHE2_BACKEND)/.installed: $(_BUILD_APACHE2_BACKEND)/.compiled
make -C $(_BUILD_APACHE2_BACKEND) install
touch $@
$(SOURCE_RPAF)/.compiled: $(SOURCE_RPAF)/.unpacked $(_BUILD_APACHE2_BACKEND)/.installed
make -C $(SOURCE_RPAF) APXS=$(DESTDIR)/apache2-backend/bin/apxs rpaf-2.0
touch $@
$(SOURCE_RPAF)/.installed: $(SOURCE_RPAF)/.compiled
make -C $(SOURCE_RPAF) APXS=$(DESTDIR)/apache2-backend/bin/apxs install-2.0
touch $@
$(_BUILD_APACHE2_BACKEND_PHP)/.configured: $(SOURCE_PHP4)/.unpacked $(_BUILD_APACHE2_BACKEND)/.installed
mkdir -p $(_BUILD_APACHE2_BACKEND_PHP)
( cd $(_BUILD_APACHE2_BACKEND_PHP); \
$(SOURCE_PHP4)/configure \
--prefix=$(DESTDIR)/apache2-backend-php/ \
--with-apxs2=$(DESTDIR)/apache2-backend/bin/apxs \
--disable-cli \
--disable-cgi \
--with-layout=GNU \
--disable-rpath \
--disable-ipv6 \
--disable-static \
--enable-sockets \
--enable-inline-optimization \
--with-zlib \
--with-regex=system \
--with-gd \
--with-mysql=/usr \
);
touch $@
$(_BUILD_APACHE2_BACKEND_PHP)/.compiled: $(_BUILD_APACHE2_BACKEND_PHP)/.configured
make -j2 -C $(_BUILD_APACHE2_BACKEND_PHP) all
touch $@
$(_BUILD_APACHE2_BACKEND_PHP)/.installed: $(_BUILD_APACHE2_BACKEND_PHP)/.compiled
make -C $(_BUILD_APACHE2_BACKEND_PHP) install
touch $@
$(SOURCE_EACCELERATOR)/.configured: $(SOURCE_EACCELERATOR)/.unpacked $(_BUILD_APACHE2_BACKEND_PHP)/.installed
( cd $(SOURCE_EACCELERATOR); \
$(DESTDIR)/apache2-backend-php/bin/phpize; \
./configure \
--with-eaccelerator=shared \
--with-php-config=$(DESTDIR)/apache2-backend-php/bin/php-config \
);
touch $@
$(SOURCE_EACCELERATOR)/.compiled: $(SOURCE_EACCELERATOR)/.configured
make -j2 -C $(SOURCE_EACCELERATOR) all
touch $@
$(SOURCE_EACCELERATOR)/.installed: $(SOURCE_EACCELERATOR)/.compiled
make -C $(SOURCE_EACCELERATOR) install
touch $@
apache2-be-clean:
rm -rf $(_BUILD_APACHE2_BACKEND)
rm -rf $(SOURCE_RPAF)
rm -rf $(_BUILD_APACHE2_BACKEND_PHP)
rm -rf $(SOURCE_EACCELERATOR)
## ############################################################################