User:Kaze

Task

My primary tasks are :
 * Compare OOo320_m12 and OOo4Kids sources (diff files)
 * Build a Debian package FHS-compatible
 * Create a Debian repository
 * Create a script to do the all processus

Report

Here is a report with all step of the work, from downloading the source to create the repository with your own packages and sources into User:kaze/OOo4KidsDebianPort

Diary

13-11-2010 to 15-11-2010

I was writing a script to execute the packaging build processus. It have to be update (some details)

12-11-2010

The error was not an error, it was a mistake when I create the Sources.gz, it was a typing error. So sources and packages are working well.

11-11-2010

I found a error during my test. I can not download the source on my repository, whereas there is no problem with the package download. For the record, I use :

apt-get install apt-get source

When I try to get the source, apt-get send back :

E: Unable to find a source package for ooo4kids

This error is usually sent back when the package does not exist in the repository list in /etc/apt/sources.list or when the package's name is wrong.I have not find out why there is a problem with the source. I have some more ideas in my mind (like the archive's name)

08-11-2010 to 09-11-2010

In order to create a repository for Debian, I have to configure a HTTP server. I choose Apache2 (his popularity makes it easy to use, thanks to many tutorials and forums). When apache is installed, I create a file tree specific to repository. Example :

/ +-dists |  +-stable | +-main | | +-binary-alpha | | | | | +-binary-arm | | | | | +-binary-... | | | | | +-source | | | +-contrib | | +-binary-alpha | | | | | +-binary-arm | | | | | +-binary-... | | | | | +-source | | | +-non-free |  +-binary-alpha |  |  |   +-binary-arm |  |  |   +-binary-... |  |  |   +-source | +-testing | +-main | | +-binary-alpha | | | | | +-binary-arm | | | | | +-binary-... | | | | | +-source | |  | +-contrib | | +-binary-alpha | | | | | +-binary-arm | | | | | +-binary-... | | | | | +-source | | | +-non-free |  +-binary-alpha |  |  |   +-binary-arm |  |  |   +-binary-... |  |  |   +-source | +-unstable +-main | +-binary-alpha | |   | +-binary-arm | |   | +-binary-... | |   | +-source |   +-contrib | +-binary-alpha | |   | +-binary-arm | |   | +-binary-... | |   | +-source |   +-non-free +-binary-alpha |     +-binary-arm |     +-binary-... |     +-source

On an Apache server, '/' on the top of the file tree, is /var/www/, so I create the file tree from there :

mkdir -p /var/www/dists/testing/main/binary-i386 mkdir -p /var/www/dists/testing/main/source

Then, I have to copy all files in the right directory :

- The .deb files go into binary-i386/ - The .orig.tar.gz (or  .tar.gz), .change and if there is one .diff.gz files go into source/ - The .dsc files go into both directories (binary-i386/ and source/)

Once the copy is done, I create two files (Packages.gz and Sources.gz) needed by the repository with dpkg-scanpackages and dpkg-scansources :

dpkg-scanpackages binary-i386 /dev/null dists/testing/main/ | gzip -f9 > binary-i386/Packages.gz dpkg-scansources source /dev/null dists/testing/main/ | gzip -f9 > source/Sources.gz

Last step : Release file

I create a file named Release file into binary-i386 and source

binary-i386 version :

Archive : testing Version : 1.0 Component : main Origin :  Label : ooo4kids Architecture : i386

source version :

Archive : testing Version : 1.0 Component : main Origin :  Label : ooo4kids Architecture : source

Now, the repository is working. By adding this line to /etc/apt/sources.list

deb http:/// testing main deb-src http:/// testing main

Everyone can download a package added to the repository (if the package is into testing/main/) with :

apt-get install 

NOTE : All packages will have no authentication, so the command will send you a warning

03-11-2010

