[SOLVED] Build of Gambas 3.6 RPM fails at symlinking of TTF

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] Build of Gambas 3.6 RPM fails at symlinking of TTF

Postby tleedavidson » Oct 17th, '14, 02:27

Hello,

I am trying to build an RPM of the newly released version of Gambas (3.6.0), which I downloaded from SourceForge (http://sourceforge.net/projects/gambas/ ... .0.tar.bz2), on my Mageia 3 box. (I figured it was worth a try.)

What I have done is take gambas-llvm-3.3.patch and gambas3.desktop from http://svnweb.mageia.org/packages/cauld ... t/SOURCES/ and put them in ~/rpmbuild/SOURCES along with the Gambas 3.6.0 tarball. Then I grabbed gambas3.spec (Rev. 750063) from http://svnweb.mageia.org/packages/cauld ... ent/SPECS/ and put it into ~/rpmbuild/SPECS.

I modified gambas3.spec ever so slightly: "Version: 3.5.4" became "Version: 3.6.0"; "Release: %mkrel 5" became "Release: %mkrel 1"; and I uncommented lines 595 and 596 to enable inclusion of the JIT (Just-In-Time compiler) component.

From a console in the ~/rpmbuild/SPECS directory, I executed:
Code: Select all
rpmbuild -ba gambas3.spec


It seems to build just fine. But when it gets to %install, it chokes on:
Code: Select all
ln -sf %{_datadir}/fonts/TTF/dejavu/DejaVuSans.ttf %{buildroot}%{_datadir}/gambas3/gb.sdl/DejaVuSans.ttf
"No such file or directory"

There is no gb.sdl directory in %{buildroot}%{_datadir}/gambas3/. All that is there is control, examples, icons, and info.

I understand that the gb.sdl component requires that font as per line 1028 of the spec file: "Requires: fonts-ttf-dejavu". But do I really need that symbolic link for a successful install? Or could I perhaps get it to work by placing the symlink in %{buildroot}%{_datadir}/gambas3/ ?

Or ... is it silly of me to even try making this whole idea work?

(Warning: I should probably admit that I know just about enough about building RPMs, to be dangerous.)
Last edited by tleedavidson on Oct 18th, '14, 08:01, edited 1 time in total.
Lee
tleedavidson
 
Posts: 54
Joined: Feb 14th, '12, 04:36

Re: Build of Gambas 3.6 RPM fails at symlinking of TTF file

Postby doktor5000 » Oct 17th, '14, 21:05

tleedavidson wrote:I understand that the gb.sdl component requires that font as per line 1028 of the spec file: "Requires: fonts-ttf-dejavu". But do I really need that symbolic link for a successful install? Or could I perhaps get it to work by placing the symlink in %{buildroot}%{_datadir}/gambas3/ ?

You don't need it for a successful install, rpm doesn't care about that symlink. Question is whether gambas requires that symlink and works properly.
Simply comment it out and try. Just checked the fedora package and there seems no such thing. http://pkgs.fedoraproject.org/cgit/gamb ... mbas3.spec
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18020
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Build of Gambas 3.6 RPM fails at symlinking of TTF file

Postby tleedavidson » Oct 17th, '14, 23:36

Thank you for your quick response, Doktor.

I questioned the Gambas-user list about that font and found that it has been replaced by a default font which is embedded in the SDL library. So, it is not needed.

After commenting out the symlink command and the 'Requires' line, I tried to build again. I got further this time, but another error:
Processing files: gambas3-gb-sdl-3.6.0-1.mga3.i586
error: File not found: /home/muck/rpmbuild/BUILDROOT/gambas3-3.6.0-1.mga3.i386/usr/share/gambas3/gb.sdl

RPM build errors:
File not found: /home/muck/rpmbuild/BUILDROOT/gambas3-3.6.0-1.mga3.i386/usr/share/gambas3/gb.sdl

The %files section for gb-sdl has this line:
"%{_datadir}/%{name}/gb.sdl"

And, given the error I first reported combined with the fact that all other %{_datadir}/%{name}/ file-spec lines append a subdirectory, I think that might be left-over from the external font requirement. So, I commented that out and am trying again. Will report back.
Lee
tleedavidson
 
Posts: 54
Joined: Feb 14th, '12, 04:36

Re: Build of Gambas 3.6 RPM fails at symlinking of TTF file

Postby tleedavidson » Oct 18th, '14, 07:56

Success!! :D

I had to do a bit more editing to the SPEC file than just to clear out vestiges of that deprecated TrueTypeFont requirement. I also had to add %package sections to accommodate some new components (inotify, markdown, & gb-media-form) and the sqlite2 component that is still included in the source but not packaged by the SPEC file. There were also some "orphan" files that were included but not packaged.

I have attached the resulting gambas3.spec file (as gambas3.spec.txt because, "The extension spec is not allowed."). I would have attached a diff-file also, but, for some reason, my diff picked out lines that were identical even down to the encoding. :roll:

_______________________________________________________________________
Now to summarize for anyone else wishing to do the same, here are the steps to take.

First, build the RPM.

  1. Ensure your system is set up to build RPMs. If you're unsure, read Packagers RPM tutorial up to section "3.3 Create .rpmmacros file" -- you don't need to do that for what we'll be doing.
  2. Downlad the Gambas 3.6.0 source archive from http://sourceforge.net/projects/gambas/ ... 2/download to your ~/rpmbuild/SOURCES directory.
  3. Download gambas-llvm-3.3.patch and gambas3.desktop from http://svnweb.mageia.org/packages/cauld ... t/SOURCES/ to your ~/rpmbuild/SOURCES directory.
  4. Download the attached gambas3.spec.txt file to your ~/rpmbuild/SPECS directory (not SOURCES). Rename it to remove the ".txt" extension.
  5. From a console, execute:
    Code: Select all
    rpmbuild -ba ~/rpmbuild/SPECS/gambas3.spec
Now, if your system is as slow as mine, go brew a pot of coffee, or go for a walk, or maybe take that long awaited trip around the world...

When the RPM build completes without errors (and we know it will, right?), check the ~/rpmbuild/RPMS directory. There should now be two subdirectories there. A noarch directory and a directory named according to your system's architecture, ie. i386, i586, x86_64 as noted in the Packagers RPM tutorial.

They're there? Great! Install your new package:
Code: Select all
sudo urpmi ~/rpmbuild/RPMS/noarch/*.rpm ~/rpmbuild/RPMS/$(arch)/*.rpm

Be sure to replace "$(arch)" with the correct designation for your system's architecture.

You can ignore the warnings saying the packages aren't signed. They don't need to be; you know who built them. And, when installation completes...

You should now have a working Gambas 3.6.0.
Attachments
gambas3.spec.txt
(36.34 KiB) Downloaded 104 times
Lee
tleedavidson
 
Posts: 54
Joined: Feb 14th, '12, 04:36


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest