Fedora Linux Support Community & Resources Center
  #1  
Old 16th March 2012, 04:39 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Help with static lib packaging

I was someone could help me with static library packaging.

I'm trying to package a game for a project that uses the newer version of Ogre that is not in the Fedora 16/17 repos, and that needs a plugin that the project has to compile.

Rather than have someone download my rebuilt ogre with the plugins enabled, the developers of the application suggested that I package this with static libs.

Now, I have found out how to compile Ogre to create static libs (modify the cmake command), however, I'm not sure what's envolved when it comes to packaging this.

Does anyone know of a package that does so that I could take a look at it or has a clear answer? I'm not a developer, so if you could dumb it down a bit for me I would appreciate it.

Thanks!
Reply With Quote
  #2  
Old 16th March 2012, 05:10 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Help with static lib packaging

Installing/packaging static libs in Fedora is generally discouraged. Unless there is some compelling reason for it for a particular package, static libs are removed. Most of the static libs that are packaged are put into the *-devel package of the program.

If I understand you correctly, you would like a certain Ogre plugin from the upstream package to not be "available" (installed) in your rpm package. The Fedora way of doing that would be to package that plugin *.so file into a separate package.

By example, the current F16 package of ogre contains:

/usr/lib64/OGRE/Plugin_BSPSceneManager.so
/usr/lib64/OGRE/Plugin_OctreeSceneManager.so
/usr/lib64/OGRE/Plugin_OctreeZone.so
/usr/lib64/OGRE/Plugin_PCZSceneManager.so
/usr/lib64/OGRE/Plugin_ParticleFX.so

If, for example, I didn't want the Plugin_ParticleFX.so to be part of the main ogre rpm package, I would put the Plugin_ParticleFX.so file into a sub-package:

ogre-plugin-particlefx-1.7.3-2.fc16.x86_64.rpm