I extract orig.tar.gz and all archives in it. I will use a script (Eric's script if I found it, if not, I will write another script) to make the diff files.

01-11-2010

I download openoffice.org source, using :

sudo apt-get source openoffice.org

I have to make file of the difference between this version and OOo4Kids.

27-10-2010

So, finally, this is the new Makefile, with the clean rule :

DESTDIR= UREDIR=/usr/lib DOCDIR=/usr/share/doc/OOo4Kids SHARE_O4K_DIR=/usr/share/OOo4Kids USR_O4K_DIR=/usr/OOo4Kids LIB_O4K_DIR=/usr/lib/OOo4Kids install : mkdir -p $(DESTDIR) $(DESTDIR)$(SHARE_O4K_DIR) $(DESTDIR)$(USR_O4K_DIR) $(DESTDIR)$(LIB_O4K_DIR) $(DESTDIR)$(UREDIR) $(DESTDIR)$(DOCDIR) cp -r ure/ $(DESTDIR)$(UREDIR) cp -r basis1.0/ $(DESTDIR)$(SHARE_O4K_DIR) cp -r licenses/ $(DESTDIR)$(USR_O4K_DIR) cp -r program/ $(DESTDIR)$(LIB_O4K_DIR) cp -r readmes/ $(DESTDIR)$(LIB_O4K_DIR) cp -r share/ $(DESTDIR)$(LIB_O4K_DIR) cp LICENSE LICENSE.html README README.html THIRDPARTYLICENSEREADME.html $(DESTDIR)$(DOCDIR) clean  : rm -rf $(DESTDIR)$(UREDIR)/ure/ rm -rf $(DESTDIR)$(SHARE_O4K_DIR) rm -rf $(DESTDIR)$(USR_O4K_DIR) rm -rf $(DESTDIR)$(LIB_O4K_DIR) rm -rf $(DESTDIR)$(DOCDIR)

Now the Makefile can remove all files create while package building (The build process create the files to test the package)

WARNING : In the first line of clean rule, make sure to add /ure/ right after $(UREDIR), or you will perform a 'sudo rm -rf /usr/lib/' and say goodbye to all your librairies, and and good part of your system

When Makefile is done, I export the informations :

export DEBFULLNAME=" " export DEBEMAIL=" "

Next step is :

dh_make -s --createorig

Now I apply two small modifications of the debian/rules file :

binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installexamples dh_installman dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb make clean
 * 1)       dh_installdocs
 * 1)       dh_install
 * 2)       dh_installmenu
 * 3)       dh_installdebconf
 * 4)       dh_installlogrotate
 * 5)       dh_installemacsen
 * 6)       dh_installpam
 * 7)       dh_installmime
 * 8)       dh_python
 * 9)       dh_installinit
 * 10)       dh_installcron
 * 11)       dh_installinfo
 * 1)       dh_perl
 * 2)       dh_makeshlibs
 * 1)       dh_shlibdeps

Still comment the 'dh_shlibdeps' line, and add a 'make clean' at the end of the rule, to be sure to clean after all test (if you do not, in debian/ directory, you can see a directory create to test the package / and all the files in their directories like /usr/lib/OOo4Kids/... )

When debian/rules are done (do not forget to create 'debian/postinst' and 'debian/prerm' describe here the 25-10-2010), I still use the same way to build :

sudo dpkg-buildpackage -d -us -uc

'-us' and '-uc' parameters are for skipping the signature (with GnuPG) they can be remove but in this case you need to have GnuPG configured with already a personal key.

When the 'dpkg-buildpackage' finish the build, the debian package is build in the parent directory.

26-10-2010

In order to install all README and LICENSE files, I create a new directory in the package process :

/usr/share/doc/OOo4Kids/

This directory will contains :

LICENSE LICENSE.html README README.html THIRDPARTYLICENSEREADME.html

Now, all files will be installed. Next step, change the Makefile (for now, Makefile is still a test version)

25-10-2010

I use 'postinst' et 'prerm' to create and delete links.

debian/postinst :

ln -sf /usr/share/OOo4Kids/basis1.0/ /usr/lib/OOo4Kids/basis-link ln -sf /usr/lib/OOo4Kids/program/soffice /usr/bin/OOo4Kids
 * 1) !/bin/bash

debian/prerm :

rm /usr/lib/OOo4Kids/basis-link rm /usr/bin/OOo4Kids
 * 1) !/bin/bash

23-10-2010 to 24-10-2010

