Sablotron

I need Sablotron and Expat compiled into PHP. It appears that Expat is included in the standard iWorx package. Any thoughts?

I’m using Fedora Core 3 and have found a Sablotron RPM. I’m not sure about recompiling iWorx’s PHP to include it.

Thanks,

Nick

I’d install the php SRPM:


rpm -Uvh http://updates.interworx.info/iworx/SRPMS/php-4.3.10-103.iworx.src.rpm

Then edit the php SPEC file, which is located at: /usr/src/redhat/SPECS/php.spec

Look for the configure command and add the necessary Sablotron flags to the config. Make sure your Sablotron RPM is installed and then just do:


rpmbuild -bb --with fdr30 /usr/src/redhat/SPECS/php.spec

This will build php and stick the resulting RPMS in /usr/src/redhat/RPMS/i386

There is a caveat. You need to edit the /etc/yum.conf file so future php updates don’t overwrite your custom version. We’ll try to get Sablotron support in the upcoming 4.3.11 release of PHP but I can’t make any promises today.

Chris

OK. I installed ‘rpmbuild’ and 26 ‘*-devel’ dependencies and then managed to get the build to complete. Lots of new RPMs are in /usr/src/redhat/RPMS/i386.

Questions:

  1. What’s next? I’m new to the wonderful world of RPMs. :confused: I assume the files built by the above process will be used to recompile PHP with Sablotron on board.

  2. How exactly do I edit ‘yum.conf’ so future php updates don’t overwrite my custom version? (I know how to edit the file but do not know the syntax for such an entry).

Thank you.

Nick

  1. What’s next? I’m new to the wonderful world of RPMs. I assume the files built by the above process will be used to recompile PHP with Sablotron on board.

You need to do a few things now.

  1. edit /usr/src/redhat/SPECS/php.spec, search for the ‘configure’ command and add whatever flags are needed there to make sablotron work.

  2. edit the bversion %define at the beginning of the file and change it from the current value to 1 + cur value. i.e. change 103 to 104.

  3. with those 2 done, run the rpmbuild command I mentioned.

  1. How exactly do I edit ‘yum.conf’ so future php updates don’t overwrite my custom version? (I know how to edit the file but do not know the syntax for such an entry).

edit /etc/yum.conf, look for the “exclude=” line and just add ‘php’ after the =, i.e. exclude=php

Chris

That’s done. Was it necessary to run ‘rpmbuild’ twice? I had already done it when I made post #3 of this thread. Couldn’t I just run it once, including the bversion edit? (I’m documenting this installation procedure on a test box before executing on a new server).

I’m still unclear how to arrive at a new build of PHP. I now have twice as many RPMs in /usr/src/redhat/RPMS/i386 (versions 103 and 104). PHPinfo reports the same build as when I started.

I have the sense that you are omitting something that is obvious to you and unknown to me. Do the new RPMs need to be installed now via some specific command?

Thanks for all of your help!

Nick

rpm -Uvh --force

Maybe the --force is needed since its the same version of PHP with a different “mod”. I’m not expert on this, just going by a kind of similar situation I had with ProFTP

http://interworx.info/forums/showthread.php?t=317

Sorry, I did omit the last part :).

You can delete any -103 RPMs in the RPMS/i386 directory. The -104’s are the ones you want and should install clenaly without forcing since I had you update the release ver.

Just rpm -Uvh <RPM NAME>

Where <RPM NAME> should be the list of RPMs you want to install. You may just do them all and use * for <RPM NAME>

Chris

also, when done, restart apache to have the new PHP take effect.

Chris

Victory! :slight_smile:

Thanks much for the help.

I have the whole thing documented - Contact me if anyone wants a copy.

great :slight_smile:

Do you plan to calls Sablotron functions to perform XSL transformation ?

Pascal

heu…

If I remember well should you not have to also recompile Apache with the option --disable-rule=EXPAT ?

Hi Pascal,

We are going to migrate from an older server that has Sablotron and Expat installed and compiled into PHP. Our developers have created sites requiring these applications (example: http://www.tcrhcc.org/).

I have not recompiled Apache with that option, in either case, and everything works fine.

Hello,

I’d like to use sablotron to have the xslt_create() function

As usual, I’ve done

rpm -Uvh php-4.3.11-100.iworx.src.rpm

then modified the /SPEC/php.spec file to :
change bversion to 102
and add these

     --with-zip                      \
    --with-mime-magic               \
    --enable-xslt                   \
    --with-xslt-sablot              \

in fact the

    --with-zip                      \
    --with-mime-magic               \

was already an update I made (bversion = 101) and used to work (it’s why for bversion = 102)

When I do

rpmbuild -bb --with cos3x /usr/src/redhat/SPECS/php.spec

I have these errors

checking whether to enable xslt support… yes
checking for XSLT Sablotron backend… yes
checking for libexpat dir for Sablotron XSL support… /usr
checking for iconv dir for Sablotron XSL support… no
checking for JavaScript for Sablotron XSL support… no
checking for Sablotron libraries in the default path… found in /usr
checking for sablot-config… found
checking for Sablotron version… >= 0.96
checking for iconv… (cached) yes
checking for SablotSetEncoding in -lsablot… no
checking for SablotGetOptions in -lsablot… no
checking for YAZ support… no
checking whether to include YP support… yes
checking for yp_match in -lnsl… no
checking for yp_match in -lc… no
configure: error: Unable to find required yp/nis library
error: Bad exit status from /var/tmp/rpm-tmp.13096 (%build)

Any idea ?

glibc and glibc-devel are installed

Thanks

Pascal

Hi

I added the --with-sablot-js and now everything is fine :slight_smile:

Thanks

Pascal

Hi Pascal,

Does ‘php-4.3.11-100.iworx.src.rpm’ include Sablotron and Expat?

Attached is my documentation for installing those applications and compiling PHP 4.3.10, just in case.

iWorx - Add Sablotron.txt (3.96 KB)

no they don’t. I think expat is now in php by default.

Thanks for your documentation but now everything is ok.

I’ve just installed these RPM:
sablotron
sablotron-devel
js
js-devel

Then changed the php.spec from iworx php RPM to add :
–enable-xslt
–with-xslt-sablot \

I had fogotten the
–with-sablot-js

It’s why for I had a compilation pbm

Thanks anyway :slight_smile: it may help others people

Pascal

I’m baaaak.

Now I’m trying to install Sablotron on my actual new server, which is a 64-bit machine running RHEL3. I am getting this message when trying to rebuild PHP:

configure: error: expat not found. To build sablotron you need the expat library.
error: Bad exit status from /var/tmp/rpm-tmp.14552 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.14552 (%build)

According to yum, expat and expat-devel are installed and up to date. My thought was that I neeeded the 64 bit versions installed, but I have had no luck getting that to happen.

Ideas?

Thanks,

[quote=IWorx-Chris;3184]We’ll try to get Sablotron support in the upcoming 4.3.11 release of PHP but I can’t make any promises today.

Chris[/quote]

Is this going anywhere?

Perhaps in the 3.0?

Anything about XSLT support?

Unfortunately, no, XSLT support has not been added by default to our PHP RPMs yet. Recompiling from source RPM is still your best option.