Page 1 of 1

[SOLVED] How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 29th, '13, 19:18
by lectus
Hi! Recently I moved to Mageia 3.
Good distro, but I need to install this package: http://software.opensuse.org/package/fr ... -ttf-fonts

How can I convert this RPM to be compatible with Mageia? Or maybe compile the source RPM in Mageia format.

Any ideas?

Re: How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 29th, '13, 20:13
by doktor5000
All the font packages available from Mageia repos do not suffice?

If you want to build this package for Mageia, install it as normal user
and then adapt the .spec so that it builds sucessfully.

Check e.g. viewtopic.php?f=41&t=5530 and also https://wiki.mageia.org/en/Packaging_for_beginners

Re: How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 29th, '13, 20:22
by doktor5000
FWIW, here's the spec, builds fine under Mageia:

Code: Select all
#
# spec file for package free-ttf-fonts
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           free-ttf-fonts
Version:        1.0
Release:        %mkrel 1
Summary:        Free TrueType Art Fonts
License:        Artistic-1.0 and GPL-2.0+ and SUSE-Public-Domain
Group:          System/X11/Fonts
# Fonts from http://www.dustismo.com/
# Licensed under GPL
Source0:        Dustismo.zip
Source1:        Junkyard.zip
Source2:        Swift.zip
Source3:        El_Abogado_Loco.zip
Source4:        MarkedFool.zip
Source5:        Wargames.zip
Source6:        balker.zip
Source7:        ItWasntMe.zip
Source8:        PenguinAttack.zip
Source9:        Winks.zip
Source10:       flatline.zip
# Fonts from http://www.thibault.org/fonts/isabella/
# Licensed under GPL
Source11:       Isabella.ttf.tar.gz
Source12:       latex-xft-fonts-0.1.tar.gz
# Fonts from http://www.larabiefonts.com/
# Licensed under a freeware license
Source100:      allfonts.zip
BuildRequires:  dos2unix
BuildRequires:  fontpackages-devel
BuildRequires:  unzip
BuildArch:      noarch

%description
More than 300 free fonts in True Type format. Most of them are in the
art style and unusable as desktop fonts, but are great for any poster
or illustration.

The fonts are copyrighted under the GPL or a Freeware license, but
donations are requested by the artists. Look in
/usr/share/doc/packages/free-ttf-fonts/ for further information.

%prep

%build

%install
mkdir -p %{buildroot}%{_fontdir}
mkdir -p %{buildroot}/%_docdir/%{name}
pushd %{buildroot}%{_fontdir}
    for i in %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE100} \
      ; do
   unzip -o "$i"
    done
    for i in *.TTF *.TXT; do
        mv "$i" "`echo $i|tr '[A-Z]' '[a-z]'`"
    done
    dos2unix *.txt
    install -m 0644 *.txt %{buildroot}/%_docdir/%{name}
    rm %{buildroot}%{_fontdir}/*.txt
popd
mkdir -p Isabella
pushd Isabella
    tar xfvz $RPM_SOURCE_DIR/Isabella.ttf.tar.gz
    install -m 0644 *.ttf %{buildroot}%{_fontdir}
    install -m 0644 README.txt %{buildroot}/%_docdir/%{name}/README.Isabella.txt
    install -m 0644 COPYING %{buildroot}/%_docdir/%{name}/COPYING.Isabella
popd
mkdir -p latex-xft
pushd latex-xft
    tar xfvz $RPM_SOURCE_DIR/latex-xft-fonts-0.1.tar.gz
    install -m 0644 *.ttf %{buildroot}%{_fontdir}
    install -m 0644 readme.latex-fonts %{buildroot}/%_docdir/%{name}
popd


%files
%defattr(0644,root,root,755)
%_docdir/%{name}
%{_fontdir}

%changelog
* Fri Nov 29 2013 doktor5000@mageia.org
- adapt to Mageia
* Tue Mar  5 2013 coolo@suse.com
- update license to new format
* Wed Jul  4 2012 pgajdos@suse.cz
- amend spec file to reflect new font packaging scheme
  (see openFATE#313536);
* Thu May 17 2012 pgajdos@suse.com
- call spec-cleaner
* Sun Sep 18 2011 jengelh@medozas.de
- Apply packaging guidelines (remove redundant/obsolete
  tags/sections from specfile, etc.)
* Thu Apr  8 2010 tiwai@suse.de
- removed unnecessary buildrequires for too old distros
* Thu Mar 29 2007 dmueller@suse.de
- add unzip BuildRequires
* Fri Aug 11 2006 mfabian@suse.de
- don't install readme files and licenses into the font directory.
* Fri Aug 11 2006 dmueller@suse.de
- fix build
* Tue Aug  8 2006 dmueller@suse.de
- /usr/X11R6/lib/X11/fonts -> /usr/share/fonts
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Dec  3 2004 mfabian@suse.de
- use new macro "%%run_suseconfig_fonts".
* Mon Sep 13 2004 mfabian@suse.de
- run SuSEconfig.fonts only if it exists.
* Thu Mar 18 2004 mfabian@suse.de
- use %%suseconfig_fonts_prereq
- run SuSEconfig.fonts and SuSEconfig.pango in %%post and %%postun
* Mon Feb 23 2004 hmacht@suse.de
- building as non-root
* Thu Jan  8 2004 bg@suse.de
- add latex-xft-fonts-0.1 (see readme.latex-fonts)
  ftp://ftp.lyx.org/pub/lyx/contrib/latex-xft-fonts-0.1.tar.gz
* Wed Aug 13 2003 adrian@suse.de
- add new font
* Mon Jun 16 2003 coolo@suse.de
- package directories
* Mon May 26 2003 adrian@suse.de
- build fix
* Fri Apr 18 2003 adrian@suse.de
- initial package of a large number of fonts

Re: How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 29th, '13, 20:56
by lectus
Hi!
I used urpmi to extract the source RPM.

Then I tried:
rpmbuild -ba free-ttf-fonts

and I got an error on line 19 with the spec file you provided.

I'm totally newbie to RPM, so any help is appretiated.

Re: How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 29th, '13, 21:12
by doktor5000
What you do you mean you used urpmi to extract the source RPM?
You should install the src.rpm as normal user, not as root.

Also, you should use rpmbuild -ba free-ttf-fonts.spec

This is what it should look like:

install the src.rpm as normal user
Code: Select all
[doktor5000@Mageia3 SPECS]$ cd ~
[doktor5000@Mageia3 ~]$ rpm -ihv free-ttf-fonts-1.0-364.3.src.rpm
Warnung: free-ttf-fonts-1.0-364.3.src.rpm: Header V3 RSA/SHA256 Signature, Schlüssel-ID 3dbdc284: NOKEY                                 
Aktualisierung/ Installation...                                                                                                         
                                                                                                                                         
   1:free-ttf-fonts-1.0-364.3         ################################# [100%]


then copy/move the spec I've attached into the rpmbuild/SPECS/ folder
Code: Select all
[doktor5000@Mageia3 ~]$ mv free-ttf-fonts.spec rpmbuild/SPECS/
mv: overwrite 'rpmbuild/SPECS/free-ttf-fonts.spec'? y


change to the rpmbuild/SPECS/ folder
Code: Select all
[doktor5000@Mageia3 ~]$ cd rpmbuild/SPECS/


and finally build it:

Code: Select all
[doktor5000@Mageia3 SPECS]$ rpmbuild -ba free-ttf-fonts.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ZfCKwc
+ umask 022
+ cd /home/doktor5000/rpmbuild/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.dyUgDg
+ umask 022
+ cd /home/doktor5000/rpmbuild/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.vGQ8Jk
+ umask 022
+ cd /home/doktor5000/rpmbuild/BUILD
+ '[' /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64 '!=' / ']'
+ rm -rf /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64
++ dirname /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64
+ mkdir -p /home/doktor5000/rpmbuild/BUILDROOT
+ mkdir /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64
+ '[' 1 -eq 1 ']'
+ mkdir -p /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64/usr/share/fonts/free-ttf-fonts
+ mkdir -p /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64//usr/share/doc/free-ttf-fonts
+ pushd /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64/usr/share/fonts/free-ttf-fonts
~/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64/usr/share/fonts/free-ttf-fonts ~/rpmbuild/BUILD
+ for i in /home/doktor5000/rpmbuild/SOURCES/Dustismo.zip /home/doktor5000/rpmbuild/SOURCES/Junkyard.zip /home/doktor5000/rpmbuild/SOURCES/Swift.zip /home/doktor5000/rpmbuild/SOURCES/El_Abogado_Loco.zip /home/doktor5000/rpmbuild/SOURCES/MarkedFool.zip /home/doktor5000/rpmbuild/SOURCES/Wargames.zip /home/doktor5000/rpmbuild/SOURCES/balker.zip /home/doktor5000/rpmbuild/SOURCES/ItWasntMe.zip /home/doktor5000/rpmbuild/SOURCES/PenguinAttack.zip /home/doktor5000/rpmbuild/SOURCES/Winks.zip /home/doktor5000/rpmbuild/SOURCES/flatline.zip /home/doktor5000/rpmbuild/SOURCES/allfonts.zip
+ unzip -o /home/doktor5000/rpmbuild/SOURCES/Dustismo.zip


[...]


Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64
Wrote: /home/doktor5000/rpmbuild/SRPMS/free-ttf-fonts-1.0-1.mga3.src.rpm
Wrote: /home/doktor5000/rpmbuild/RPMS/noarch/free-ttf-fonts-1.0-1.mga3.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.DFdupK
+ umask 022
+ cd /home/doktor5000/rpmbuild/BUILD
+ /usr/bin/rm -rf /home/doktor5000/rpmbuild/BUILDROOT/free-ttf-fonts-1.0-1.mga3.x86_64
+ exit 0
[doktor5000@Mageia3 SPECS]$

Re: How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 30th, '13, 02:47
by lectus
Thanks doktor5000!

It worked great! And I learned a lot.

BTW... I had to remove the identation from your spec file. I was getting an error because of this.

Nice! Now I can enjoy Mageia for some work I'm doing with Scribus and those artistic fonts.

BTW... I'm also a programmer, so as I practice more how to maintain RPM packages I expect to give some contribution to Mageia if I can find some free time.

Re: How to convert OpenSUSE RPM to Mageia?

PostPosted: Nov 30th, '13, 12:12
by doktor5000
lectus wrote:BTW... I'm also a programmer, so as I practice more how to maintain RPM packages I expect to give some contribution to Mageia if I can find some free time.


Sounds great. If you need a mentor, please have a look at https://wiki.mageia.org/en/Becoming_a_Mageia_Packager