Compiling PHP 5.3.x on Ubuntu (probably Debian based will work)

By some reason libc-client package in modern versions of ubuntu and debian don\’t work with php 5.3.x

One solution is compile a new version of libc-client lib.


#!/bin/sh -x
## for Ubuntu 9.10
## Author: Alejandro Leiva

cd $(dirname $0)
FILE_DIR=$(cd $(dirname $0) && pwd)

apt-get install -y libxml2-dev libbz2-dev libpng-dev libjpeg62-dev libc-client2007b-dev libmysqlclient15-dev libxslt1-dev apache2-mpm-prefork apache2-prefork-dev

cd /usr/src
wget ftp://ftp.cac.washington.edu/imap/imap-2007e.tar.Z
zcat imap-2007e.tar.Z | tar -xvf -
cd imap-2007e
make clean
make ldb EXTRAAUTHENTICATORS=gss PASSWDTYPE=gss
cp c-client/c-client.a c-client/libc-client.a
mkdir -p /usr/local/c-client-2007e/lib
mkdir -p /usr/local/c-client-2007e/include
cp c-client/*.h /usr/local/c-client-2007e/include
cp c-client/*.a /usr/local/c-client-2007e/lib

cd ..

wget http://es2.php.net/get/php-5.3.1.tar.bz2/from/es.php.net/mirror
tar xvjf php-5.3.1.tar.bz2
cd php-5.3.1
./configure --prefix=/usr/local/php-5.3.1 --with-bz2 --with-gd --with-zlib --with-mysql --with-xsl --with-gettext --enable-mbstring --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-pcntl --enable-ftp --with-imap=/usr/local/c-client-2007e --with-imap-ssl --with-kerberos --with-apxs2=$(which apxs2)
make
make install

Installing OTRS 2.4.5 on Debian Lenny


wget http://ftp.otrs.org/pub/otrs/otrs-2.4.5.tar.bz2

tar xvjf otrs-2.4.5.tar.bz2

mv otrs-2.4.5 /services/otrs

/services/otrs/bin/otrs.checkModules

# Perl dependencies.

# to update CGI to v3.38
apt-get install libcgi-pm-perl

# LWP::UserAgent | Date::Format
apt-get install libwww-perl

# Net::DNS
apt-get install libnet-dns-perl

# IO::Socket::SSL | Net::IMAP::Simple::SSL
apt-get install libio-socket-ssl-perl

# Net::LDAP
apt-get install libnet-ldap-perl

# GD stuff
apt-get install libgd-gd2-perl libgd-text-perl libgd-graph-perl

# PDF::API2
apt-get install libpdf-api2-perl

# SOAP::Lite | XML::Parser
apt-get install libsoap-lite-perl

# Add OTRS user
useradd -d /services/otrs -c \'OTRS user\' otrs
# Add OTRS user to www-data group
adduser otrs www-data

cp Kernel/Config.pm.dist Kernel/Config.pm
cd Kernel/Config
for foo in *.dist; do cp $foo `basename $foo .dist`; done

# webserver stuff
/services/otrs/bin/SetPermissions.pl --otrs-user=otrs --web-user=www-data --otrs-group=www-data --web-group=www-data /services/otrs/
cp apache2-httpd-new.include.conf /etc/apache2/sites-available/otrs
apt-get install libapache2-mod-perl2
a2enmod perl

Talk: Arquitectura de un game engine 3D

El sábado 7 de Febrero tuve la oportunidad de dar una charla sobre las bases de un un game engine 3D en la asociación DeSEA a la cual pertenezco.

Dejo colgado los slides de la charla aunque no tienen mucha chicha ya que los usé más como guión que como presentación formal. Prometo aumentarla con las notas de la charla y dejar algo más útil o/
 

Además tuve el privilegio de aparecer en prensa al día siguiente http://www.diariodesevilla.es/article/sevilla/345542/videojuegos/por/dentro.html

Agradecer a Javier Mairena (con el cual compartí la charla) que no me robara todo el tiempo ;)

Compiling gettext PHP extension on Mac Os 10.5.6

This works on new MacBooks with intel architecture.

Gettext compilation.

curl -O ftp://ftp.gnu.org/gnu/gettext/gettext-0.17.tar.gz   

tar xvzf gettext-0.17.tar.gz

cd gettext-0.17/gettext-runtime/

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe -no-cpp-precomp\” CCFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe\” CXXFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe\” LDFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load\” ./configure –enable-shared

make

sudo make install

PHP compilation.

curl -O http://www.opensource.apple.com/darwinsource/10.5.6/apache_mod_php-44.1/php-5.2.6.tar.bz2   

tar xvjf php-5.2.6.tar.bz2

cd php-5.2.6/ext/gettext/

phpize

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe -no-cpp-precomp\” CCFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe\” CXXFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe\” LDFLAGS=\”-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load\” ./configure

make

make install

Electric Fence && Leopard (Mac OS X 10.5.x) && CMake

You can get Electric Fence from http://perens.com/works/software/ElectricFence/

Comment out line #33 of file.c

$ make CFLAGS=\"-g -DPAGE_PROTECTION_VIOLATED_SIGNAL=SIGBUS\"
# make install

You will have a libefence compiled and installed in your Mac OS X system.

Now add the library to your main target in your CMakeLists.txt

# Add efence link
find_library(EFENCE_LIBRARY \"libefence.a\")
target_link_libraries(YOUR_MAIN_TARGET ${EFENCE_LIBRARY})

cmake and make (or build or whatever you are generating)

$ gdb /path/to/executable
(gdb) r
(gdb) bt

And useful debug info and an electric fence will appear :)

Have fun!