220 lines
6.9 KiB
Makefile
220 lines
6.9 KiB
Makefile
## ############################################################################
|
|
## common targets:
|
|
## make apache-fe (worker, mod_proxy, mod_rewrite)
|
|
## make apache-be (prefork, mod_rpaf, php4)
|
|
##
|
|
## build-requirements:
|
|
## build-essential, bzip2
|
|
## libz-dev, libxml2-dev, libpng-dev, libjpeg-dev, libmysqlclient-dev
|
|
|
|
DESTDIR=/opt
|
|
|
|
MAKE_FLAGS=-j2
|
|
|
|
## ############################################################################
|
|
|
|
WGET := /usr/bin/wget --passive-ftp -nd
|
|
|
|
_SRCBASE=$(shell /bin/pwd)
|
|
_DOWNLOADS=$(_SRCBASE)/download
|
|
_SOURCES=$(_SRCBASE)/source
|
|
|
|
## ############################################################################
|
|
|
|
VERSION_APACHE=2.2.10
|
|
PACKAGE_APACHE=httpd-$(VERSION_APACHE).tar.bz2
|
|
DOWNLOAD_APACHE=http://apache.speedbone.de/httpd/$(PACKAGE_APACHE)
|
|
SOURCE_APACHE=$(_SOURCES)/httpd-$(VERSION_APACHE)
|
|
|
|
VERSION_RPAF=0.5
|
|
PACKAGE_RPAF=mod_rpaf-$(VERSION_RPAF).tar.gz
|
|
DOWNLOAD_RPAF=http://stderr.net/apache/rpaf/download/$(PACKAGE_RPAF)
|
|
SOURCE_RPAF=$(_SOURCES)/mod_rpaf-$(VERSION_RPAF)
|
|
|
|
VERSION_PHP=5.2.6
|
|
PACKAGE_PHP=php-$(VERSION_PHP).tar.bz2
|
|
DOWNLOAD_PHP=http://de3.php.net/get/$(PACKAGE_PHP)/from/this/mirror
|
|
SOURCE_PHP=$(_SOURCES)/php-$(VERSION_PHP)
|
|
|
|
VERSION_EACCELERATOR=0.9.5.3
|
|
PACKAGE_EACCELERATOR=eaccelerator-$(VERSION_EACCELERATOR).tar.bz2
|
|
DOWNLOAD_EACCELERATOR=http://bart.eaccelerator.net/source/$(VERSION_EACCELERATOR)/$(PACKAGE_EACCELERATOR)
|
|
SOURCE_EACCELERATOR=$(_SOURCES)/eaccelerator-$(VERSION_EACCELERATOR)
|
|
|
|
## ############################################################################
|
|
|
|
all: apache-fe apache-be
|
|
|
|
fetch: $(_DOWNLOADS)/$(PACKAGE_APACHE) \
|
|
$(_DOWNLOADS)/$(PACKAGE_RPAF) \
|
|
$(_DOWNLOADS)/$(PACKAGE_PHP) \
|
|
$(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
|
|
|
|
$(_DOWNLOADS)/$(PACKAGE_APACHE):
|
|
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_APACHE)
|
|
|
|
$(SOURCE_APACHE)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_APACHE)
|
|
mkdir -p $(SOURCE_APACHE)
|
|
tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_APACHE)
|
|
cat apache-layouts >> $(SOURCE_APACHE)/config.layout
|
|
touch $@
|
|
|
|
$(_DOWNLOADS)/$(PACKAGE_RPAF):
|
|
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_RPAF)
|
|
|
|
$(SOURCE_RPAF)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_RPAF)
|
|
mkdir -p $(SOURCE_RPAF)
|
|
tar -C $(_SOURCES) -xzf $(_DOWNLOADS)/$(PACKAGE_RPAF)
|
|
touch $@
|
|
|
|
$(_DOWNLOADS)/$(PACKAGE_PHP):
|
|
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_PHP)
|
|
|
|
$(SOURCE_PHP)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_PHP)
|
|
mkdir -p $(SOURCE_PHP)
|
|
tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_PHP)
|
|
touch $@
|
|
|
|
$(_DOWNLOADS)/$(PACKAGE_EACCELERATOR):
|
|
$(WGET) -P $(_DOWNLOADS) $(DOWNLOAD_EACCELERATOR)
|
|
|
|
$(SOURCE_EACCELERATOR)/.unpacked: $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
|
|
mkdir -p $(SOURCE_EACCELERATOR)
|
|
tar -C $(_SOURCES) -xjf $(_DOWNLOADS)/$(PACKAGE_EACCELERATOR)
|
|
touch $@
|
|
|
|
## ############################################################################
|
|
|
|
_BUILD_APACHE_FRONTEND=$(_SOURCES)/apache-frontend
|
|
|
|
apache-fe: $(_BUILD_APACHE_FRONTEND)/.installed
|
|
|
|
$(_BUILD_APACHE_FRONTEND)/.configured: $(SOURCE_APACHE)/.unpacked
|
|
mkdir -p $(_BUILD_APACHE_FRONTEND)
|
|
( cd $(_BUILD_APACHE_FRONTEND); \
|
|
$(SOURCE_APACHE)/configure \
|
|
--enable-layout=Frontend \
|
|
--with-mpm=worker \
|
|
--enable-proxy \
|
|
--enable-proxy-http \
|
|
--enable-proxy-balancer \
|
|
--enable-rewrite \
|
|
);
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_FRONTEND)/.compiled: $(_BUILD_APACHE_FRONTEND)/.configured
|
|
make $(MAKE_FLAGS) -C $(_BUILD_APACHE_FRONTEND) all
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_FRONTEND)/.installed: $(_BUILD_APACHE_FRONTEND)/.compiled
|
|
make -C $(_BUILD_APACHE_FRONTEND) install
|
|
rm -rf /etc/apache-fe/original
|
|
touch $@
|
|
|
|
apache-fe-clean:
|
|
rm -rf $(_BUILD_APACHE_FRONTEND)
|
|
|
|
## ############################################################################
|
|
|
|
_BUILD_APACHE_BACKEND=$(_SOURCES)/apache-backend
|
|
_BUILD_APACHE_BACKEND_PHP=$(_SOURCES)/apache-backend-php
|
|
|
|
apache-be: $(_BUILD_APACHE_BACKEND)/.installed \
|
|
$(SOURCE_RPAF)/.installed \
|
|
$(_BUILD_APACHE_BACKEND_PHP)/.installed \
|
|
$(SOURCE_EACCELERATOR)/.installed
|
|
|
|
$(_BUILD_APACHE_BACKEND)/.configured: $(SOURCE_APACHE)/.unpacked
|
|
mkdir -p $(_BUILD_APACHE_BACKEND)
|
|
( cd $(_BUILD_APACHE_BACKEND); \
|
|
$(SOURCE_APACHE)/configure \
|
|
--enable-layout=Backend \
|
|
--with-mpm=prefork \
|
|
--enable-so \
|
|
);
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_BACKEND)/.compiled: $(_BUILD_APACHE_BACKEND)/.configured
|
|
make $(MAKE_FLAGS) -C $(_BUILD_APACHE_BACKEND) all
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_BACKEND)/.installed: $(_BUILD_APACHE_BACKEND)/.compiled
|
|
make -C $(_BUILD_APACHE_BACKEND) install
|
|
rm -rf /etc/apache-be/original
|
|
touch $@
|
|
|
|
$(SOURCE_RPAF)/.compiled: $(SOURCE_RPAF)/.unpacked $(_BUILD_APACHE_BACKEND)/.installed
|
|
make -C $(SOURCE_RPAF) APXS=$(DESTDIR)/apache-backend/bin/apxs rpaf-2.0
|
|
touch $@
|
|
|
|
$(SOURCE_RPAF)/.installed: $(SOURCE_RPAF)/.compiled
|
|
make -C $(SOURCE_RPAF) APXS=$(DESTDIR)/apache-backend/bin/apxs install-2.0
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_BACKEND_PHP)/.configured: $(SOURCE_PHP)/.unpacked $(_BUILD_APACHE_BACKEND)/.installed
|
|
mkdir -p $(_BUILD_APACHE_BACKEND_PHP)
|
|
( cd $(_BUILD_APACHE_BACKEND_PHP); \
|
|
$(SOURCE_PHP)/configure \
|
|
--prefix=$(DESTDIR)/apache-backend-php \
|
|
--with-apxs2=$(DESTDIR)/apache-backend/bin/apxs \
|
|
--with-config-file-path=/etc/apache-be \
|
|
--disable-cgi \
|
|
--with-layout=GNU \
|
|
--disable-rpath \
|
|
--disable-ipv6 \
|
|
--disable-static \
|
|
--enable-sockets \
|
|
--enable-inline-optimization \
|
|
--with-zlib \
|
|
--with-regex=system \
|
|
--with-gd \
|
|
--with-png-dir=/usr \
|
|
--with-jpeg-dir=/usr \
|
|
--with-mysql=/usr \
|
|
);
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_BACKEND_PHP)/.compiled: $(_BUILD_APACHE_BACKEND_PHP)/.configured
|
|
make $(MAKE_FLAGS) -C $(_BUILD_APACHE_BACKEND_PHP) all
|
|
touch $@
|
|
|
|
$(_BUILD_APACHE_BACKEND_PHP)/.installed: $(_BUILD_APACHE_BACKEND_PHP)/.compiled
|
|
make -C $(_BUILD_APACHE_BACKEND_PHP) install
|
|
# copy default php.ini
|
|
cp $(SOURCE_PHP)/php.ini-dist /etc/apache-be/php.ini
|
|
# set extension-dir
|
|
sed -i /etc/apache-be/php.ini \
|
|
-e 's:^extension_dir.*$$:extension_dir = $(shell $(DESTDIR)/apache-backend-php/bin/php-config --extension-dir):'
|
|
touch $@
|
|
|
|
$(SOURCE_EACCELERATOR)/.configured: $(SOURCE_EACCELERATOR)/.unpacked $(_BUILD_APACHE_BACKEND_PHP)/.installed
|
|
( cd $(SOURCE_EACCELERATOR); \
|
|
$(DESTDIR)/apache-backend-php/bin/phpize; \
|
|
./configure \
|
|
--with-eaccelerator=shared \
|
|
--with-php-config=$(DESTDIR)/apache-backend-php/bin/php-config \
|
|
);
|
|
touch $@
|
|
|
|
$(SOURCE_EACCELERATOR)/.compiled: $(SOURCE_EACCELERATOR)/.configured
|
|
make $(MAKE_FLAGS) -C $(SOURCE_EACCELERATOR) all
|
|
touch $@
|
|
|
|
$(SOURCE_EACCELERATOR)/.installed: $(SOURCE_EACCELERATOR)/.compiled
|
|
make -C $(SOURCE_EACCELERATOR) install
|
|
# enable eaccelerator
|
|
sed $(SOURCE_EACCELERATOR)/eaccelerator.ini \
|
|
-e 's:^zend_extension:;zend_extension:' \
|
|
-e 's:;extension="eaccelerator.so":extension="eaccelerator.so":' \
|
|
-e 's:^eaccelerator.log_file.*$$:eaccelerator.log_file = "/var/log/apache-be/eaccelerator.log":' \
|
|
>> /etc/apache-be/php.ini
|
|
touch $@
|
|
|
|
apache-be-clean:
|
|
rm -rf $(_BUILD_APACHE_BACKEND)
|
|
rm -rf $(SOURCE_RPAF)
|
|
rm -rf $(_BUILD_APACHE_BACKEND_PHP)
|
|
rm -rf $(SOURCE_EACCELERATOR)
|
|
|
|
## ############################################################################
|