LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-17-2005, 05:18 PM   #1
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Rep: Reputation: 39
compiling source packages (including manual changes)


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

Last edited by michapma; 12-17-2005 at 05:24 PM.
 
Old 12-18-2005, 04:06 PM   #2
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Original Poster
Rep: Reputation: 39
The build instructions for freetype say that you must use GNU make, and that the compilation should occur be
./compile [options]
make
make install (as root)

When I try to compile, here's what I get:
Code:
/usr/local/src/freetype/freetype-2.1.7/freetype-2.1.7$ ./configure --prefix=/usr
cd builds/unix; ./configure --prefix=/usr
./configure: line 88: conf17075.sh: Permission denied
./configure: line 89: conf17075.sh: Permission denied
chmod: cannot access `conf17075.sh': No such file or directory
./configure: line 201: conf17075.file: Permission denied
./configure: line 1160: config.log: Permission denied
make: *** [unix-def.mk] Error 1
I'm not sure just how I should be setting permissions, and for what. I don't want to compile as root when it's specifically instructed only to to "make install" as root.

I'm also not sure whether I should actually be compiling with ./configure, make, make install or with some Debian commands. I figure the Debian commands use configure, make and make install as necessary...

Any orientation or links are appreciated.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
software for compiling source packages hdo781 Debian 4 02-16-2007 10:54 AM
compiling from source and devel packages acedreds Linux - Software 1 09-22-2005 11:27 AM
optimizing slack (compiling packages from the source ISO disk) saurabhp_75 Slackware - Installation 1 02-28-2005 05:19 AM
compiling from source vs. binary packages oldi Linux - Newbie 4 06-04-2004 10:54 AM
Advanced Compiling and Uninstallation Of Packages From Source LinuxGeek Linux - Software 6 06-29-2002 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration