maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [GUIDE for noobs] RPM packaging directly on your Jolla phone. (https://talk.maemo.org/showthread.php?t=92963)

Schturman 2014-04-17 15:11

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
Method work like expected, it was my mistake in previous version of vkb :D

Schturman 2014-04-24 10:18

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
T.Mavica, here is your .spec file:
Code:

Name:          sailfishquickim
Version:      0.1
Release:      1
Summary:      Traditional Chinese input
Group:        System/Tools
Vendor:        Arthur Artoria
Distribution:  SailfisfOS
Packager: Arthur Artoria <arthurartoria@gmail.com>
URL:          www.mysite.com

License:      GPL

%description
Chinese Traditional Quick Input Method For Sailfish.

%files

%defattr(-,nemo,nemo,-)
/home/nemo/.local/share/maliit-server/QML/OfflineStorage/Databases/*

%defattr(644,root,root,-)
/usr/share/maliit/plugins/com/jolla/layouts/*

%post
if [ $1 = 1 ]; then
    #Do stuff specific for first install
echo "It's first time install"
killall maliit-server
killall jolla-messages
killall jolla-email
killall jolla-notes
killall jolla-clock
else
if [ $1 = 2 ]; then
    #Do stuff specific to upgrades
killall maliit-server
fi
fi

%postun
if [ $1 = 0 ]; then
    #Do stuff specific to uninstalls
rm -rf /usr/share/maliit/plugins/com/jolla/layouts/quickZH
killall maliit-server
else
if [ $1 = 1 ]; then
    #Do stuff specific to upgrades
echo "It's just upgrade"
fi
fi

%changelog
* Wed Jan 25 2014 Builder <builder@...> 0.1
- First build.

folder name that include your files in BUILD directory is: sailfishquickim-0.1-1.arm

P.S.
0.1-1:
0.1 = number of Version
1 = number of Release

If you change this numbers in folder name, also you need change them in the .spec file.

Good luck ;)

Schturman 2014-05-05 17:00

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
T.Mavica, detailed explanation for you ;)

1. Connect your phone to WinSCP via SSH connection and open Putty. How to here: http://talk.maemo.org/showthread.php?t=92491
2. Run this command as ROOT:
Code:

mkdir -p /root/rpmbuild/{BUILD,BUILDROOT,RPMS/armv7hl,SPECS}
3. Download this files to your PC -> extract from ZIP and transfer folder named sailfishquickim-0.3-1.arm to /root/rpmbuild/BUILD on your phone.
3. Download this spec file to your PC -> transfer it to /root/rpmbuild/SPECS
4. Three commands for creating your package (as ROOT):
Code:

/bin/cp -rf /root/rpmbuild/BUILD/sailfishquickim-0.3-1.arm /root/rpmbuild/BUILDROOT
cd /root/rpmbuild
rpmbuild -bb SPECS/sailfishquickim.spec


5. Transfere it where you want, for example to Downloads folder:
Code:

/bin/cp -f /root/rpmbuild/RPMS/armv7hl/sailfishquickim-0.3-1.armv7hl.rpm /home/nemo/Downloads
6. Install your package from any File manger directly on the phone or as ROOT from terminal/Putty:
Code:

pkcon install-local -y /home/nemo/Downloads/sailfishquickim-0.3-1.armv7hl.rpm
7. Uninstall your package as ROOT:
Code:

pkcon remove sailfishquickim
Here is your last (new) package: https://dl.dropboxusercontent.com/u/...-1.armv7hl.rpm

So, if you want to update your package, some steps:
1. Change version number of your folder, for example from
sailfishquickim-0.3-1.arm to
sailfishquickim-0.4-1.arm or
sailfishquickim-0.3-2.arm

Where is:
0.3-1:
0.3 = number of Version
1 = number of Release

2. Change to the SAME version in the .spec file. For example:
From this:
Code:

Name:          sailfishquickim
Version:      0.3
Release:      1

to this:
Code:

Name:          sailfishquickim
Version:      0.4
Release:      1

or this:
Code:

Name:          sailfishquickim
Version:      0.3
Release:      2

3. Change your files inside sailfishquickim-0.3-1.arm folder to new files.
4. Create new RPM package

That's all :D

Markkyboy 2014-10-29 19:53

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
Hi Schturman,

wonder if you can help, after entering the line
Code:

rpmbuild -bb SPECS/myfirstpackage.spec
I get the following output;

Code:

[nemo@Jolla rpmbuild]$ rpmbuild -bb SPECS/myfirstpackage.spec
Processing files: myfirstpackage-0.1-1.armv7hl
error: File must begin with "/"

How do I proceed please?

Regards,

nieldk 2014-10-29 20:03

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
Quote:

Originally Posted by Markkyboy (Post 1445034)
Hi Schturman,

wonder if you can help, after entering the line
Code:

rpmbuild -bb SPECS/myfirstpackage.spec
I get the following output;

Code:

[nemo@Jolla rpmbuild]$ rpmbuild -bb SPECS/myfirstpackage.spec
Processing files: myfirstpackage-0.1-1.armv7hl
error: File must begin with "/"

How do I proceed please?

Regards,

your %files section in spec file, all listed files must begin with /

Markkyboy 2014-10-29 20:30

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
Quote:

Originally Posted by nieldk (Post 1445037)
your %files section in spec file, all listed files must begin with /

Thanks NielDK, that worked, albeit I now have a different error from RPM build;

Code:

RPM build errors:
    Installed (but unpackaged) file(s) found:
  /usr/share/ambience/myfirstpackage/images/myfirstpackage.jpg
  /usr/share/ambience/myfirstpackage/myfirstpackage.ambience
  /usr/share/ambience/myfirstpackage/sounds.index
  /usr/share/ambience/myfirstpackage/sounds/myfirstpackage_Calendar.mp3
  /usr/share/ambience/myfirstpackage/sounds/myfirstpackage_Clock.mp3
  /usr/share/ambience/myfirstpackage/sounds/myfirstpackage_Email.mp3
  /usr/share/ambience/myfirstpackage/sounds/myfirstpackage_IM.mp3
  /usr/share/ambience/myfirstpackage/sounds/myfirstpackage_Ringtone.mp3
  /usr/share/ambience/myfirstpackage/sounds/myfirstpackage_SMS.mp3

I'm a total noob when it comes to this, but I do want to learn. Why is the package not being compiled and would I be right in thinking when it is compiled , I should then find the package RPMS folder?

Thanks for your help, it's much appreciated NielDK.

Regards,

Schturman 2014-10-29 21:05

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
post a full spec file and we will fix it ;)

Markkyboy 2014-10-29 21:31

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
Quote:

Originally Posted by Schturman (Post 1445057)
post a full spec file and we will fix it ;)

Hi Schturman,
thanks, but for now, I'm trying to compile your file using your SPEC file, all as an experiment so I can see what is doing what before my eyes.
So, as yet, I have no SPEC file of my own, only yours.

NielDK kindly answered me and now I have got a bit further. It seems that a line or command in the SPEC file was causing the compiled RPM to get deleted - I'm in a right pickle!, but it's all good and is how I learn!

I'm starting again and hopefully this time, I will have an RPM file at the end of it! (I feel like I'm learning another language and not doing very well!)

Here is where I'm at now;
Code:

[root@Jolla rpmbuild]# rpmbuild -bb SPECS/myfirstpackage.spec                  Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/myfirstpackage-0.1-1.arm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.C5rTfh
+ umask 022
+ cd /root/rpmbuild/BUILD
+ /bin/rm -rf /root/rpmbuild/BUILDROOT/myfirstpackage-0.1-1.arm
+ exit 0
[root@Jolla rpmbuild]#

After the above, there is no RPM, only the created files. I'm a bit lost! :)

Regards,

Schturman 2014-10-29 21:42

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
It's good output! You will find created rpm file in: /root/rpmbuild/RPMS/armv7hl
just copy it to you Downloads folder...

Markkyboy 2014-10-29 22:04

Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
 
Quote:

Originally Posted by Schturman (Post 1445067)
It's good output! You will find created rpm file in: /root/rpmbuild/RPMS/armv7hl
just copy it to you Downloads folder...

Cool, it's good to know you think the output is good, however, I couldn't continue because no file existed at /root/rpmbuild/RPMS/armv7hl

I will try again, but now for some reason I am hitting permission problems with root/user - I must be doing something wrong, I'm sure I will get there, these journeys are often long for me! :D

Thanks Schturman, I'm sure I will be back with more questions!

EDIT - Twice I've tried now, the same output you say is good, but still no RPM being created/found in RPMS directory.

Regards,


All times are GMT. The time now is 04:57.

vBulletin® Version 3.8.8