Wednesday, March 16, 2011

Fixing the Dependency Graphs in Bugzilla 3 EPEL RPM

Got the Epel bugzilla RPM?  I did, and it's pretty good, considering how challenging BZ is to package in a way that even begins to satisfy FHS and FSSTND.  Some collections of app-like data files are difficult to package correctly.

But the dependency graphs were pooched.  They seemed to want to send me off to http://host/var/lib/bugzilla/webdot/foo.png.  See why?  Yeah, but the problem is deeper than that, and it's not just a minor packaging bug:  bugzilla code actually uses a static CGI-bin dir to dictate the location of a dynamic spool dir containing the product of the dot calls -- the dependency graphs.  This is muy bad in terms of FHS.

But, after wading through a dozen PL files to get to where I could either mod the template, the code or the PM file containing the constants which dictate the locations and how one relates to the other ...

I just dumped in a cheap apache conf.d hack to provide a proper location for the png files without changing their real or interpreted location and without rendering in a cleaner fashion at all:

cat <<-EOF> /etc/httpd/conf.d/bugzilla-fix.conf
Alias /var/lib/bugzilla/data/webdot /var/lib/bugzilla/data/webdot
EOF
I mean, why mod the code if the next install will just hose the changes anyway (talk to me after to do the Dependency Graph Arrow Fix I've done for the last 8 years or so) and why change the templates, its generator or the PM file to suit?  Toss in a symlink so they just go to the right place while the code thinks it is generating the PNGs in the wrong place anyway?

The thing was bound to still be a bit of a mess either way, when I was done, and while I expect the package made a herculean effort to make the excellent package that it is, the source code uses so many wrong literal strings for everything that it's a big hairy ball of squidbait I didn't want to start to get into.  So I chased the code, did some soul-searching and optest for the ugliest but most reliable and maintainable fix I could.

Sorry.

Labels: , , , ,