#########################################
## Compilation d'apache2 pour agat.net ##
## (c) 2002 JS GOETSCHY                ##
#########################################

apachesrc  = /usr/local/apachesrc2
prodprefix = /home/httpd2
apache     = httpd-2.0.40
php        = php-4.2.2
openssl    = openssl-0.9.6g
libmcrypt  = libmcrypt-2.4.22
libmcal    = libmcal-0.6

## UNPACKING
unpacking:
	cd ${apachesrc};\
	tar -xvzf ${openssl}.tar.gz;\
	tar -xvzf ${apache}.tar.gz;\
	tar -xvzf ${libmcrypt}.tar.gz;\
	tar -xvzf ${libmcal}.tar.gz;\
	bzip2 -cd ${php}.tar.bz2 | tar xv;\
	patch -p0 <php-apache2.patch

## ERASE
erase:
	cd ${apachesrc};\
	rm -rf ${openssl};\
	rm -rf ${apache};\
	rm -rf ${libmcrypt};\
	rm -rf ${libmcal};\
	rm -rf ${php};\



## OPENSSL
openssl:
	cd ${apachesrc};\
	cd ${openssl};\
	./config;\
	make;\
	make install


## APACHE
apacheinstall:
	cd ${apachesrc};\
	cd ${apache};\
	make install
apacheprod:	
	cd ${apachesrc};\
	cd ${apache};\
	./configure --prefix=${prodprefix} --libexecdir=${prodprefix}/modules --enable-modules="core so mpm_common ssl" --enable-mods-shared="access ations alias asis auth auth_anon auth_dbm auth_digest autoindex cahce cern_meta cgi charset_lite dav deflate dir env expires ext_filter headers imap include info log_config mime mime_magic negotition proxy rewrite setenvif speling status unique_id userdir usertrack vhost_alias" --with-mpm=prefork ;\
	make

## PHP
phpinstall:
	cd ${apachesrc};\
	cd ${php};\
	make install
phpprod:	
	cd ${apachesrc};\
	cd ${php};\
	./configure --with-config-file-path=${prodprefix}/conf --with-zlib --with-bz2 --with-gdbm --with-db2 --with-apxs2=${prodprefix}/bin/apxs --with-gettext --enable-versioning --with-mysql=/usr --with-pgsql=/usr --enable-track-vars --with-imap-ssl=/usr --with-imap --with-gd --with-ldap --enable-sockets --with-ftp --with-config-file-path=${prodprefix}/conf --with-kerberos --with-openssl=/usr/local/ssl --with-mcrypt=${apachesrc}/${libmcrypt} --with-mcal=../libmcal;\
        make

## LIBMCAL
libmcal:
	cd ${apachesrc};\
	cd libmcal;\
	sh configure;\
	make;\
	rm -rf /usr/local/mcal;\
	make install
	
## LIBMCRYPT
libmcrypt:
	cd ${apachesrc};\
	cd ${libmcrypt};\
	./configure;\
	make;\
	make install