The user then has the option to install that (optional) plugin package (though I'm not implying that the actual Plugin_ParticleFX.so is really optional here). Many Fedora packages do just that... break out plugins into optional packages.

Last edited by PabloTwo; 16th March 2012 at 05:17 PM.
Reply With Quote
  #3  
Old 16th March 2012, 05:19 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: Help with static lib packaging

Sorry, I might not have been very clear.

I need plugins that are not available in Fedora for Ogre, that can only be gotten with compiling Ogre with the Cg library installed. So, rather than distributing an 'unclean' ogre package with the extra plugins.

So does Fedora automatically remove static libs during an rpm installation?

I'm totally fine with distributing my ogre rebuild, instead of doing the static lib thing if Fedora is going to pull them out anyway.
Reply With Quote
  #4  
Old 16th March 2012, 05:30 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Help with static lib packaging

Removal of static libs is done manually in the spec file if the "make install" part of the build installs static libs (.a .la) files. Is the "Cg" library you mention something that is not available in Fedora?

I'm guessing the Ogre devs suggested using static libs as doing that would solve the "dependency" issues created by using shared object libs that would require a package that is not available in Fedora.

---------- Post added at 12:30 PM ---------- Previous post was at 12:29 PM ----------

I see Cg is available for Fedora in the RPMFusion repos:
Code:
BASH:~/-> yum list cg
Loaded plugins: langpacks, presto
Available Packages
Cg.i686                                                        3.0.0016-1.fc15                                                       rpmfusion-nonfree
Cg.x86_64                                                      3.0.0016-1.fc15                                                       rpmfusion-nonfree
Reply With Quote
  #5  
Old 16th March 2012, 05:31 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: Help with static lib packaging

Correct, the Cg package is in RPMFusion, not Fedora. And the application is using Ogre 1.7.4, whereas Fedora 16 and 17 only have 1.7.3.
Reply With Quote
  #6  
Old 16th March 2012, 05:42 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Help with static lib packaging

Well, if having the Cg libs installed when compiling ogre-1.7.4 creates plugin(s) that is the only thing that depends on Cg, then you could sub-package that/those plugin(s) and leave the main ogre package free from any Cg dependency. Or, you could just create a single ogre package and have ogre dependent on having the rpmfusion repo available to the package installer when it needs to install Cg as a dep. (?)

Audacious is an example of the main program being offered from the Fedora repo, but most of the plugins required to make it actually usable come from the rpmfusion repos.
Reply With Quote
  #7  
Old 16th March 2012, 05:45 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: Help with static lib packaging

You're talking about audacious-freeworld, right?

Would it just make better sense to do an ogre-freeworld then? Because I still need the stuff that is in the 1.7.4 ogre that isn't available in the 1.7.3 ogre that Fedora has.
Reply With Quote
  #8  
Old 16th March 2012, 05:45 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfirefox
Re: Help with static lib packaging

The normal difficulty with automatic conversion to static libraries for plugins is not the library - that is easy. The problem is the interface to the library - normally this is done via a "dlopen/dlsym/dlerror/dlclose" library functions.

To create a static interface that is compatable with the rest of the program, you need to emulate these functions only.

Most of these functions are null - dlopen just returns a pointer to an array of {"name",pointer_to_function} tuple, and dlsym returns the chosen "pointer_to_function" value, you can then create a library specific to the application that has entry points for all 4 functions - each doing (or faking) what the standard functions do.

This should simplify the conversion and the code only needs the dlopen/dlerror/dlsym/dlclose functions as provided, all others would be internal.
Reply With Quote
  #9  
Old 16th March 2012, 06:51 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Help with static lib packaging

Code:
BASH:~/-> rpm -qa --qf "%{name}-%{version}\t%{vendor}\n" audacious*
audacious-plugins-freeworld-mp3-3.0.4	RPM Fusion
audacious-3.0.4	Fedora Project
audacious-plugins-freeworld-3.0.4	RPM Fusion
audacious-plugins-3.0.4	Fedora Project
audacious-libs-3.0.4	Fedora Project
audacious-plugins-freeworld-ffaudio-3.0.4	RPM Fusion
audacious-plugins-freeworld-aac-3.0.4	RPM Fusion
audacious-plugins-freeworld-mms-3.0.4	RPM Fusion


---------- Post added at 01:51 PM ---------- Previous post was at 12:46 PM ----------

I did a "yum-builddep ogre" which installed all the build deps for ogre.
I did a "yum install Cg libCg"
I downloaded the ogre_src_v1-7-4.tar.bz2 file and compiled it.
I did "make install DESTDIR=/home/paul/work/ogre"

After relocating the "include" directory which contained a lot of header files, I get this remaining:
Code:
BASH:ogre/-> tree
.
└── usr
    ├── bin
    │** ├── OgreMeshUpgrader
    │** └── OgreXMLConverter
    └── lib64
        ├── libOgreMain.so -> libOgreMain.so.1.7.4
        ├── libOgreMain.so.1.7.4
        ├── libOgrePaging.so -> libOgrePaging.so.1.7.4
        ├── libOgrePaging.so.1.7.4
        ├── libOgreProperty.so -> libOgreProperty.so.1.7.4
        ├── libOgreProperty.so.1.7.4
        ├── libOgreRTShaderSystem.so -> libOgreRTShaderSystem.so.1.7.4
        ├── libOgreRTShaderSystem.so.1.7.4
        ├── libOgreTerrain.so -> libOgreTerrain.so.1.7.4
        ├── libOgreTerrain.so.1.7.4
        ├── OGRE
        │** ├── cmake
        │** │** ├── FindOGRE.cmake
        │** │** ├── FindOIS.cmake
        │** │** ├── FindPkgMacros.cmake
        │** │** ├── MacroLogFeature.cmake
        │** │** ├── OgreConfigTargets.cmake
        │** │** ├── OgreFindFrameworks.cmake
        │** │** ├── OgreGetVersion.cmake
        │** │** └── PreprocessorUtils.cmake
        │** ├── Plugin_BSPSceneManager.so
        │** ├── Plugin_CgProgramManager.so
        │** ├── Plugin_OctreeSceneManager.so
        │** ├── Plugin_OctreeZone.so
        │** ├── Plugin_ParticleFX.so
        │** ├── Plugin_PCZSceneManager.so
        │** └── RenderSystem_GL.so
        └── pkgconfig
            ├── OGRE-Paging.pc
            ├── OGRE.pc
            ├── OGRE-PCZ.pc
            ├── OGRE-Property.pc
            ├── OGRE-RTShaderSystem.pc
            └── OGRE-Terrain.pc
Note the new Plugin_CgProgramManager.so file that is not included in the Fedora ogre package.
I did an ldd on each and every .so file it installed. The only .so file that had a dependency on libCg.so => /usr/lib64/libCg.so (0x00007f46c6b40000) was the Plugin_CgProgramManager.so shared object lib.

There were no static libs installed. the "include" and "pkconfig" bits would all be packaged into the *-devel sub-package. You could sub-package the Plugin_CgProgramManager.so file as an optional plugin, Leaving the main ogre-1.7.4 package "Fedora pure".
Reply With Quote
  #10  
Old 16th March 2012, 06:54 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: Help with static lib packaging

Yeah, that's what I am attempting now. I looked over the audacious plugins and am trying exactly what you said
Reply With Quote
  #11  
Old 16th March 2012, 07:20 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: Help with static lib packaging

If you decide to sub-package the Plugin_CgProgramManager.so, remember to put the "BuildRequires: libCg" into the plugin sub-package section.
Reply With Quote
  #12  
Old 17th March 2012, 11:45 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
windows_7firefox
Re: Help with static lib packaging

Thanks, I was able to subpackage the plugin. I had Cg as a BuildRequres, which inherently has a dependency on libCg.

Thanks again!
Reply With Quote
  #13  
Old 18th March 2012, 12:48 AM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxchrome
Re: Help with static lib packaging

You're welcome. Earlier today I took a look at the official Fedora packaged orge spec file. You might find it interesting. Apparently, the ogre source code, without Cg, isn't so "pure" after all.

Of course, for personal use outside of the Fedora repos, one doesn't need to be quite so picky.
Reply With Quote
Reply

Tags
lib, packaging, static

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Packaging? mh3rn4nd3z3 Fedora Focus 8 12th February 2010 12:11 AM
Need advice on /etc/hosts for static ISP IP, router, LAN, static LAN IP rshartog Servers & Networking 2 21st February 2009 05:24 AM
Packaging help jazzfan Using Fedora 1 15th January 2008 02:54 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Servers & Networking 2 21st September 2004 05:13 PM


Current GMT-time: 00:28 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat