New libpng 1.2.8 and HowTo automate unofficial DA upgrades

markus

Verified User
Joined
Nov 7, 2004
Messages
90
Location
Girona, Catalunya
The latest version of libpng is 1.2.8 (December 3, 2004), fixes a bug that will cause applications that strip the alpha channel (while reading a PNG) to crash.

More information can be found here:
http://www.libpng.org/pub/png/libpng.html

You can get the new file from here:
http://sourceforge.net/project/showfiles.php?group_id=5624

If you wish to upgrade using DA build tool:
1) cd /usr/local/directadmin/customapache
2) wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz
3) edit build and change PNG_VER=1.2.7 by PNG_VER=1.2.8
4) ./build php (y when asked to re-build linpng)
5) service httpd restart

However...

I wanted to automate this upgrade if for whatever reason I need to clean and rebuild my DA installation. Here's what I did:

HowTo automate unofficial DA upgrades

1) Go to the customapache directory
cd /usr/local/directadmin/customapache

2) Create a new directory to hold unofficial upgrades:
mkdir unofficial-upgrades

3) Modify DA build script like this:
Code:
#
# ---[ OPEN ]----------
#
/usr/local/directadmin/customapache/build
#
# ---[ FIND ]----------
#
#  NOTE --- this code is part of the getFile() function
#
		echo -e "Downloading\t\t$1...";
		if [ $OS = "FreeBSD" ]; then
			fetch ${WEBPATH}/${1};
		else
			wget ${WEBPATH}/${1} -O ${CWD}/${1};
		fi
#
# ---[ BEFORE ADD ]----------
#
		if [ -e ${CWD}/unofficial-upgrades/${1} ]
		then
			echo "Unofficial upgrade found...";
			cp -f ${CWD}/unofficial-upgrades/${1} ${CWD}/${1};
			return;
		fi
#
# ---[ SAVE ]----------
#

4) cd /usr/local/directadmin/customapache/unofficial-upgrades

5) wget http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz

6) edit build and change PNG_VER=1.2.7 by PNG_VER=1.2.8

7) ./build php (y when asked to re-build linpng)

8) service httpd restart

The advantage of the automated method is the ability to use the upgrades from your unofficial directory (instead of wgetting them from DA site), which is good if (for whatever reason) you need to clean an rebuild your apache.
 
Last edited:
The only thing to take into account is the changes to build script must be done manually again. The version numbers and the little modification to the getFile() function. I tried to make it as simple as possible.

It would be nice if DA added a feature like this, though. :rolleyes:
 
What you could do is create your own custom build script that would do the checks and move files as necassary and then excute continue and execute the command you gave to the build file.
Then you would always run your builds through the custom one you built.

Know what I'm saying?
 
hmmm....

I'm not sure if I like this idea, since all the information (versions, file names and routines like getFile) are hardcoded into the build script.

Creating another script would require to maintain (duplicate) some stuff.

I also thought about adding extra components to the build script. It would be nice, for instance, to build freetype before GD or PHP. It seems to me the easier way is patching the build script. You should also "remember" any changes manually made to any ./configure statement (with build itself, configure.php, etc.).

...agree? ...or
 
You wouldn't have to keep two copies of build. For example have a file named prebuild.sh
which collects the input options (all, zend, php, apache etc)
Then it executes your 5 lines of code to check and move files and then it executes the build file with the collected input options. In the end you would run prebuild.sh the same way you would do build without having to worry about your build becomming out of date or having to modify it every update. It would run your commands and then automatically run the build command with the given options.

Example:
prebuild zend
it runs your commands
build zend // executes build with the given option
 
Last edited:
It is sometimes necessary to make changes to the DA build script (for instance, if you wish to install freetype, you need to change the GD configuration parameters).

So, one way or the other it is necessary to remind any changes to the build script (also configure.php and configure.apache_ssl files) after a "build update".

So, I decided to leave my little "add-on" as it is. IMHO, It doesn't worth to make another script (prebuild.sh) for what I was trying to achieve here. I just wanted (with minimal changes to DA procedures) to avoid the build script from checking DA site for a package update that I already know it is outdated.

All I need to do is create a directory just once (unofficial-upgrades under customapache) and remind the custom changes to the DA build script (package versions, GD configuration, a couple of lines in the getFile() function).

I decided to keep track of other custom changes to the PHP build process outside of the DA build script as well (mostly based on notes in a simple text file :) ). I've been unable to find a common procedure to install for instance freetype 1 and 2 (main problem here is fixing the symbolic links if freetype was already installed in the system), the t1lib, etc.
 
Back
Top