User:Kaze/OOo4KidsDebianPort

From downloading to building package

First step : Get the needed package

First of all, installation of package needed by the different process.

For downloading process :

sudo apt-get -y install subversion

For compiling process :

sudo apt-get -y install libarchive-zip-perl sudo apt-get -y install gcc sudo apt-get -y install g++ sudo apt-get -y install libpam-dev sudo apt-get -y install gperf sudo apt-get -y install python-dev sudo apt-get -y install curl sudo apt-get -y install libcurl4-gnutls-dev sudo apt-get -y install libxaw7-dev sudo apt-get -y install libxrandr-dev sudo apt-get -y install bison sudo apt-get -y install flex sudo apt-get -y install libgconf2-dev sudo apt-get -y install libgtk2.0-dev sudo apt-get -y install libcupsys2-dev sudo apt-get -y install libgstreamer0.10-dev sudo apt-get -y install libgstreamer-plugins-base0.10-dev sudo apt-get -y install libcups2-dev sudo apt-get -y install libxslt1-dev

For packaging process :

sudo apt-get -y install dpkg-dev sudo apt-get -y install cdbs sudo apt-get -y install dh-make sudo apt-get -y install devscripts

I suggest to copy all this into a file and execute it (with chmod 755 filename && ./filename)

Second step : Get the source using Subversion

In order to get the source of OOo4Kids, we have to choose a directory (example ~/srcs_OOo4Kids)

mkdir srcs_OOo4Kids cd ~/srcs_OOo4Kids/

Into the chosen directory, we perform :

svn co -r912 svn://svn.adullact.net/svnroot/ooo4kids1/trunk OOo4Kids
 * OOo4Kids 1.0

svn co -r974 svn://svn.adullact.net/svnroot/ooo4kids1/trunk OOo4Kids
 * OOo4Kids 1.1

Third step : Backup and archive sources

Sources are in ~/srcs_OOo4Kids/OOo4Kids/ in this exemple, so we should do a backup copy of all sources, in another directory (example: OOo4Kids_backup)

mkdir OOo4Kids_backup cp -rv OOo4Kids/ OOo4Kids_backup/

Then we have to remove all meta-data, like .svn/ directories : cd OOo4Kids_backup/ find. -name "*.svn" | xargs rm -vrf  {} find. -name "*.svn"

The second find command is useful, to find the last one, because one of them can not be remove with the previous command, probably because his path contain a space character. You can find it and remove i yourself thanks to rm -r

Now, we have to come back to previous directory and archive the all directory :

cd .. tar -cvzf ooo4kids_backup_srcs.tar.gz OOo4Kids_backup/

After this step, we have a archive with sources (compressed with gzip) without any meta-data into.

Fourth step : Launch the compilation

The procedure to compile OOo4Kids is nearly the same as describe on EnvironmentSetup/Linux page.

cd OOo4Kids/

You can copy this into a file to execute it (with the same method as First step)

./configure --disable-binfilter \ --disable-odk \ --with-lang="ar de es fi fr it nb nl pl ru sl uk zh-CN zh-TW" \ --disable-vba \ --disable-mozilla \ --with-system-python \ --with-system-libxml \ --enable-cups \ --disable-fontconfig \ --disable-gnome-vfs \ --with-use-shell=bash \ --with-java=no \ --with-OOo4Kids \ --disable-gtk \ --enable-presenter-extra-ui
 * Execution of the configure file


 * Execution of the bootstrap file

./bootstrap


 * Source the environment configuration file generated

PowerPC source LinuxPPCEnv.Set.sh

Intel x86 source LinuxX86Env.Set.sh


 * Add an environment variable

This variable set the compilation to make the pre-installed version in instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install

export PKGFORMAT=installed


 * Launch the building process

cd instsetoo_native/ build --all -P3

Fifth Step : Building package

Rename directory

Once the compilation is over, we can find the pre-installed version of OOo4Kids in instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/ /

cd unxlngi6.pro/OOo4Kids/installed/install/en-US/

We have a single directory name ooo4kids /. In order to use dh_make, to prepare the build, we have to rename the directory into ooo4kids-, create the Makefile and set the name and email of the maintainer, so :

Set variable

mv ooo4kids1.1 ooo4kids-1.1 cd ooo4kids-1.1/ export DEBFULLNAME=myname export DEBEMAIL=myemail@example.com

Create the Makefile

Now, create a Makefile with your text editor (here I use emacs)

emacs Makefile

and add the following :

DESTDIR= NAME=ooo4kids-1.1 DOCDIR=/usr/share/doc/$(NAME) LIB_O4K_DIR=/usr/lib/$(NAME) VERSION=1.1

install        : mkdir -p $(DESTDIR) $(DESTDIR)$(LIB_O4K_DIR) $(DESTDIR)$(DOCDIR) cp -r ure/ $(DESTDIR)$(LIB_O4K_DIR) cp -r basis$(VERSION)/ $(DESTDIR)$(LIB_O4K_DIR) cp -r licenses/ $(DESTDIR)$(DOCDIR) cp -r program/ $(DESTDIR)$(LIB_O4K_DIR) cp -r readmes/ $(DESTDIR)$(DOCDIR) cp -r share/ $(DESTDIR)$(LIB_O4K_DIR) cp THIRDPARTYLICENSEREADME.html $(DESTDIR)$(DOCDIR)

clean          : rm -rf $(DESTDIR)$(LIB_O4K_DIR) rm -rf $(DESTDIR)$(DOCDIR)

Use the command dh_make to create files used by the package building process, with the correct options :

dh_make -s --createorig

dh_make will ask you to confirm the informations used.

A lot of example files has been created, in debian/ directory. Inside debian/, use rm *.ex && rm *.EX

Now, we have to edit the rules file. There is two lines to comment, and two lines to add.

... ...
 * 1)        dh_installdocs

... ...
 * 1)        dh_shlibdeps

Add after dh_builddeb the two

...       dh_builddeb $(MAKE) DESTDIR=$(CURDIR)/debian/ooo4kids clean $(MAKE) clean ...

Add postinst and prerm files into debian/

postinst :


 * 1) !bin/sh

ln -sf /usr/lib/ooo4kids-1.1/program/soffice /usr/bin/ooo4kids1.1 ln -sf /usr/lib/ooo4kids-1.1/program/spadmin /usr/bin/ooo4kids1.1-printeradmin ln -sf /usr/lib/ooo4kids-1.1/basis1.1 /usr/lib/ooo4kids-1.1/basis-link ln -sf /usr/lib/ooo4kids-1.1/ /usr/lib/ooo4kids1.1

prerm :


 * 1) !bin/sh

rm -f /usr/lib/ooo4kids-1.1/program/soffice /usr/bin/ooo4kids1.1 rm -f /usr/lib/ooo4kids-1.1/program/spadmin /usr/bin/ooo4kids1.1-printeradmin rm -f /usr/lib/ooo4kids-1.1/basis1.1 /usr/lib/ooo4kids-1.1/basis-link rm -f /usr/lib/ooo4kids1.1