Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

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

    Reply
    Page 4 of 6 | Prev |   2     3   4   5     6   | Next
    Schturman | # 31 | 2014-10-29, 22:36 | Report

    Ooops, sorry now looked you output again and you are right, it not created rpm file. You do something wrong.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Markkyboy | # 32 | 2014-10-30, 00:20 | Report

    Originally Posted by Schturman View Post
    Ooops, sorry now looked you output again and you are right, it not created rpm file. You do something wrong.
    Okay, thanks.

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Schturman | # 33 | 2014-10-30, 01:53 | Report

    if you used my zip from the first post, you don't need to change nothing i the spec file.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Schturman | # 34 | 2014-10-30, 09:27 | Report

    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
    [root@Jolla ~]# cd /root/rpmbuild
    [root@Jolla rpmbuild]# rpmbuild -bb SPECS/myfirstpackage.spec
    Processing files: myfirstpackage-0.1-1.armv7hl
    Requires(interp): /bin/sh /bin/sh
    Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    Requires(post): /bin/sh
    Requires(postun): /bin/sh
    Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/myfirstpackage-0.1-1.arm
    warning: Could not canonicalize hostname: Jolla
    Wrote: /root/rpmbuild/RPMS/armv7hl/myfirstpackage-0.1-1.armv7hl.rpm
    Executing(%clean): /bin/sh -e /root/rpmbuild/tmp/rpm-tmp.9Tvth7
    + umask 022
    + cd /root/rpmbuild/BUILD
    + /bin/rm -rf /root/rpmbuild/BUILDROOT/myfirstpackage-0.1-1.arm
    + exit 0
    [root@Jolla rpmbuild]#
    and here is a file:
    Code:
    [root@Jolla rpmbuild]# ls /root/rpmbuild/RPMS/armv7hl | grep myfirst
    myfirstpackage-0.1-1.armv7hl.rpm
    [root@Jolla rpmbuild]#
    PS. I REzipped files directly on the phone and reuploaded them (same link on the first post), now it can unzip correctly on the phone too by my Unzip & Unrar tool

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Schturman; 2014-10-30 at 13:38.
    The Following User Says Thank You to Schturman For This Useful Post:
    Markkyboy

     
    Markkyboy | # 35 | 2014-10-30, 23:02 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Markkyboy; 2014-10-30 at 23:07.
    The Following User Says Thank You to Markkyboy For This Useful Post:
    explit

     
    Schturman | # 36 | 2014-10-31, 05:24 | Report

    no problem, good luck

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Markkyboy | # 37 | 2014-10-31, 13:47 | Report

    Originally Posted by Schturman View Post
    no problem, good luck
    Just one more aspect I don't understand.

    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
    Processing files: allblack2-0.1-1.armv7hl
    error: File must begin with "/":
    
    
    RPM build errors:
        File must begin with "/":
    Now, I know what NielDK said about a leading '/' in %files but there are no '/' in your spec file - so this I really don't understand.

    Here's my spec file (your original one but altered), maybe you can see where I'm going wrong.

    Code:
    Name:          allblack2
    Version:       0.2
    Release:       2
    Summary:       My Second package
    Group:         System/Tools
    Vendor:        Markkyboy
    Distribution:  SailfishOS
    Packager:      Markkyboy
    URL:           https://together.jolla.com/questions/
    License:       GPL
    
    %description
    My second custom Ambience package
    
    %files
    
    %defattr(-,root,root,-)
    /usr/share/ambience/*
    
    %post
    systemctl-user restart ambienced.service
    
    %postun
    if [ $1 = 0 ]; then
        // Do stuff specific to uninstalls
    rm -rf /usr/share/ambience/myfirstpackage
    systemctl-user restart ambienced.service
    else
    if [ $1 = 1 ]; then
        // Do stuff specific to upgrades
    echo "It's just upgrade"
    systemctl-user restart ambienced.service
    fi
    fi
    
    %changelog
    * Sun Mar 16 2014 Builder <builder@...> 0.1
    - First build.
    Any info please, thanks

    Regards,

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Markkyboy; 2014-10-31 at 13:56.

     
    Schturman | # 38 | 2014-10-31, 14:14 | Report

    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
    /usr/share/ambience/*
    and delete this from spec:
    Code:
    %defattr(-,root,root,-)
    /usr/share/ambience/*
    You package will be created without any problem

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Schturman For This Useful Post:
    Markkyboy

     
    Markkyboy | # 39 | 2015-01-04, 12:45 | Report

    Originally Posted by Schturman View Post
    no problem, good luck
    Finally!, I got it!, it's all a lot clearer than it was a few weeks ago. I have a much better understanding of the process now!, thanks to your guide!

    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?

    Anyway, I know more than I did a month ago, thanks Schturman, your input is invaluable

    Regards

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Markkyboy For This Useful Post:
    juiceme

     
    Schturman | # 40 | 2015-01-04, 13:11 | Report

    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
    Example of spec file from one of my ambience packages:
    Code:
    Name:          ambience-green-hexagon
    Version:       0.0.1
    Release:       1
    Summary:       Ambience Green Hexagon
    Group:         System/Tools
    Vendor:        Schturman
    Distribution:  SailfisfOS
    Packager: Schturman <schturman@hotmail.com>
    URL:           www.dhrider.co.cc
    
    License:       GPL
    
    %description
    This is a Green Hexagon ambience with sounds...
    
    %files
    
    %defattr(-,root,root,-)
    /usr/share/ambience/*
    
    %post
    systemctl-user restart ambienced.service
    
    %postun
    if [ $1 = 0 ]; then
        #Do stuff specific to uninstalls
    rm -rf /usr/share/ambience/ambience-green-hexagon
    systemctl-user restart ambienced.service
    else
    if [ $1 = 1 ]; then
        #Do stuff specific to upgrades
    echo "It's just upgrade"
    systemctl-user restart ambienced.service
    fi
    fi
    
    %changelog
    * Sun Mar 16 2014 Builder <builder@...> 0.1
    - First build.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Schturman; 2017-06-07 at 05:33.
    The Following User Says Thank You to Schturman For This Useful Post:
    juiceme

     
    Page 4 of 6 | Prev |   2     3   4   5     6   | Next
vBulletin® Version 3.8.8
Normal Logout