GNUe-SuSE-mini-HOWTO

Arjen Runsink

v0.06, 6-2-2003
This mini HOWTO describes how to get the GNUenterprise packages release 0.4.0 to work with the SuSE distribution version 8.0 and 8.1 inc combination with for example PostgreSQL or MySQL.

1. Introduction

While working with different projects and managing a few I found I had much need to dig deeper into databases and all the possibilities that come with them. Certainly to be able to use them for day to day work easy development tools wich create a good user interface are necessary. I found GNUenterprise and saw possibilities that met my demands. But installing the then current release on my machine with SuSE 7.3 was unsuccesfull. This was completely related to the fact that I was unable to get a working python wxGTK xPython combo. Now with SuSE 8.0 and the current release of GNUe (0.4.0) I thought to give it another try and document what I did in this HOWTO.

This HOWTO does not describe how to setup either MySQL or PostgreSQL. They come with excellent documentation.

1.1 Status of this document

This is the first version. I don't know if I am ready with it. Maybe things don't work in the end. If you have something I might add, or a correction send me an email: arjen(*a*t*)zeilers.net

2. Getting the raw materials

To start of let's get all that is needed.

2.1 The GNUe Packages

The GNUe packages can be downloaded from www.gnue.org. See the download section.

GNUe-Common-0.4.0.tar.gz

GNUe-Designer-0.4.0.tar.gz

GNUe-Forms-0.4.0.tar.gz

GNUe-Navigator-0.0.1.tar.gz

GNUe-Reports-0.0.2.tar.gz

and maybe also the samples and GEAS

Samples-0.4.0.tar.gz

GNUe-AppServer-0.0.2.tar.gz

2.2 egenix-mx-base (mxDateTime)

Egenix-mx-base provides, amongst some other stuff, the mxDateTime which could not be found anymore, the INSTALL that comes with GNUe mentions it, and that it possibly could be provided with python 2.1+. Well SuSE 8.0 comes with python 2.2 but no mxDateTime. For SuSE 8.1 it is more easy. The package is included with the distribution.

You can get the package at http://www.lemburg.com/python/mxExtensions.html

The file I used was egenix-mx-base-2.0.4.tar.gz

2.3 wxPythonSrc

I used the wxPythonSrc that can be found on http://wxPython.org/

There is a link to sourceforge there and make sure you get a file named like wxPythonSrc-x.x.x.tar.gz because this one contains it's own version of wxGTK which it will build nicely with. I used wxPythonSrc-2.4.x.tar.gz. It appears that wxPython 2.4.x does not use the string module, which may give you trouble with Designer. See here for a description and possible solution.

2.4 PySablot

PySablot is necessary for GNUe-Reports. You can get it at http://sourceforge.net/projects/pysablot/

By the time I got there the most recent package was just one: PySablot-0.1.tar.gz

2.5 SuSE packages

This is the easy part. You can use Yast to get and install some necessary packages that come with the SuSE distribution. These packages provide amongst others python and tools to compile and install the packages that do not come with SuSE.

As root do:

yast -i flex yacc make gcc gpp cpp checkinstall \ 
        m4 binutils autoconf automake glib-devel \
        glibc-devel gtk-devel python python-devel \ 
        postgresql-python sablot sablot-devel pyxml \
        xdevel gcc-c++
#for SuSE 8.1 add  python-egenix-mx-base

This list may not be complete. Perhaps not all dependencies for these packages are listed, but that is OK, yast will resolve them automatically. If I forgot something, a compile will stop and complain about it. Usually it can not find a library or executable.

You can easily check what rpm it is provided by using pin:

pin <filename>

Pin is a great tool to see what package contains a certain file or keyword or to get a list for a certain rpm. Install it with:

yast -i pin

To make sure that all the packages we just installed are the most current ones run the online update.

yast online_update

You may think that some packages are not necessary, maybe so, let me know, this saves disk clutter.

3. Compiling and installing

Everything should be done as a normal user, except where mentioned otherwise.

First setup the build directories

mkdir -p ~/BUILD/GNUe
cd ~/BUILD/GNUe 

3.1 egenix-mx-base

In ~/BUILD/GNUe do:

tar -xvzf ~/DOWNLOADS/GNUe/egenix-mx-base-2.0.4.tar.gz
cd egenix-mx-base-2.0.4
python setup.py build
su -c "checkinstall python setup.py install"

Now su asks for the root password, type it in. Normally instead of su -c checkinstall one would use make install or in this case python setup.py install. Checkinstall does a make install and generates an rpm. It asks a few details and then creates and installs the rpm and also saves it in /usr/src/packages/RPMS/i386. I use checkinstall because it is easy to make an unofficial rpm so the installed files can be easily removed without needing the source tree to do a make uninstall or installed on another host. And very few packages provide a make uninstall. This reduces clutter immensely. Checkinstall has lot's of nice options and the packages can be tailored even more than described in this document. Do a checkinstall --help for more info.

3.2 wxPythonSrc

I chose to install wxPython with it's own wxGTK version that came with it. SuSE does come with its own version of wxGTK which you could compile wxPython against. In that case you need wxPython with the same version as wxGTK (2.2.9). Be sure to read README.1s.txt from wxPython on how to proceed in that case.

in ~BUILD/GNUe do:

tar -xvzf ~/DOWNLOADS/GNUe/wxPythonSrc-2.3.3.1.tar.gz
cd wxPythonGTK-2.3.3.1   # or whatever the top-level dir is
mkdir build
cd build
export WXPREF=/usr/lib/wxPython
../configure --with-gtk \
             --prefix=$WXPREF \
             --enable-rpath=$WXPREF/lib \
             --enable-optimise \
             --enable-debug_flag \
             --with-libjpeg=builtin \
             --with-libpng=builtin \
             --with-libtiff=builtin \
             --with-zlib=builtin

This is almost the same as you can find in README.1st.txt, but with one alteration, I removed the option --with-opengl. My only motivation is that it says so in the regular GNUe docs :-) and it won't break anything if you already have wxGTK because this one is only used by wxPython.

make
cd ../locale
make allmo
cd ../build
su -c checkinstall

Again su asks for the root password.

Checkinstall asks a few questions. First if it should generate some default documentation. Just say yes. As a description I gave wxGTK for wxPython.

Normally checkinstall is run in the base dir of the package and guesses some info that is needed to build the rpm from the name of the directory, but since this is not the case now we also have to alter some other stuff. Using the number keys to choose each option change the following:

After that, just press return to continue and that is it.

Now for wxPython itself:

cd ../wxPython
python setup.py build IN_CVS_TREE=1\
       WX_CONFIG=$WXPREF/bin/wx-config \
       BUILD_GLCANVAS=0 BUILD_XRC=1
su -c "python setup.py install IN_CVS_TREE=1\
       WX_CONFIG=$WXPREF/bin/wx-config \
       BUILD_GLCANVAS=0 BUILD_XRC=1"

You can use checkinstall to install wxPython, but it creates an rpm that is dependend on 2 libs that are provided by the previous rpm we made, but not listes as such (they where specially build for our wxPython version). The rpm will be installed by checkinstall, but yast will nag you forever to deinstall it. The installation is done using distutils which comes with the current Python versions. There should be a way to de-install it using those tools, but at the moment I have no idea. Read the manuals.

3.3 PySablot

I had a hard time figuring this one out. Seems that it includes sablot.h and that one was build in some peculiar way. I think it was statically linked to some libs from expat or carries it's own version of the expat libs. But here are the tricks.

As root do the following:

ln -s /usr/lib/libexpat.a /usr/lib/libxmlparse.a
ln -s /usr/lib/libexpat.a /usr/lib/libxmltok.a
ln -s /usr/lib/libc.a /usr/lib/libiconv.a

Now as a normal user untar the archive while you are in ~BUILD/GNUe:

tar -xvzf ~/DOWNLOADS/GNUe/PySablot-0.1.tar.gz
cd PySablot-0.1
python setup.py build
su -c 'checkinstall python setup.py install'

And that's it.

3.4 The GNUe packages

All the packages depend on Common so install that one first.

cd ~/BUILD/GNUe
tar -xvzf ~/DOWNLOADS/GNUe/GNUe-Common-0.4.0.tar.gz
cd GNUe-Common-0.4.0

Usually GNUe installs itself in /usr/local/gnue and the binaries go into /usr/local/bin, but with SuSE these kind of packages are traditionally installed in /opt. I think this is one way of keeping everything orderly on disk, but tastes differ and the source and everything else, except for the license, is yours to change so what is keeping you anyway.

So edit setup.cfg.in and change the relevant lines in the section [install] as follows:

# Where to install GNUe's application files...
prefix = /opt/gnue
# Where to install GNUe executable symlinks...
exec_prefix = /opt/gnue/bin

Why edit setup.cfg.in instead of setup.cfg? Well the last is overwritten by the first during the build phase.

python setup.py build
su -c "checkinstall python setup.py install"

And ignore the warning about the fact that the modules were not installed in a path that is in Python's module search path.

Repeat these steps for the modules GNUe-Designer, GNUe-Forms, GNUe-AppServer and GNUe-Navigator

4. Configuring GNUe

GNUe provides a few sample config files which can be used to set it up for your system. These are located in etc in your gnue directory.

su                        # and enter the root password
cd /opt/gnue/etc
cp sample.connections.conf connections.conf
cp sample.gnue.conf gnue.conf
cp sample.report-filters.conf report-filters.conf

Now we need to edit some of the files.

First change site.conf till it looks somewhat like this.

common_python_path = '/opt/gnue/lib/python'
common_etc = '/opt/gnue/etc'
common_images = '/opt/gnue/share/images'
form_images = common_images
form_etc = common_etc
designer_images = common_images
designer_etc = common_etc

The most important fact is that the paths need to be changed because I installed in /opt/gnue.

Next connections.conf needs to be setup so it can connect to your database. There are some examples in that file, alter one to suit your needs and comment out the rest. Mine looks like this:

[test]
comment = Test Database
provider = postgresql
host = localhost
dbname = test

After this I could run the designer and connect to the database and create my first form using the wizard.