Posted by kveroneau on Mon 21 Mar 2011 at 10:32
As Debian Lenny has a really outdated version of Engine X available, I took some time to update the package and compile it and note how it is done here for future references to anybody who needs to update an existing Debian package to use themselves.
Start by creating a directory to source your source files, lets call it $HOME/src
In this directory, run "apt-get source nginx" to download the Debian source code of the package.
After that as root, download all the building deps by running: "apt-get build-dep nginx".
Still as root, download some extra packages we'll need: "apt-get install build-essential fakeroot".
Exit the root shell and go back to your account where you downloaded the source.
Now for the fun part, downloading the latest version of Engine X and Debianizing it.
Use wget or just download the package using your browser, save and extract the source in your $HOME/src.
This will create a folder with the latest Engine X source code. Enter the directory and run:
cp -av ../nginx-0.6.32/debian ./
This will copy the "debian/" subdirectory from the source we fetched with apt-get into the directory we've just unpacked the newer version of nginx into.
Now lets edit the debian control files to update the version and change the configure options.
First edit debian/changelog and add the following to the very top:
nginx (0.8.53) unstable; urgency=low * Compiling new version into debian package. -- Kevin Veroneau <kveroneau@testing> Wed, 8 Sep 2010 12:45:27 -0600
(Obviously edit the information to suit your needs.)
The next file we need to edit is: debian/control, just update the maintainer and uploader to your own information.
Almost done, now edit the file debian/rules and change the configure options to suit your sites needs.
Feel free to edit any of the default configurations under debian/conf/ before running the final command.
The final command which will build the package into a DEB file using the updated source code is:
dpkg-buildpackage -us -uc
After running this command, the build process will start and create a nice DEB package in the parent directory. Be sure to run this command in the $HOME/src/nginx-0.8.53 folder. There is no need to run ./configure or make, as this program does everything for you.
I may at one point make a videocast on YouTube with the full process, as Engine X does compile very fast.
Happy package updating! Just remember to check for Security advisories, as this package will not update itself.