Issue creating ZIM rpm

Hello,
Currently I am running opemandriva 6.0,
I forked and modified the spec file for zim :

# fix bogs requires
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^typelib\\(GtkosxApplication

Name:		zim
Version:	0.76.3
Release:	4
Summary:	A desktop wiki and outliner
Source:		https : // www.zim-wiki.org/downloads/%{name}-%{version}.tar.gz
License:	GPLv2
Group:		Editors
Url:		https://www.zim-wiki.org/
BuildRequires:	pkgconfig(python)
BuildRequires:  pkgconfig(pygobject-3.0)
BuildRequires:	python3dist(pygobject)
BuildRequires:	python3dist(setuptools)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:	typelib(GObject)
BuildRequires:	typelib(Gtk)
BuildRequires:	typelib(Gdk)
BuildRequires:	typelib(GdkPixbuf)
BuildRequires:	typelib(Gio)
BuildRequires:	typelib(GLib)
BuildRequires:	typelib(GObject)
BuildRequires:	typelib(Pango)
Requires:	python
Requires: python-gobject3
Requires:	python3dist(pygobject)
Requires:	typelib(Gtk)
Requires:	typelib(Gdk)
Requires:	typelib(GdkPixbuf)
Requires:	typelib(Gio)
Requires:	typelib(GLib)
Requires:	typelib(GObject)
Requires:	typelib(Pango)
Recommends:	typelib(GtkSource)
Recommends:	typelib(GtkSpell)
Suggests:	pyxdg
Suggests:	xdg-utils
BuildArch:	noarch

%description
Zim is a WYSIWYG text editor written in Gtk2-Perl which aims to bring
the concept of a wiki to your desktop. Every page is saved as a text
file with wiki markup. Pages can contain links to other pages, and are
saved automatically. Creating a new page is as easy as linking to a
non-existing page. Pages are ordered in a hierarchical structure that
gives it the look and feel of an outliner. This tool is intended to
keep track of TODO lists or to serve as a personal scratch book.

%prep
%autosetup -p1  -n %{name}-%{version}

%build
python setup.py build

%install
python setup.py install --root=%{buildroot} --skip-build

#install icons
%__install -D -m 0644 data/zim.png %{buildroot}%{_icons64dir}/zim.png
%__install -D -m 0644 data/zim.png %{buildroot}%{_iconsdir}/hicolor/64x64/mimetypes/application-x-zim-notebook.png
%__install -D -m 0644 data/zim.png %{buildroot}%{_iconsdir}/hicolor/64x64/mimetypes/gnome-mime-application-x-zim-notebook.png

%find_lang %{name}

%clean

%files -f %{name}.lang
%{_bindir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/org.zim_wiki.Zim.desktop
%{python_sitelib}/*
%{_mandir}/man1/%{name}*
#{_datadir}/pixmaps/%{name}.png
%{_datadir}/mime/*
%{_datadir}/metainfo/org.zim_wiki.Zim.appdata.xml
%{_iconsdir}/hicolor/*/*/*
%{_iconsdir}/ubuntu*/*/*/*

I installed the dependencies using the command :
sudo dnf builddep zim.spec
Now I am trying to build it usign the command:
rpmbuild -ba zim.spec

the problem now is the /usr/bin/zim created into the package looks like:

$ head /usr/bin/zim 
#!python

# This script is a wrapper around zim.main.main() for running zim as
# an application.


import sys
import os
import re

to work properly the file have to start with

#!/usr/bin/python

Any Idea on how to fix this ?? can you suggest any resource I can read ?

Thanks in advance : )

1 Like

@stethewwolf
welcome1

Welcome! We are glad to see you and hope you decide to make this your home.

We have some great packagers here and one of them will give you some help.

First, do all packaging in a Cooker VM or on bare metal. Second, Release: is the number of the version built or rebuilt against the supplied Version: not anything from the upstream. Our current spec shows this for an older version:

Check with the upstream and see if they have a preferred method to deploy this. Typically, things like this happen when projects change something and leave the remnants around for backwards compatibility, or as an Easter Egg that tells users or other devs that something additional needs to happen on a case by case basis.

@rugyada @WilsonPhillips thanks for your wellcome : ) I hope it will; on the first looks this appear to be a good system and I hope I can give something back to the community :slight_smile: :innocent:

2 Likes

@zeroability

after some time spent the way I used to make it working locally is to add

sed -i 's|^#!python$|#!/usr/bin/python|' %{buildroot}/usr/bin/zim

into the %install clause …

I know it is not elegant but works … :innocent:

I want spent more time testing everything on the cooker vm I am preparing…

but let me ask: what can I do after ? is ther an official procedure to submit the change ??

You can submit an Issue here and if you have an account, submit a PR against the repository:

It will then be reviewed and approved when in order.

thank you,

I opened this change

1 Like