With minor changes in the soffice script, I can run OOo4Kids. This is the few changes, line 99 to 125 : export LD_LIBRARY_PATH="/usr/lib/ure/lib/:/usr/share/OOo4Kids/basis1.0/program/" "/usr/lib/OOo4Kids/basis-link/program/pagein" -L"/usr/lib/OOo4Kids/basis-link/program" \ ${sd_pagein_args} if [ -x "/usr/lib/OOo4Kids/basis-link/ure-link/bin/javaldx" ] ; then my_path=`"/usr/lib/OOo4Kids/basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"` if [ -n "$my_path" ] ; then LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH fi fi unset XENVIRONMENT
 * 1) Path for pre-installed version of OOo4Kids
 * 2) export LD_LIBRARY_PATH="$sd_prog/../ure/lib/"
 * 3) "$sd_prog/../basis-link/program/pagein" -L"$sd_prog/../basis-link/program" \
 * 1) Path for FHS-compatible version of OOo4Kids
 * 1) extend the ld_library_path for java: javaldx checks the sofficerc for us
 * 1) Pre-installed version of OOo4Kids
 * 2) if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then
 * 3)    my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \
 * 4) "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"`
 * 1) FHS-compatible version of  OOo4Kids

I only add the new path needed by the script. Now libraries are found and OOo4Kids can be run without error.

My next step is to create link during the installation process (basis-link, to 'basis1.0/', and OOo4Kids in 'usr/bin/' to soffice)

21-10-2010

I think error came from file(s) create by dh_make, but I have this error only when I try to build the OOo4Kids package. If I try to do a package with only a few files, no error are returned and the package works perfectly.

Again, a new method for dh_make :

dh_make -s --createorig

Thanks to '--createorig' dh_make can create the orig.tar.gz

Then, I edit the 'debian/rules'. In 'binary-arch' rule, this is the default settings (red is for my own modification) : binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installexamples dh_installman dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb
 * 1)       dh_installdocs
 * 1)       dh_install
 * 2)       dh_installmenu
 * 3)       dh_installdebconf
 * 4)       dh_installlogrotate
 * 5)       dh_installemacsen
 * 6)       dh_installpam
 * 7)       dh_installmime
 * 8)       dh_python
 * 9)       dh_installinit
 * 10)       dh_installcron
 * 11)       dh_installinfo
 * 1)       dh_perl
 * 2)       dh_makeshlibs
 * 1)       dh_shlibdeps

I comment the 'dh_shlibdeps' line, to try to build the package without it.

Once this is done, I create a Makefile in ooo4kids-1.0 :

DESTDIR= BASDIR=/usr/share/OOo4Kids LICDIR=/usr/OOo4Kids PRODIR=/usr/lib/OOo4Kids READIR=/usr/lib/OOo4Kids SHADIR=/usr/lib/OOo4Kids UREDIR=/usr/lib/ure install : mkdir -p $(DESTDIR) $(DESTDIR)$(BASDIR) $(DESTDIR)$(LICDIR) $(DESTDIR)$(PRODIR) $(DESTDIR)$(READIR) $(DESTDIR)$(SHADIR) $(DESTDIR)$(UREDIR) cp -r ure/* $(DESTDIR)$(UREDIR) cp -r basis1.0/* $(DESTDIR)$(BASDIR) cp -r licenses/* $(DESTDIR)$(LICDIR) cp -r program/* $(DESTDIR)$(PRODIR) cp -r readmes/* $(DESTDIR)$(READIR) cp -r share/* $(DESTDIR)$(SHADIR) clean  :

For now, 'clean' do nothing, so I can check what 'dpkg-buildpackage' does (create in ooo4kids-1.0/debian/ooo4kids/).

Last step, build the package. In ooo4kids-1.0/ directory :

sudo dpkg-buildpackage -d -us

The package is now create. Installation works too, but the soffice script was created in order to run OOo4Kids when all directories are in the same main directory. Now that directories are in different places, (to respect the FHS) the soffice script have to be changed.

20-10-2010

Warning solved: gpg was looking for a key, and I had not set any keys.

gpg --gen-key

select DSA and Elgamal (default), and confirm.

Same error, with dh_shlibdeps, appears.

19-10-2010

I am trying a new packaging method. I am using

dh_make -n -b

-b is the option for CDBS (Common Debian Build System). The good news is dh_shlibdeps do not send back an error.

The package-build command use gpg (GnuPG) and it send back a new error :

gpg: WARNING: unsafe ownership on configuration file `/home/kaze/.gnupg/gpg.conf'

I am working on it

15-10-2010

I am still looking or a way to resolve the dh_shlibdeps error, I try forums, tutorials, I google the error, I found no solution for my case. Keep looking, for today, but if I have no results, I will start to ask (external) help.

14-10-2010

I run many tests, with Coolgeek, to try to resolve this error, but they are all unsuccessful.

I define $LD_LIBRARY_PATH with the right path of the library, I rename the directory to his original name, I replace it in his original place (in the compilation directory).

In the debian/rule file, one of the command was disable, 'dh_makeshlibs'. i enable it but again, same error.

13-10-2010

I have many warning and errors when I want to make the package. I use the directory ooo4kids1.0

~/my_OOo4Kids/instsetoo_native/unxlngi6.pro/OOo4Kids/installed/install/fr/ooo4kids1.0/

In order to have this directory, I add this command before the build process

./configure ... ./bootstrap source LinuxX86Env.Set.sh export PKGFORMAT=installed cd instsetoo_native/ build --all -P3

then, copy the directory (and rename it)

mv ooo4kids1.0 -> ooo4kids-1.0

Now, inside this diretory, I use the command

dh_make -n -s

to create packaging files like 'control' (containing informations like maintener's name or maintener's email) and 'rules'.

Now you have to modify (if needed) the debian/control file, and build the package with

sudo dpkg-buildpackage

But instead of making a package, the packaging build is aborded, and an error comes :

dh_shlibdeps dpkg-shlibdeps: failure: couldn't find library libuno_cppu.so.3 needed by debian/ooo4kids/program/simplecanvas.uno.so (its RPATH is '/program:/program/../ure-link/lib'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dh_shlibdeps: command returned error code 512 make: *** [binary-arch] Error 1 dpkg-buildpackage: failure: fakeroot debian/rules binary gave error exit status 2

12-10-2010

Due to an error with a Makefile, I have to restart my work because the directory with all my work were deleted. I reinstall all my system and all sources.

08-10-2010 to 11-10-2010

I install OpenOffice, and compare file names of OOo4Kids with files of OpenOffice insalled. I succeed to find all files. Now I know where all files have to be. The directory "OOo4Kids" does not exist, and must be create by the package. I named it "OOo4Kids" as an exemple, it can be anything else

basis1.0/ --> /usr/share/"OOo4Kids"/basis1.0/ licenses/ --> /usr/"OOo4Kids"/licenses/ program/ ---> /usr/lib/"OOo4Kids"/program/ readmes/ ---> /usr/lib/"OOo4Kids"/readmes/ share/ -> /usr/lib/"OOo4Kids"/share/ ure/ ---> /usr/lib/ure/

07-10-2010

I run OOo4Kids build this morning, hopefully, it will be finished tomorrow. Thanks to many documents and tutorials, I understand few things about Debian packaging Policy. I will write here every step of the test and (hopefully again) every step of the final packaging. The hardest part will be to identify every files of OOo4Kids and define where they have to be (according to the FHS).

05-10-2010 to 06-10-2010

I am currently installing a virtual machine (with Debian) in order to try to install all the package I will create for my test. VirtualBox is causing some issues, mainly with USB Device. I try to fix it in order to avoid downloading the sources once again.

30-09-2010

Thanks to eric and his script, the recursive diff between OOo4Kids and OOo320_m12 is done. One diff file per directory was created, compressed and send to eric.

29-09-2010

I try to make a script in order to do a recursive diff, in a directory. I have an issue with the classification tree, but I intend to fix it, as soon as possible.

27-09-2010

Downloading the source files of OOo320_m12 and go-oo, and creating backup of the sources (in order to avoid to downloading them again). In the meantime, I read information about FHS and Debian packaging, in order to build a Debian package FHS-compatible.

20-09-2010 to 24-09-2010

Downloading the source files, understanding the compilation process, and compiling OOo4Kids 1.0.