Active Topics

 


Reply
Thread Tools
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#31
Ooops, sorry now looked you output again and you are right, it not created rpm file. You do something wrong.
 
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#32
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
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#33
if you used my zip from the first post, you don't need to change nothing i the spec file.
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#34
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

Last edited by Schturman; 2014-10-30 at 13:38.
 

The Following User Says Thank You to Schturman For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#35
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.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..

Last edited by Markkyboy; 2014-10-30 at 23:07.
 

The Following User Says Thank You to Markkyboy For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#36
 
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#37
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,
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..

Last edited by Markkyboy; 2014-10-31 at 13:56.
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#38
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
 

The Following User Says Thank You to Schturman For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#39
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
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#40
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.

Last edited by Schturman; 2017-06-07 at 05:33.
 

The Following User Says Thank You to Schturman For This Useful Post:
Reply

Tags
jolla phone, on device


 
Forum Jump


All times are GMT. The time now is 08:13.