Author Topic: One point questions only  (Read 898 times)

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
One point questions only
« on: December 03, 2012, 10:32:01 AM »
What is the difference between name and base_name in a .spec file?

Ref - .spec file from PCLinuxOS Live USB Creator :
Code: [Select]
%define        base_name PCLinuxOS LiveUSB Creator
%define        name      PCLinuxOS-liveusb
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1166
Re: One point questions only
« Reply #1 on: December 03, 2012, 11:14:10 AM »
This both lines define a new variable. They don't have any special meaning. They just contain the different strings.

i didn't look in the spec but i think name is used for the source and package name and the whole things which have to do with file and folder paths' while base_name is probably used for creating the name in the desktop file entry. Can't imagine anything else because names with space in it are very untypical.

you could name name also blablub than you just have to replace the %{name} and %name thing in the spec by %{blablub} or %blablub
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #2 on: December 03, 2012, 11:20:58 AM »
There is no reference to base_name anywhere else in the .spec file.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3738
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: One point questions only
« Reply #3 on: December 03, 2012, 11:33:52 AM »
Yes you are right...
But in the past there was an reference, long time ago.
You can move it, if you like 

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #4 on: December 15, 2012, 10:22:10 AM »
2. Original package name includes a mixture of capital and small letters. However Linux convention seems to be all small letters. If I want to convert this I will have to change the executable name, directory name etc. Do not know if it will break anything.
What to do in such a situation?
Is there a method of creating a shortcut / symlink or whatever connecting to the original software but this link will be in small letters?

(This has arisen from trying to package QtWeb binary. Here the name and the tarball name are in mixed case.)
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1166
Re: One point questions only
« Reply #5 on: December 16, 2012, 08:35:19 AM »
if i remember correctly you created a extra launcher in /usr/bin for qtweb. it is enough to give this launcher file a name which just contains lower case letters. there is no need to change whole directory structures.

in the case of the source you can define new macro like

Code: [Select]
%define sname QtWebwhich results in a Source line like

Code: [Select]
Source: %sname-%version

but also just

Code: [Select]
Source: QtWeb-%version

is possible.
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #6 on: December 16, 2012, 09:07:39 AM »
if i remember correctly you created a extra launcher in /usr/bin for qtweb.

I had only created a .desktop file. No launcher in /usr/bin

How about creating a bash script named qtweb but containing only
Code: [Select]
#!/bin/bash
QtWeb

using

Code: [Select]
%__cat > %{buildroot}%{_bindir}/qtweb << EOF
#!/bin/bash
QtWeb
EOF

But, how to set execute permission for this generated script?
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline ghostbunny

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1166
Re: One point questions only
« Reply #7 on: December 16, 2012, 09:13:12 AM »
if i remember correctly you created a extra launcher in /usr/bin for qtweb.

I had only created a .desktop file. No launcher in /usr/bin

How about creating a bash script named qtweb but containing only
Code: [Select]
#!/bin/bash
QtWeb

using

Code: [Select]
%__cat > %{buildroot}%{_bindir}/qtweb << EOF
#!/bin/bash
QtWeb
EOF

But, how to set execute permission for this generated script?


creating a script is also possible. to set execution permission set chmod +x <filename> in your case

Code: [Select]
%__cat > %{buildroot}%{_bindir}/qtweb << EOF
#!/bin/bash
QtWeb
EOF

chmod +x %{buildroot}%{_bindir}/qtweb
The full life is a big mess

PS:
I'm German. Sorry because of possible mistakes in my written messages xD


Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #8 on: December 16, 2012, 10:12:53 AM »
That worked great. Thanks.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #9 on: December 31, 2012, 11:12:49 PM »
3. When considering BuildRequires and Requires, should I add dependencies as needed for non-KDE desktops too?

Suppose I am building a Qt package, KDE desktop may already have the libraries needed while a non-KDE may not.
Particularly in the case of QtWeb, it builds and installs cleanly in KDE desktops with BuildRequires: libqt4-devel alone and no Requires: seem to be needed. But today I just installed LXDE in VirtualBox and tried installing the resulting .rpm. libQtNetwork.so.4 and libQtWebKit.so.4 dependencies were unmet and package was uninstallable.
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: One point questions only
« Reply #10 on: January 01, 2013, 03:43:54 AM »
But today I just installed LXDE in VirtualBox and tried installing the resulting .rpm. libQtNetwork.so.4 and libQtWebKit.so.4 dependencies were unmet and package was uninstallable.

I'm guessing you are trying to install it using rpm command? (I do wish you 'd give us details rather than tell a story  ;D)
That won't work because you have nothing to resolve the dependencies for you.  That's why we have "package managers" like apt and synaptic  ;)

Terry.
« Last Edit: January 01, 2013, 03:47:13 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #11 on: January 01, 2013, 04:16:24 AM »
3. When considering BuildRequires and Requires, should I add dependencies as needed for non-KDE desktops too?

Unfortunately trying to explain my question landed me in this soup ;) I will post that latter part to my QtWeb thread. I had actually used "apt-get install xxx.rpm" there.

So back to topic, is there a simple answer to Q. 3?

Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: One point questions only
« Reply #12 on: January 01, 2013, 04:53:28 AM »
3. When considering BuildRequires and Requires, should I add dependencies as needed for non-KDE desktops too?

"BuildRequires" is there to help others (especially Neal) build your packages successfully.  It's best to make no assumptions about other people's build systems and include all the capabilities needed to build the package successfully.  Most packagers can cope with missing buildreqs but you won't make many friends if it causes a 4 hour build to fail after 3 hours and 59 minutes  ;D

I've said before that "Requires" are only necessary for packages which are not catered for by RPM's automatic dependency facility (mainly scripted languages like python, perl, shell etc.) or to specify an indirect requirement.  An indirect requirement is a dependency that is needed to make an app "useful" rather than necessary to install and run it.

Terry.
« Last Edit: January 01, 2013, 05:00:35 AM by TerryN »
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|

Offline sling-shot

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1730
  • Satyameva Jayate | Truth Alone Triumphs.
Re: One point questions only
« Reply #13 on: January 01, 2013, 07:02:29 AM »
I can only know by doing a full packaging setup, then running gbd and check if that .rpm is ok in that environment.
Well... :)
Packaging well will cure headaches of many :) But learning to package will cause headaches in many :(

AMD AthlonX2 3600+/ASUS M2NPV-VM/ATi HD4670/Onboard sound/3.5GB DDR2-533 RAM/SEAGATE 160+320GB HDD/DELL S2240L FullHD/Creative SBS370 2.1/PCLinuxOS2013/KDE4
Samsung NP305U1-A06IN | Nokia E6

Offline TerryN

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 723
Re: One point questions only
« Reply #14 on: January 01, 2013, 07:31:37 AM »
I can only know by doing a full packaging setup, then running gbd and check if that .rpm is ok in that environment.

Yes, you certainly should be testing that your RPM installs from a proper repo setup using Synaptic.  That's how end-user will be trying to install it  ;)

Terry.
Dell E521 - AMD 64 X2 5000+, 4GB RAM, ATI X1300 graphics
PCLinuxOS 2013 (KDE)
|Twitter|