RPM build from binary files

Hi,

I try to create an RPM following many online post but without result.

In the SOURCES folder I have inserted zombiedriver-1.0.tar.gz (with the binary of the <zombiedriver-1.0> app)
In the SPECS folder I have inserted zombiedriver.spec.

http://systemgvpphp.altervista.org/rpm.png

The apllication file is a compiled binary from Lazarus.

But, when I run

rpmbuild -ba zombiedriver.spec
I’ve an error.

Help me! I’m new in linux world.

make sure you are running the last command in the right directory

run

rpmbuild -ba --noclean xxx.spec

you can see in the BUILD- folder the name of the unzipped tar.gz…
Compare it with your %setup -line.

and if the built is complete in the BUILDROOT-folder are the files and location after the rpm is working

–noclean does not clean up the directories after successful build, so I prefer it automatically.

And please use Code Tags for your Terminal Output, its the Line here in the Editor, the # is Code-Tags, use copy/paste for all such things as Kate or Terminal.

Thanks, I’ve edit my spec file in this way and work, but How can I make a link (.desktop) of this app file in the traditional menu?

Name:           zombiedriverVersion:        1.0
Release:        0
Summary:        Descrizione sommaria
License:        GPL-2
Group:          Applications/Engineering
URL:            http://www.sito.it/%{name}.php
Source0:        %{name}-%{version}.tar.gz 


%description
Descrizione lunga.


%prep
%setup -q %{name}-%{version}


%install
mkdir -p %{buildroot}/usr/local/bin/%{name}-%{version}
cp -ar * %{buildroot}/usr/local/bin/%{name}-%{version}/


%files
%defattr(-,root,root,-)
/usr/local/bin/%{name}-%{version}


%changelog
* Sat May 09 2019 Cognome Nome <email@host.it> 1.0-0
- Initial package for openSUSE

https://en.opensuse.org/openSUSE:Packaging_desktop_menu_categories

https://en.opensuse.org/Portal:Packaging

I’ve try to insert “Categories=Science;Engineering” in spec file, but I’ve error to compile. Where I can insert this line?

Hi
You need to add some build requires…

update-desktop-files

Then use the macro to create your desktop file in the %install section

%suse_update_desktop_file -c …

In your %files section you would then have;

%{_datadir}/applications/%{name}.desktop

You also need an icon, so if that’s available, it would be in %{_datadir}/pixmaps/some_icon.png else if using a stock on, would need to look at adding hicolor-icon-theme as well to your build requires.

See the links user Sauerland posted as well as;

openSUSE:Packaging Conventions RPM Macros - openSUSE Wiki

I’ve tried to add %suse_update_desktop_file in spec file, I’ve tried two examples, but I’ve see same error

  • %suse_update_desktop_file zombiedriver Science Engineering
    /var/tmp/rpm-tmp.B0cjXf: line 30: fg: no job control
    errore: Stato d’uscita errato da /var/tmp/rpm-tmp.B0cjXf (%install)

Errori di compilazione RPM:
data non valida in %changelog: Sat May 16 2019 Cognome Nome <email@host.it> 1.0-0
Stato d’uscita errato da /var/tmp/rpm-tmp.B0cjXf (%install)

Name:           zombiedriverVersion:        1.0
Release:        0
Summary:        Descrizione sommaria
License:        GPL-2
Group:          Applications/Engineering
URL:            http://www.sito.it/%{name}.php
Source0:        %{name}-%{version}.tar.gz 


%description
Descrizione lunga.


%prep
%setup -q %{name}-%{version}


%install
mkdir -p %{buildroot}/usr/local/bin/%{name}-%{version}
cp -ar * %{buildroot}/usr/local/bin/%{name}-%{version}/
%suse_update_desktop_file %{name} Science Engineering


%files
%defattr(-,root,root,-)
/usr/local/bin/%{name}-%{version}
/usr/share/applications/%{name}-%{version}.desktop


%changelog
* Sat May 16 2019 Cognome Nome <email@host.it> 1.0-0
- Initial package for openSUSE
%suse_update_desktop_file -c %{name}-%{version} %{name} "Descrizione sommaria" %{name}-%{version} "" Science Engineering

I follow the link openSUSE:Packaging Conventions RPM Macros - openSUSE Wiki but I see “fg: no job control”

I’ve tried to add

URL:            http://www.sito.it/%{name}.phpSource0:        %{name}-%{version}.tar.gz
BuildRequires:  update-desktop-files

but I see

errore: Dipendenze di build fallite:
update-desktop-files necessario a zombiedriver-1.0-0.x86_64

Errori di compilazione RPM:
data non valida in %changelog: Sat May 16 2019 Cognome Nome <email@host.it> 1.0-0

See in another changelog for the right one:
f.E
Sat May 11 2019 - user@host

Sat May 16 2019 was a Thursday…

Yes, I have solved the date, but not solve “fg: no job control”

Yes, I have solved the date, but not solve “fg: no job control”

Why not posting the whole log?

Hi
Is update-desktop-files package installed? Your error indicates it isn’t?

Thanks for help. I’ve solved in this way

Name:           zombiedriver
Version:        1.0
Release:        0
Summary:        Descrizione sommaria
License:        GPL-2
Group:          Applications/Engineering
URL:            http://www.sito.it/%{name}.php
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  update-desktop-files

%description
Descrizione lunga.

%prep
%setup -q %{name}-%{version}

%install
mkdir -p %{buildroot}/usr/local/bin/%{name}-%{version}
cp -ar * %{buildroot}/usr/local/bin/%{name}-%{version}/
%suse_update_desktop_file -c %{name}-%{version} %{name} "ZombieDriver" "/usr/local/bin/%{name}-%{version}/%{name}-%{version}.png" "%{name}-%{version}" [Science Engineering]

%files
%defattr(-,root,root,-)
/usr/local/bin/%{name}-%{version}
%{_datadir}/applications/%{name}-%{version}.desktop
/usr/local/bin/%{name}-%{version}/%{name}-%{version}.png

%changelog
* Sun May 18 2019 Cognome Nome <email@host.it> 1.0-0
- Initial package for openSUSE

but, I’ve problem with icon file, if in %suse_update_desktop_file I write “%{name}-%{version}” and in %files I write %{_datadir}/pixmaps/%{name}-%{version}.png, I see an error, because he don’t copy the icon in pixmaps folder. Why? the icon is in the same forlder of binari file.

Another, I’ve install update-desktop-files, but if I put my RPM file in other opensuse system without update-desktop-files, He make the desktop file?

I’ve solved with the icon file, the final spec file is


Name:           zombiedriver
Version:        1.0
Release:        0
Summary:        Descrizione sommaria
License:        GPL-2
Group:          Applications/Engineering
URL:            http://www.sito.it/%{name}.php
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  update-desktop-files

%description
Descrizione lunga.

%prep
%setup -q %{name}-%{version}

%install
mkdir -p %{buildroot}/usr/local/bin/%{name}-%{version}
cp -ar * %{buildroot}/usr/local/bin/%{name}-%{version}/
mkdir -p %{buildroot}/%{_datadir}/pixmaps/
cp -ar %{name}.png %{buildroot}/%{_datadir}/pixmaps/
%suse_update_desktop_file -c %{name}-%{version} %{name} "ZombieDriver" "%{name}-%{version}/%{name}-%{version}" "%{name}" "Science Engineering"

%files
%defattr(-,root,root,-)
/usr/local/bin/%{name}-%{version}
%{_datadir}/applications/%{name}-%{version}.desktop
%{_datadir}/pixmaps/%{name}.png

%changelog
* Sun May 18 2019 Cognome Nome <email@host.it> 1.0-0
- Initial package for openSUSE

but, the last question is How I sing the RPM file? In the rpm compilation I see *No buildservice signing certificate, *​How make?

Hi
Since it’s built locally for your use, then shouldn’t be an issue? RPM’s built from binary blobs can’t be distributed on OBS (well you would have to look at getting into non-oss).

Another question., I’ve install update-desktop-files, but if I put my RPM file in other opensuse system without update-desktop-files, He make the desktop file?

Hi
Yes, it’s only a build requirement, the desktop file is now in the rpm you install on another system. If on another system you built from the src rpm, then yes you would need update-desktop-files.

thank you for helping me