is there a spec file for WIICAN to make an rpm

Asked by Thomas

There is a request to package WIICAN on Mandriva.
is there a spec file for WIICAN to make an rpm

Question information

Language:
English Edit question
Status:
Open
For:
WiiCan Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
J. Félix Ontañón (fontanon) said :
#1

Sorry, there is no a spec file for making an rpm for wiican, by now ... call for volunteers!!!!

Think that the setup.py file gives you the most of the spec. Anyway the wiican packaging (either deb or rpm) needs to do some extra distro-dependent operations i think:

1- Set the correct uinput module perms by installing the udev rules file
2- Load the uinput module, i.e. on O.S. boot

In the debian package (check ppa:wiican) for 0.2.1 wiican version both issues has been ugly resolved by installing the udev rules file and installing an upstart service that loads the uinput module on every boot.

Revision history for this message
Thomas (thomas-btspuhler) said :
#2

I guess I am one of those volunteers. This is my first Python rpm and I am not too successful:
Executing(%build): /bin/sh -e /home/thomas/WIICAN/BUILDROOT/rpm-tmp.DIeecJ
+ umask 022
+ cd /home/thomas/WIICAN/BUILD
+ cd wiican-0.2.1
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/wiican
copying wiican/defs.py -> build/lib/wiican
copying wiican/wiimotemanager.py -> build/lib/wiican
copying wiican/pnganimation.py -> build/lib/wiican
copying wiican/dotconfig.py -> build/lib/wiican
copying wiican/mapping.py -> build/lib/wiican
copying wiican/__init__.py -> build/lib/wiican
copying wiican/notificator.py -> build/lib/wiican
running build_scripts
creating build/scripts-2.6
copying and adjusting bin/wiican -> build/scripts-2.6
changing mode of build/scripts-2.6/wiican from 644 to 755
running install_lib
creating /usr/lib/python2.6/site-packages/wiican
error: could not create '/usr/lib/python2.6/site-packages/wiican': Permission denied

I don't know where this requirement comes from, but we shouldn't touch any / directories. It needs to be built in
/home/thomas/WIICAN/BUILDROOT

Revision history for this message
J. Félix Ontañón (fontanon) said :
#3

As you can see in setup.py code, you can specify the prefix for installing with --prefix
So i recommend you to call setup.py from rpm building as:

python setup.py --prefix=WIICAN/BUILDROOT

Or something alike. I really thank you for trying to rpm-package wiican

Revision history for this message
Thomas (thomas-btspuhler) said :
#4

OK, I am making progress, but I am missing a lot of files in /usr/share/doc
+ export DOCDIR
+ /bin/mkdir -p /home/thomas/WIICAN/BUILDROOT/wiican-0.2.1-1mdv2010.1.x86_64/usr/share/doc/wiican
+ cp -pr LICENSE /home/thomas/WIICAN/BUILDROOT/wiican-0.2.1-1mdv2010.1.x86_64/usr/share/doc/wiican
cp: cannot stat `LICENSE': No such file or directory
I am using now the standard Python build sequence in the spec file:
%prep
%setup -q -n %{name}-%{version}

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --root $RPM_BUILD_ROOT

Revision history for this message
J. Félix Ontañón (fontanon) said :
#5

Maybe because wiican doesn't have a LICENSE file. Wiican provides a COPYING file that contains the gpl v3 legal notice. I don't know much about rpm packaging but maybe the current debian source package could help you with rpm building.

This is the branch for wiican 0.2.x series debian source package:
https://code.launchpad.net/~wiicanteam/wiican/ubuntu

And the brand new (in progress) wiican 0.3.x series debian source package:
https://code.launchpad.net/~wiicanteam/wiican/ubuntu-0.3

Revision history for this message
J. Félix Ontañón (fontanon) said :
#6

I'm going to mark this answer as a bug for resolving the wiican 0.2.x series rpm packaging.
Maybe you can create your own wiican branch for manage and share your rpm packaging advances, and so, other people could help.

Revision history for this message
Thomas (thomas-btspuhler) said :
#7

Maybe because wiican doesn't have a LICENSE file
I rename the COPYING file to LICENCE and that resolved this problem

Revision history for this message
Thomas (thomas-btspuhler) said :
#8

I got most of it in the build but not the udev-rules:

$ rpm -qlp wiican-0.2.1-1mdv2010.1.noarch.rpm
/usr/bin
/usr/bin/wiican
/usr/lib
/usr/lib/python2.6/site-packages/wiican-0.2.1-py2.6.egg-info
/usr/lib/python2.6/site-packages/wiican/__init__.py
/usr/lib/python2.6/site-packages/wiican/defs.py
/usr/lib/python2.6/site-packages/wiican/dotconfig.py
/usr/lib/python2.6/site-packages/wiican/mapping.py
/usr/lib/python2.6/site-packages/wiican/notificator.py
/usr/lib/python2.6/site-packages/wiican/pnganimation.py
/usr/lib/python2.6/site-packages/wiican/wiimotemanager.py
/usr/share/applications/wiican.desktop
/usr/share/doc/wiican
/usr/share/doc/wiican/LICENSE
/usr/share/pixmaps/wiican.svg
/usr/share/wiican
/usr/share/wiican/about.ui
/usr/share/wiican/config_skel/mouse.wminput
/usr/share/wiican/config_skel/neverball.wminput
/usr/share/wiican/entry.ui
/usr/share/wiican/img/wiitrayoff.svg
/usr/share/wiican/img/wiitrayon.svg
/usr/share/wiican/img/wiitrayon1.svg
/usr/share/wiican/img/wiitrayon2.svg
/usr/share/wiican/img/wiitrayon3.svg
/usr/share/wiican/mapping.ui
/usr/share/wiican/wiican.svg

Here is the relevant spec file entry for the build:

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

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --root $RPM_BUILD_ROOT

Am I missing something? Of course, I could do a hack and manually install it, but that isn't a nice way.

Revision history for this message
J. Félix Ontañón (fontanon) said :
#9

Sure Thomas!

The setup.py file didn't install the udev-rule, this is work for the package maintainer. Think that rpm distros and deb distros uses different directories for udev rules.

Thomas, as you can see at LP:#604076 the is a package wiican 0.2.1 in Mandriva. Maybe could you test it?

Thanks!

Can you help with this problem?

Provide an answer of your own, or ask Thomas for more information if necessary.

To post a message you must log in.