As sooner or later happens with all good boys and girls who administer their own Debian system, I'm learning about compiling from source.
In this case, it's motivated by trying to follow this guide:
http://www.linuxquestions.org/questi...d.php?t=257705 (including some Ubuntu- and Debian-specific stuff on page 4)
So far I've dug up the following resources to help myself:
http://www.debian.org/doc/manuals/ap....html#s-source
http://www.togaware.com/linux/surviv...ackages0.shtml
http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html (esp. sections 6.13-14)
http://www.aboutdebian.com/compile.htm (okay I haven't read this yet, but it looks useful)
My goal for compiling (besides learning by doing) is to recompile freetype 2 (source package freetype) with the bytecode interpreter enabled. I've downloaded the freetype source package into a directory I just named freetype:
Code:
/usr/local/src/freetype# ls -l
total 1280
drwxr-xr-x 3 root root 104 2005-12-17 23:16 freetype-2.1.7
-rw-r--r-- 1 root staff 53768 2005-04-24 15:47 freetype_2.1.7-2.4.diff.gz
-rw-r--r-- 1 root staff 677 2005-04-24 15:47 freetype_2.1.7-2.4.dsc
-rw-r--r-- 1 root staff 1245623 2003-11-15 01:32 freetype_2.1.7.orig.tar.gz
/usr/local/src/freetype/freetype-2.1.7# ls -l
total 1228
drwxr-xr-x 3 root root 4096 2005-12-17 23:16 debian
-rw-r--r-- 1 root root 930583 2003-11-10 15:26 freetype-2.1.7.tar.bz2
-rw-r--r-- 1 root root 99939 2003-11-10 15:26 ft2demos-2.1.7.tar.bz2
-rw-r--r-- 1 root root 215233 2003-11-10 15:26 ftdocs-2.1.7.tar.bz2
I've also done "# apt-get build-dep freetype" to get the other packages needed for compiling.
In this case, I don't want to use "dpkg-buildpackage -rfakeroot -b" to build the package, because my goal is not to "apply optimisations during the compilation process to suit your own environment." According to the TrueType readme (and the instructions in that LQ thread linked above), in order to enable the bytecode interpreter, I need to edit a line in "include/freetype/config/ftoption.h". Here's where I'm getting stuck. According to the APT how-to, the freetype-2.1.7/debian directory "contains the files needed for creating the .deb package," and the tar.bz2 files should be "the source package." By decompressing I verified that the compressed file freetype-2.1.7.tar.bz2 does indeed contain the source files, including the specific file I need to edit (include/freetype/config/ftoption.h).
What I don't get, and what these references slide right over with such lines as "now modify the source code to your own liking, then generate the Debian package," is what to do with these tar.bz2 files. It seems obvious I need to unpack them. However, if I decompress freetype-2.1.7.tar.bz2, I end up with a kind of odd directory structure:
Code:
freetype-2.1.7/
debian/
freetype-2.1.7/
builds/
ChangeLog
configure
devel/
docs/
include/
Jamfile
Jamfile.in
Jamrules
Makefile
objs/
README
src/
tests/
vms_make.com
freetype-2.1.7.tar.bz2
ft2demos-2.1.7.tar.bz2
ftdocs-2.1.7.tar.bz2
freetype_2.1.7-2.4.diff.gz
freetype_2.1.7-2.4.dsc
freetype_2.1.7.orig.tar.gz
...and so on. (I take it it's not necessary to decompress ft2demos-2.1.7.tar.bz2 and ftdocs-2.1.7.tar.bz2.) Thus I have a freetype-2.1.7/freetype-2.1.7/ directory, which kind of seems odd to me.
Since modifying the code you'd like to compile isn't really covered (without reading a developer's guide or similar), could somebody please hold my hand here? Is it as simple as decompressing the .tar.bz file as above, modifying the ftoption.h file, and then running
Code:
/usr/local/src/freetype/freetype-2.1.7$ fakeroot dpkg-buildpackage -b -uc -us
(followed by dpkg -i)?
Yes, I can just try it (and I will), but I really would like to understand what is going on here; I want to add a more explicit how-to for Debian to that thread.
Edit:
And obviously, it doesn't work the first time
Code:
/usr/local/src/freetype/freetype-2.1.7$ fakeroot dpkg-buildpackage -b -uc -us
dpkg-buildpackage: source package is freetype
dpkg-buildpackage: source version is 2.1.7-2.4
dpkg-buildpackage: source changed by Lars Wirzenius <liw@iki.fi>
dpkg-buildpackage: host architecture i386
debian/rules clean
dh_testdir
dh_testroot
rm -f build-stamp
rm -rf freetype-2.1.7 ft2demos-2.1.7 freetype-2.1.7
rm: cannot remove `freetype-2.1.7': Permission denied
rm: cannot remove `freetype-2.1.7': Permission denied
make: *** [clean] Error 1
Cheers