Getting error while installing TrueType fonts.

Place to discuss Fedora and/or Red Hat

Postby Void Main » Thu Apr 17, 2003 10:17 am

Ok, here's what I did that seemed to work perfectly:

# apt-get source XFree86
# cd /usr/src/redhat/SOURCES
# wget http://voidmain.is-a-geek.net/files/pat ... line.patch
# cd /usr/src/redhat/SPECS
# vi XFree86.spec

Add this line:
Code: Select all
Patch20006: XFree86-underline.patch


right under the line that starts out "Patch20005:" then save and exit (:wq).

Then run the prep stage to make sure the patches applied ok:

# rpmbuild -bp XFree86.spec

You may get an error because dependent development packages are not installed. If you do, install the dependent packages (it told me I needed to have "Glide3-devel" installed so I did a "apt-get install Glide3-devel" and then reran the rpmbuild command that finished up looking something like this:

Code: Select all
Patch #20004 (XFree86-4.2.0-tdfx-disable-dri-on-16Mb-cards-in-hires.patch):
+ patch -p0 -b --suffix .tdfx-disable-dri-on-16Mb-cards-in-hires -s
+ echo 'Patch #20005 (underline.patch):'
Patch #20005 (underline.patch):
+ patch -p0 -b --suffix .mkfontdir-perms -s
+ pwd
/usr/src/redhat/BUILD/XFree86-4.3.0
+ export 'RPM_OPT_FLAGS=-O2  -pipe -march=i386 -mcpu=i686'
+ RPM_OPT_FLAGS=-O2  -pipe -march=i386 -mcpu=i686
+ cat
+ exit 0


Above you can see the tail end of my output and see that the last two patches have been applied (one of which is the underline.patch).

The above "rpmbuild -bp" is sort of a waste of time because now it will be done again as part of the next command, I just wanted to show you that your patch will be applied. Now build the new binary RPMS that are identical to the ones that come with RH9 except for the addition of your underline.patch:

# rpmbuild -bb XFree86.spec

This may take a while and use a lot of disk space because XFree is a really large chunk of code. When it finishes you should have some RPMS in your /usr/src/redhat/RPMS/i386 directory that you can install. Here's the list:

Code: Select all
XFree86-100dpi-fonts-4.3.0-2.i386.rpm
XFree86-4.3.0-2.i386.rpm
XFree86-75dpi-fonts-4.3.0-2.i386.rpm
XFree86-base-fonts-4.3.0-2.i386.rpm
XFree86-cyrillic-fonts-4.3.0-2.i386.rpm
XFree86-devel-4.3.0-2.i386.rpm
XFree86-doc-4.3.0-2.i386.rpm
XFree86-font-utils-4.3.0-2.i386.rpm
XFree86-ISO8859-14-100dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-14-75dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-15-100dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-15-75dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-2-100dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-2-75dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-9-100dpi-fonts-4.3.0-2.i386.rpm
XFree86-ISO8859-9-75dpi-fonts-4.3.0-2.i386.rpm
XFree86-libs-4.3.0-2.i386.rpm
XFree86-libs-data-4.3.0-2.i386.rpm
XFree86-Mesa-libGL-4.3.0-2.i386.rpm
XFree86-Mesa-libGLU-4.3.0-2.i386.rpm
XFree86-syriac-fonts-4.3.0-2.i386.rpm
XFree86-tools-4.3.0-2.i386.rpm
XFree86-truetype-fonts-4.3.0-2.i386.rpm
XFree86-twm-4.3.0-2.i386.rpm
XFree86-xauth-4.3.0-2.i386.rpm
XFree86-xdm-4.3.0-2.i386.rpm
XFree86-xfs-4.3.0-2.i386.rpm
XFree86-Xnest-4.3.0-2.i386.rpm
XFree86-Xvfb-4.3.0-2.i386.rpm


Surely not all of them would have to be installed but I am not sure which packages are affected by the patch (and I'm not willing to dig that far into it at this point). Assuming that directory was clean prior to building the XFree86 RPMs you would:

# cd /usr/src/redhat/RPMS/i386
# rpm -Uvh *.rpm --force

Now, if you are running nVidia's drivers from their web site you will want to reinstall them if you used the above command (or take care not to install the *GL* and *GLU* rpms above as the nVidia driver comes with replacements to these libraries).

Restart X and you now should be running a patched copy.

Good luck!
Last edited by Void Main on Fri Apr 18, 2003 7:12 am, edited 1 time in total.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby topsoill » Thu Apr 17, 2003 12:03 pm

After doing: # rpmbuild -bb XFree86.spec

I don't get the underline patch mentioned:

Code: Select all
Patch #20004 (XFree86-4.2.0-tdfx-disable-dri-on-16Mb-cards-in-hires.patch):
+ patch -p0 -b --suffix .tdfx-disable-dri-on-16Mb-cards-in-hires -s
+ echo 'Patch #20005 (XFree86-4.2.99.2-mkfontdir-perms.patch):'
Patch #20005 (XFree86-4.2.99.2-mkfontdir-perms.patch):
+ patch -p0 -b --suffix .mkfontdir-perms -s
+ pwd
/usr/src/redhat/BUILD/XFree86-4.3.0
+ export 'RPM_OPT_FLAGS=-O2  -pipe -march=i386 -mcpu=i686'
+ RPM_OPT_FLAGS=-O2  -pipe -march=i386 -mcpu=i686
+ cat
+ exit 0


It just skips over patch20006. I checked my SOURCES directory and the patch is in it. The Spec file is as follows:

Code: Select all
Patch20004: XFree86-4.2.0-tdfx-disable-dri-on-16Mb-cards-in-hires.patch
# Force mkfontdir to make fonts.dir and encodings.dir, etc. mode 0644 Mike A. Harris <mharris@redhat.com>
# FIXME: Dawes doesn't like this one, perhaps reimplement as a commandline
# option.  Something to explore in the future.
Patch20005: XFree86-4.2.99.2-mkfontdir-perms.patch
Patch20006: underline.patch


Weird. Dunno why it won't work.
topsoill
user
user
 
Posts: 33
Joined: Sun Apr 13, 2003 10:25 pm

Postby Void Main » Thu Apr 17, 2003 12:40 pm

topsoill wrote:Weird. Dunno why it won't work.


My bad, I had a typo in my spec file and there needs to be two lines added, not just one. Here is my "working" spec file:

http://voidmain.is-a-geek.net/files/pat ... ree86.spec

In addition to the "Patch20006: XFree86-underline.patch" line you need to add a line "%patch20006 -p0 -b .underline" under the line that starts with "%patch20005":

Code: Select all
%patch20005 -p0 -b .mkfontdir-perms
%patch20006 -p0 -b .underline


And just as a side note, this patch really does nothing more than change 2 characters in the source. It adds a "-" on one line and removes a "-" in another line. Of course that's enough to cause you a problem. :)
Last edited by Void Main on Fri Apr 18, 2003 7:14 am, edited 2 times in total.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby topsoill » Thu Apr 17, 2003 4:51 pm

w00t!! that worked. YAY!!! my first patch. Works great! Links get underlined now, and it didn't mess up my RH install like last time.

Thanks to you void man. I really appreciate all the help.

One more question: How did you know where to place the instructions for the patch in the spec file? Do you just place them at the end of the last patch instruction? Also, can i delete all the stuff relating to XFree86 in the BUILD, SPECS,RPM, etc directories? Do i have to do that manually or is there a special command that will do it?

Thanks again!! :D :D :D
topsoill
user
user
 
Posts: 33
Joined: Sun Apr 13, 2003 10:25 pm

Postby Void Main » Thu Apr 17, 2003 5:11 pm

I clean them out manually. I don't believe there is a script to clean them but it wouldn't take more than about 5 seconds to write one.

As far as knowing where to place the patch instructions in the spec file, yes, I just added to the end of the list of patches Red Hat already includes. After you do a good bit of this stuff it just becomes sort of intuitive. As I said on the Ars forum it helps to have a programming background, at least to know how to apply patches manually, how RPMs are built, etc, etc. Man pages are even a really big help:

$ man rpmbuild
$ man patch
$ man diff

And an RPM building document from the guy who does the FreshRPMS site:
http://freshrpms.net/docs/fight/
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby topsoill » Thu Apr 17, 2003 5:49 pm

Thanks. :)

Trying to install another patch (heehee) but i think its done differently:



http://bugs.kde.org/show_bug.cgi?id=51381

I did:
1) apt-get source arts
2) put the patch in SOURCES directory.
3) modified the Spec file to include patch.
4) ran rpm -bp

I get this:
Code: Select all
[root@localhost SPECS]# rpmbuild -bp arts.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.58412
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ cd /usr/src/redhat/BUILD
+ rm -rf arts-1.1
+ /usr/bin/bzip2 -dc /usr/src/redhat/SOURCES/arts-1.1.tar.bz2
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd arts-1.1
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ echo 'Patch #0 (arts-1.1.0-vacopy.patch):'
Patch #0 (arts-1.1.0-vacopy.patch):
+ patch -p1 -b --suffix .x86_64 -s
+ echo 'Patch #1 (arts-1.1-gcc3.patch):'
Patch #1 (arts-1.1-gcc3.patch):
+ patch -p1 -b --suffix .gcc3 -s
+ echo 'Patch #2 (attachment.patch):'
Patch #2 (attachment.patch):
+ patch -p0 -s
The text leading up to this was:
--------------------------
|--- arts/mcop/mcoputils.cc     2002-12-03 19:32:51.000000000 +0100
|+++ arts/mcop/mcoputils.cc.sebi        2002-12-03 15:54:37.000000000 +0100
--------------------------
File to patch:


What do i choose to patch? I didn't get the above when patching XFree86.
topsoill
user
user
 
Posts: 33
Joined: Sun Apr 13, 2003 10:25 pm

Postby topsoill » Fri Apr 18, 2003 5:51 am

Anyone?

It seems like there is very little written about patches on the web.
topsoill
user
user
 
Posts: 33
Joined: Sun Apr 13, 2003 10:25 pm

Postby Void Main » Fri Apr 18, 2003 7:09 am

That patch was created against a slightly older version of arts. However, it had not been applied to the current version shipped with RH9 so I created a new patch and SPEC file for you.

After an "apt-get source arts" Put this in your /usr/src/redhat/SOURCES:
http://voidmain.is-a-geek.net/files/pat ... sebi.patch

and put this in your /usr/src/redhat/SPECS:
http://voidmain.is-a-geek.net/files/patches/arts.spec

# cd /usr/src/redhat/SPECS
# rpmbuild -bb arts.spec
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby topsoill » Fri Apr 18, 2003 8:31 pm

Thanks again, void man. That worked beautifully. Dunno what i would do if it weren't for these forums.

I got two questions though:

1) looks like you basically changed the arts version in the patch. Is that all you have to do to make it work with another version of arts?

2) You used -p1 instead of -p0 in the Spec file. How do you know which one to use?

I think that this should be in the RedHat tips section, since i couldn't find directions like these anywhere on the web. Dunno, but people seem to want to hide and keep secrets. Or maybe i just don't know where to look.
topsoill
user
user
 
Posts: 33
Joined: Sun Apr 13, 2003 10:25 pm

Postby Void Main » Sat Apr 19, 2003 6:04 am

Nobody is keeping any secrets that I know of. Have you read the man page for "patch" that I linked to in a previous post? I applied the patch manually and then created a new patch using the "diff -Naur relative/path/oldfile relative/path/newfile > file.patch" command.

Search Google for "patch diff" and here are a couple of pages that should give you a little better idea of what is going on.
http://www.linuxchix.org/content/course ... ng/lesson9
http://xml.apache.org/cocoon/howto/howto-patch.html
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby topsoill » Mon Apr 21, 2003 10:06 pm

Thanks for all the help, void man. :)
topsoill
user
user
 
Posts: 33
Joined: Sun Apr 13, 2003 10:25 pm

Previous

Return to Fedora/Red Hat

Who is online

Users browsing this forum: No registered users and 2 guests

cron