# Quick and Dirty how-to about patching and rebuilding OpenOffice.org on Debian. # Created by Nagy Elemer Karoly (eknagy), with most info coming form Rene Engelhard. # This document is dual-licensed under GNU FDL 1.2 or public domain, as fits you better. # Version 1.04 (2007. Dec. 19.) for OpenOffice.org 2.0.4 (Debian Etch) # NOTES: Author is not a Debian developer and has only vague ideas about the correct build # process. This seems to work, though. # You might consider using schroot or vserver so you can regain some disk space: https://alioth.debian.org/docman/view.php/30192/21/debian-amd64-howto.html http://www.howtoforge.com/linux_vserver_debian_etch # You might need to use the linux32 personality (or linux32 program) to compile an # x86 ooo under amd64. # BUGS, PROBLEMS: # Rene wrote: "Where does it hang consuming swap? At gcj-4.2 aot-compiling the jars? Disable # that, gcj-4.2 broke itself with exactly those symptoms (BUILD_JARS_NATIVE=n in rules)" # add source lines to /etc/apt/sources.list: echo "deb-src http://ftp.de.debian.org/debian/ etch main non-free contrib" >>/etc/apt/sources.list echo "deb-src http://security.debian.org/ etch/updates main contrib non-free" >>/etc/apt/sources.list export LC_ALL="C" # Less locales warning from perl apt-get update apt-get upgrade # This will install up to 600 MB stuff apt-get build-dep openoffice.org apt-get install pbuilder devscripts # This will download about 300 MB stuff mkdir ooo_build_temp cd ooo_build_temp apt-get source openoffice.org # Ensure you have 3GB (2GB might be enough) ram + swap. You might need to add a swap file: http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/s1-swap-adding.html # The sweet point IMHO is 1.5 GB RAM on dedicated build machines. # Ensure you have at least 6-8 GB (10 GB) free space. # If you want to develop your own patch, you will recompile plenty of time, use ccache - it # speeds up recompilation IMHO by 3-5 times. As per detailes in debian/README.Debian: apt-get install ccache # you need EXTRAPACKAGES="ccache" in /etc/pbuilderrc, if you use pbuilder: pico /etc/pbuilderrc # OK, now you need to define your DEB_BUILD_OPTIONS. # en-US must be the first languege or build will fail. If you do not define it, all # languages will be built and expect a 20-hour build process (or more). # you can add "num-cups=X" if you have X processors, but logs might get mixed up. # More options are in debian/Readme* . export DEB_BUILD_OPTIONS="lang=en-US hu,ccache" # Original patches are in the downloaded source files, so if you can insert them there, you # may skip everything and run only "debuild binary-arch". # Ok, let's start. cd openoffice.org-2* # If you your patches are not in the source files, you should run debuild clean # to prepare the environment. # Now, you can add patches to the auto-patcher directory (they will appear in the # "ooo_build/build/current/applied_patches" directory later). # They are located under ooo-build/patches, under some subdirectories - ooo should be in # srcXXX. You should copy your patch there and change the "apply" file. # The apply file seems to have the format of "PATCH_FILENAME, REMARK_OR_BUG_ID, AUTHOR" # and is split to sections by "[ SECTION_NAME ]" - I guess only sections that are configured # are applied (Sections are described at the beginning of the file). cp MYPATCH ooo-build/patches/src680/. cp MYAPPLY ooo-build/patches/src680/. # Now it is time to configure and build the package itself. It will take a half day on a 2 GHz # machine (with ccache, from the second time, only a half hour). You might want to use the # "nice -n 19 debuild binary-arch" version (also consider ionice). debuild binary-arch # If you are not developing a patch, you are done. # From the second rebuild, this should also work: # debian/rules build # to rebuild binaries # debian/rules binary-arch # to rebuild packages # I do not know why these are not working in the first round, but it returns errors # about not finding "rm" and "sed", which is silly - ??? # If you are actually developing a patch, then first do a full "debuild binary-arch", and then # change files in build/current (Beware! Make backups as changes will be lost when you say # "debuild clean" or maybe even with "debuild binary-arch"?) # After changing the files, cd ooo-build/build/current LinuxX86-64Env.Set.sh # Or something similar, if you don't build on AMD64 - I am not sure dmake # (normal "make" does not work, and even dmake is just calling a perl script that rebuilds the # binaries - I found no way to rebuild only parts of it, but it builds binaries in 30 mins, so # it is tolerable. And I do not speak perl. # Then, you can copy (overwrite your originally installed files!!!) your freshly created files # like this one: cp ooo-build/build/current/sc/unxlngx6.pro/lib/libscui680lx.so /usr/lib/openoffice/program/. # Then, you can test your stuff with invoking like: oocalc # Then, if it works, you can include it into the autopatcher directory and rebuild the debs.