![]() |
[GUIDE for noobs] RPM packaging directly on your Jolla phone.
As far as you know I'm not programmer and don't know use SDK and all programmer stuff etc... By googling I found this way very useful and easy for myself for creating RPM packages directly on my Jolla phone.
Suggestions for improvement are welcome! The PDF instruction you can download here. Create RPM package directly on your Jolla phone. 1. Connect to your phone via WinSCP, open PuTTy as ROOT. 2. Write this command: Code:
mkdir -p /root/rpmbuild/{BUILD,BUILDROOT,RPMS/armv7hl,SPECS} 3. If rpm-build package not installed, run this command as ROOT: Code:
pkcon install -y rpm-build 4. Download this example package of custom ambience to your PC. Extract folder myfirstpackage-0.1-1.arm and transfer to your phone: Code:
/root/rpmbuild/BUILD Code:
/root/rpmbuild/SPECS 5. Look in to structure of files and folders to understand how to create your own packages. https://www.dropbox.com/s/bpd4dqu9uixgjag/winscp.pnghttps://dl.dropboxusercontent.com/s/...jag/winscp.png 6. Some explanation about SPEC file. When you use this method of creating RPM files it have a little problem when you go to uninstall your package. It will delete all your files like it should be, but it will leave your folders. Why, I don’t know… This is a reason that I suggest you to always use the postuninstall script in spec file to remove your folder (see example in my spec). Also remember that SPEC file run your commands as ROOT, if you should run your commands as USER from SPEC file, use this template: Code:
su -l nemo -c "command" Code:
Name: myfirstpackage · Obsoletes: - if you want to uninstall other versions · Conflicts: - if you want to keep 1st installed rpm package and stop 2 other packages from installing · Requires: - add name of dependency packages 8. Other parameters · %files - under this put the path to your files that NOT need special permissions. For example: Code:
%files Code:
%defattr(4755,root,root) · %pre– preinstall script, example: Code:
%pre Code:
%post Code:
%preun Code:
%postun Code:
/bin/cp -rf /root/rpmbuild/BUILD/myfirstpackage-0.1-1.arm /root/rpmbuild/BUILDROOT Code:
/bin/cp -f /root/rpmbuild/RPMS/armv7hl/myfirstpackage-0.1-1.armv7hl.rpm /home/nemo/Downloads Code:
pkcon install-local -y /home/nemo/Downloads/myfirstpackage-0.1-1.armv7hl.rpm Code:
pkcon remove myfirstpackage Schturman 29.03.2014 Some users poins: * From what nieldk explained (here and here) you can do all this stuff as USER, just replace the path /root/rpmbuild/....with /home/nemo/rpmbuild/ |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
good post, only one thing.
You dont need (read: should not) run as root. There really are no necessary reason for running rpmbuild as root, the %defatr section defines the default permissions (in your example user:root and group:root) you can, and should also set permission in the %files section as needed per folder/file, and in some cases the default %defattr root:root will result in eg configuration files not being readable by normal user (nemo) As rpmbuild builds in ~/rpmbuild directory tree it is able to create the rpm as user nemo etc. |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
I just never tried do this as USER, I use WinSCP and Putty and it easily to do as ROOT or as USER and transfer files where you want. If you start as USER you can't create folders from the first commands and if you already did it as ROOT you can just continue to other commands as root too :o |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Thanks man. Added to my bookmarks
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
PDF instruction updated with screenshot from WinSCP and link to this thread :D
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
with /home/nemo/rpmbuild/.... (SPECS/SOURCES/RPMS/SRPMS) :) |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Thanks
I will add your points to the first post... |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
%defattr could work also to execute a postint script as root?
like: Quote:
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
after:
rpmbuild -bb SPECS/myfirstpackage.spec i get: bash: rpmbuild: command not found |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
Code:
pkcon install -y rpm-build |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
RPM built. Now lets brick the phone :P
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Success!
Except after apply theme and refresh it didn't apply. Maybe needs more time? doing pkill via terminal after install worked gconftool-2 -s --type=string /meegotouch/theme/name harbour-mytheme pkill lipstick What if i add a pause after pkill? |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Don't know, try it...
Maybe instead pkill try Code:
systemctl-user restart lipstick.service Maximum add reboot ;) |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
The problem is thats not apply the theme with root privileges, only with user. I probed with root and user in terminal
Do you know how to apply the theme with user privilege? This one "gconftool-2 -s --type=string /meegotouch/theme/name harbour-mytheme" |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
use:
Code:
su -l nemo -c "command" |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
First post and PDF instruction updated!
* added explanation about running command from SPEC file as USER * added command for installation of rpm-build package. |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Could it be possible notifications like n9?
dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotificatio n uint32:1000 uint32:0 string:'x-nokia.internet' string:'Theme' string:'Theme installed! |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
use notifer.py likr this: python /path/notifer.py. Use it also as USER from spec file.
Code:
#!/usr/bin/python Code:
su -l nemo -c "python /path/notifer.py" |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Hi to all
After last system update 1.0.5.16, I can't update my apps created with this method :( Don't know why, more detailed explanation here: http://talk.maemo.org/showthread.php?t=93023 Any help will be appreciated. Thanks |
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
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
T.Mavica, here is your .spec file:
Code:
Name: sailfishquickim 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 ;) |
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 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 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 Code:
pkcon install-local -y /home/nemo/Downloads/sailfishquickim-0.3-1.armv7hl.rpm Code:
pkcon remove sailfishquickim 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 Code:
Name: sailfishquickim Code:
Name: sailfishquickim 4. Create new RPM package That's all :D |
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 Code:
[nemo@Jolla rpmbuild]$ rpmbuild -bb SPECS/myfirstpackage.spec Regards, |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
Code:
RPM build errors: Thanks for your help, it's much appreciated NielDK. Regards, |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
post a full spec file and we will fix it ;)
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
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 Regards, |
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... |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
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, |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Ooops, sorry now looked you output again and you are right, it not created rpm file. You do something wrong.
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
I used your SPEC file - should I have changed/removed anything or can I use your file as it is? I have added or removed '/' from different lines, hance the different results I keep getting. I've got muddled again. NielDK mentions about each operation in the spec file requiring a '/' before the % - in say /%files and that each line you want used, must start with '/' - but it's understanding which ones to '/' and which ones to leave as just '%' Any information is gratefully received. Regards |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
if you used my zip from the first post, you don't need to change nothing i the spec file.
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
I checked my example zip from the first post and found that I can't unzip directly on the phone. Unzip command converted folder inside zip archive to simple file, why I don't know... I suggest you extract it on your PC.
Here is output of creating rpm from this files and with NOT changed .spec file, just download zip -> extract on your PC -> transfer to the phone to correct location -> create rpm: Code:
[root@Jolla ~]# /bin/cp -rf /root/rpmbuild/BUILD/myfirstpackage-0.1-1.arm /root/rpmbuild/BUILDROOT Code:
[root@Jolla rpmbuild]# ls /root/rpmbuild/RPMS/armv7hl | grep myfirst |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Thanks Schturman,
Lol, I finally spotted the SPEC file in your example package. Don't know how I missed it! So I ended up copying and pasting from the 'spec file example' you laid out in your first post (thinking it would be the same as the proper spec file you provided). Eyes open, mind closed!!, doh! (I now know you were only showing uses for strings in your example). Brilliant!, I now have your theme on my phone and I like it, although I have a preference for my AllBlack ambience ;) I can now go back and start creating resources for my next ambience, perhaps AllBlack2..??, ;) A second file for my Openrepo account! :) Thanks again Schturman!, much appreciated. |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
no problem, good luck ;)
|
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
NielDK mentioned about needing to put a '/' in the '%files' section of SPEC file. I am now looking at your SPEC file for 'myfirstpackage' and none of your entries contain a '/' in the '%files' section yet it does work and produces the RPM package. I have edited your SPEC file for the purpose of creating my own ambience, I have not made any changes to the SPEC %files section, only name changes, URL, etc and yet upon going through the process, I am getting this error from rpmbuild; Code:
root@Jolla rpmbuild]# rpmbuild -bb SPECS/allblack2.spec Here's my spec file (your original one but altered), maybe you can see where I'm going wrong. Code:
Name: allblack2 Regards, |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
It explained in the first post...
If you don't need special permission, you can write your files under %files for example in my spec I added my files a special permission and put it under: %defattr(-,root,root,-) But you can change it like this: Code:
%files Code:
%defattr(-,root,root,-) |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
Quote:
I'm still baffled by one problem which occurs occasionally, the RPM is created, installs but does not show in Gallery/Ambience, even after reboot or restarting ambienced.service, etc, etc. So, I cleared out all folders in /root/rpmbuild/BUILD, SPECS and so on until all were empty and started again, after that, the RPM once installed, then works!?, go figure!. Maybe some files are getting muddled??, I don't get any errors except one that goes something like this; "Warning: Could not canonicalise the name Jolla",.... but I researched and it appears I can ignore it, which seems right, as ALL of the RPMs I've made, have all had that warning but most install and work. Hmmmm, any ideas? :confused: Anyway, I know more than I did a month ago, thanks Schturman, your input is invaluable Regards |
Re: [GUIDE for noobs] RPM packaging directly on your Jolla phone.
I don't know why it not worked for you from the first time, but it should...
I used this command in %post line for restart service in all my ambience packages and it always worked immediately without reboot etc.. Code:
systemctl-user restart ambienced.service Code:
Name: ambience-green-hexagon |
All times are GMT. The time now is 04:01. |
vBulletin® Version 3.8.8