Fedora Linux Support Community & Resources Center
  #31  
Old 10th March 2012, 10:18 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxchrome
Re: trouble with cmake in rpm building

Quote:
I should clarify, that the rpmbulid process is what got me the .so instead of the .a file (wierd).
Yes, I understand that. And I'm checking that directory after running through a "make" build.

Is this what your doing in the spec file? : %cmake -DCMAKE_SKIP_RPATH:BOOL=YES

Did you try packaging the .so file yet and then trying a package install?
Reply With Quote
  #32  
Old 10th March 2012, 11:00 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Ugh, so close yet so far!!

I was able to get this to work (the sed line itself I mean) outside of the build root, but when I add this to my spec file:

Code:
sed 's/libMyGUIOgrePlatform/libMyGUI.OgrePlatform/' apps/openmw/CMakeFiles/openmw.dir/link.txt
the link.txt file still has the entry without the dot in it.

---------- Post added at 06:00 PM ---------- Previous post was at 05:21 PM ----------

Quote:
Is this what your doing in the spec file? : %cmake -DCMAKE_SKIP_RPATH:BOOL=YES
This is what I have in my spec file:

Code:
%build
%cmake .
# try to avoid the rpaths issue
sed -i 's/RPATH\:BOOL=NO/RPATH\:BOOL=YES/' CMakeCache.txt
I tried the build again, including the lib file this time, and it looks as if it would install it:

Code:
Setting up Local Package Process
Examining openmw-0.12.0-1.fc16.x86_64.rpm: openmw-0.12.0-1.fc16.x86_64
Marking openmw-0.12.0-1.fc16.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package openmw.x86_64 0:0.12.0-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================
 Package      Arch         Version             Repository                          Size
========================================================================================
Installing:
 openmw       x86_64       0.12.0-1.fc16       /openmw-0.12.0-1.fc16.x86_64        11 M

Transaction Summary
========================================================================================
Install       1 Package

Total size: 11 M
Installed size: 11 M
Is this ok [y/N]:
I didn't complete the installation, as I don't have the proper syntax to uninstall that lib yet in the spec file.

Thanks again for your patience with me.
Reply With Quote
  #33  
Old 11th March 2012, 12:43 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxfirefox
Re: trouble with cmake in rpm building

Quote:
I didn't complete the installation, as I don't have the proper syntax to uninstall that lib yet in the spec file.
Huh? What syntax are you talking about here? All files belonging to a package are automatically un-installed when you un-install the package.

I've been compiling with the equivalent of:
Code:
%cmake -DCMAKE_SKIP_RPATH:BOOL=YES
make
Is that really a period in the spec file after %cmake?

---------- Post added at 07:43 PM ---------- Previous post was at 07:20 PM ----------

If you're no longer getting the rpath error when building the package, and rpmlint is giving your spec file a clean bill of health, I think you're good to go with the package as is. Did the original rpath error that you posted prevent the rpmbuild -bb openmw.spec from building the package?

Last edited by PabloTwo; 11th March 2012 at 12:26 AM.
Reply With Quote
  #34  
Old 11th March 2012, 03:18 AM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Quote:
Huh? What syntax are you talking about here? All files belonging to a package are automatically un-installed when you un-install the package.
I thought that there was something extra I needed to add to remove teh libMyGUIOgrePlatform.so file should someone remove the rpm. But if I don't need anything extra, then cool.

Quote:
Is that really a period in the spec file after %cmake?
Yeah, that's what I found in all the examples I looked at for cmake in rpm files, so I just followed suit.

Quote:
Did the original rpath error that you posted prevent the rpmbuild -bb openmw.spec from building the package?
Yeah, if I don't have that line in the spec file about disabling the rpath check, then the build fails with an error. Now, it just spits out a warning about the same rpath, but it lets the rpm build.

[QUOTE]
I'll check later, but I'm sure that I get the warning about the rpath (as long as I have that rpath ignoring part in my spec file) but I should be able to clean up anything else.

I'll test out the install later, and make sure the app runs. I appreciate all of your help on this.

---------- Post added at 09:18 PM ---------- Previous post was at 08:20 PM ----------

I was able to successfully install the rpm, run the application, and uninstall the rpm and it did remove everything (including the menu entry).

Thanks again for all your help!
Reply With Quote
  #35  
Old 11th March 2012, 03:32 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxchrome
Re: trouble with cmake in rpm building

Yeah, I knew it would now install and uninstall OK. Did you remember to stick in the /sbin/ldconfig lines in %post and %postun sections when you included the .so file? Leigh would have been the person to quickly figure out how to solve the rpath issue on this one. Maybe you've been too busy working on your rpm package project to notice, but today there was a notice on the forum that two of the Forum admins were retiring as being admins... bob and Leigh123. Also, it was stated in the notice that Leigh was taking a hiatus from the forum.

Well, the rpath issue isn't really "fixed", but you're to the point you have an installable and usable package. Glad to have been of some assistance. I enjoy building rpm packages myself. It can be both challenging but fun.
Reply With Quote
  #36  
Old 11th March 2012, 03:39 AM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Nope, I didn't get the ldconfig line in there, I assume your're talking about this:

Code:
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
I'll add that now.

I assume package building isn't generally this difficult. I just happened to pick the most painful one for me to start out on. Oh well, I tend to learn things the hard way.

Yeah, saw the notice about Bob and Leigh. That sucks, as I have enjoyed reading their posts and tutorials. But this is a good community forum, so it will still stand.

Thanks again.
Reply With Quote
  #37  
Old 11th March 2012, 03:42 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxchrome
Re: trouble with cmake in rpm building

No.. I mean you should now have:
Code:
%post
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig

%postun
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig

Last edited by PabloTwo; 11th March 2012 at 03:47 AM.
Reply With Quote
  #38  
Old 11th March 2012, 03:44 AM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Ah, I'll correct that then.

So the %postun should have /sbin/config as opposed to /sbin/ldconfig?
Reply With Quote
  #39  
Old 11th March 2012, 03:47 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxchrome
Re: trouble with cmake in rpm building

%post -p /sbin/ldconfig would mean you can have a single argument on the same line as %post by using the -p parameter. Two or more commands requires that you list the commands in sequence below the %post line, as above.

---------- Post added at 09:47 PM ---------- Previous post was at 09:46 PM ----------

Opps.. my typo. No... it is /sbin/ldconfig for both %post and %postun

Last edited by PabloTwo; 11th March 2012 at 03:49 AM.
Reply With Quote
  #40  
Old 11th March 2012, 03:48 AM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Makes sense. Once more, I thank you. I've learned a lot from this process.
Reply With Quote
  #41  
Old 11th March 2012, 04:19 AM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxchrome
Re: trouble with cmake in rpm building

If you don't mind posting your spec file, I'd like to try a thing or two with it.
I was just googling a bit more on the rpath issue.. found this...."added -DCMAKE_SKIP_RPATH=TRUE to cmake to skip rpath" and I'd like to try with that added to %cmake.
Reply With Quote
  #42  
Old 11th March 2012, 04:30 AM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Sure thing:

Code:
Name:		openmw
Version:	0.12.0
Release:	1%{?dist}
Summary:	An open source engine for Bethesda Softwork's Elder Scrolls III Morrowind
Group:		Amusements/Games
License:	GPLv3
URL:		http://openmw.org/
Source0:	http://openmw.googlecode.com/files/openmw-0.12.0-source.tar.bz2 
BuildRequires:	openal-soft-devel
BuildRequires:  bullet-devel
BuildRequires:  ois-devel
BuildRequires:  libsndfile-devel
BuildRequires:  libmpg123-devel
BuildRequires:  libblkid-devel
BuildRequires:  libpng-devel
BuildRequires:  qt-devel
BuildRequires:  ogre-devel
BuildRequires:  boost-devel

%description
OpenMW is an attempt to reimplement the popular role playing game Morrowind. It aims to be a fully playable, open source implementation of the game. You must own Morrowind to use OpenMW.

%prep
%setup -q -n %{name}-%{version}-source
# this line is to fix the desktop file that comes with the source
sed -i 's/Version=0.11/Version=0.18/' files/openmw.desktop 

%build
%cmake .
# try to avoid the rpaths issue
sed -i 's/RPATH\:BOOL=NO/RPATH\:BOOL=YES/' CMakeCache.txt
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

# Install
# There is currently no 'make install' so we do this manually

# Binaries
install -d -m755 $RPM_BUILD_ROOT%{_bindir}
install -m755 openmw $RPM_BUILD_ROOT%{_bindir}/
install -m755 omwlauncher $RPM_BUILD_ROOT%{_bindir}/
install -m755 esmtool $RPM_BUILD_ROOT%{_bindir}/

# we need to install this libfile that gets compiled with openmw, since it links to it, and
# the one from Fedora has a different name (mygui-devel provides libMyGUI.OgrePlatform.so)
install -d -m755 $RPM_BUILD_ROOT%{_libdir}
install -m755 extern/mygui_3.0.1/OgrePlatform/libMyGUIOgrePlatform.so $RPM_BUILD_ROOT%{_libdir}/

# Config files
# Replace resources location
sed -i 's,resources=resources,resources=/usr/share/games/openmw/resources,' openmw.cfg.install || exit 1

install -d -m755 $RPM_BUILD_ROOT%{_sysconfdir}/openmw
install -m644 openmw.cfg.install $RPM_BUILD_ROOT%{_sysconfdir}/openmw/openmw.cfg
install -m644 plugins.cfg $RPM_BUILD_ROOT%{_sysconfdir}/openmw/
install -m644 launcher.cfg $RPM_BUILD_ROOT%{_sysconfdir}/openmw/

# Desktop file and icon
install -d -m755  $RPM_BUILD_ROOT%{_datadir}/applications
install -m644 files/openmw.desktop $RPM_BUILD_ROOT%{_datadir}/applications/

install -d -m755 $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m644 apps/launcher/resources/images/openmw.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/

# Resources
install -d -m755 $RPM_BUILD_ROOT%{_datadir}/games/openmw
cp -r resources $RPM_BUILD_ROOT%{_datadir}/games/openmw/ || exit 1
install -m644 launcher.qss $RPM_BUILD_ROOT%{_datadir}/games/openmw/resources

# this bit here will add menu entries immediately after the package is installed
# and don't forget to do the load library deal since we are installing a library
%post
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig

%postun
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_sysconfdir}/%{name}/*
%{_bindir}/*
%{_datadir}/games/%{name}
%{_desktopdir}/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
# the pesky lib file
%{_libdir}/libMyGUIOgrePlatform.so

%changelog
Reply With Quote
  #43  
Old 11th March 2012, 02:44 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,855
linuxchrome
Re: trouble with cmake in rpm building

OK.. got it.. I'll let you know if and when I come up with anything.

---------- Post added at 11:20 PM ---------- Previous post was at 10:35 PM ----------

Here's what I did:
commented out all the lines that added the .so file to the install.
commented out the sed line that modifies the CMakeCache.txt file.
made the %cmake line look like this: %cmake -DCMAKE_SKIP_RPATH=TRUE
did a yum install libblkid-devel (your BuildRequires said I needed it)
fixed Source0: line to get rid of the rpmlint Warning.
ran "rpmbuild -bb openmw.spec

Here are the results:
It compiled without any errors (or warnings about rpath) and built the rpm packages.
Attempt to install the rpm package failed on : Requires: libMyGUIOgrePlatform.so()(64bit)

Thoughts:
Nothing much accomplished except to make the modding of CMakeCache.txt file unnecessary by adding the configuration parameter to the %cmake line.

The .so file did compile and was created. Maybe my lack of the libblkid-devel package prevented that before(?).

---------- Post added at 11:30 PM ---------- Previous post was at 11:20 PM ----------

Code:
BASH:SPECS/-> rpmlint openmw.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
Here it is back at you with some very minor tweaks.
Code:
Name:		openmw
Version:		0.12.0
Release:		1%{?dist}
Summary:	An open source engine for Bethesda Softwork's Elder Scrolls III Morrowind
Group:		Amusements/Games
License:		GPLv3
URL:		http://openmw.org/
Source0:	http://openmw.googlecode.com/files/openmw-0.12.0-source.tar.bz2
BuildRequires:	openal-soft-devel
BuildRequires:	bullet-devel
BuildRequires:	ois-devel
BuildRequires:	libsndfile-devel
BuildRequires:	libmpg123-devel
BuildRequires:	libblkid-devel
BuildRequires:	libpng-devel
BuildRequires:	qt-devel
BuildRequires:	ogre-devel
BuildRequires:	boost-devel

%description
OpenMW is an attempt to reimplement the popular role playing game Morrowind.
It aims to be a fully playable, open source implementation of the game.
You must own Morrowind to use OpenMW.

%prep
%setup -q -n %{name}-%{version}-source
# this line is to fix the desktop file that comes with the source
sed -i 's/Version=0.11/Version=0.18/' files/openmw.desktop 

%build
%cmake -DCMAKE_SKIP_RPATH=TRUE
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

# Install
# There is currently no 'make install' so we do this manually

# Binaries
install -d -m755 $RPM_BUILD_ROOT%{_bindir}
install -m755 openmw $RPM_BUILD_ROOT%{_bindir}/
install -m755 omwlauncher $RPM_BUILD_ROOT%{_bindir}/
install -m755 esmtool $RPM_BUILD_ROOT%{_bindir}/

# we need to install this libfile that gets compiled with openmw, since it links to it, and
# the one from Fedora has a different name (mygui-devel provides libMyGUI.OgrePlatform.so)
install -d -m755 $RPM_BUILD_ROOT%{_libdir}
install -m755 extern/mygui_3.0.1/OgrePlatform/libMyGUIOgrePlatform.so $RPM_BUILD_ROOT%{_libdir}/

# Config files
# Replace resources location
sed -i 's,resources=resources,resources=/usr/share/games/openmw/resources,' openmw.cfg.install || exit 1

install -d -m755 $RPM_BUILD_ROOT%{_sysconfdir}/openmw
install -m644 openmw.cfg.install $RPM_BUILD_ROOT%{_sysconfdir}/openmw/openmw.cfg
install -m644 plugins.cfg $RPM_BUILD_ROOT%{_sysconfdir}/openmw/
install -m644 launcher.cfg $RPM_BUILD_ROOT%{_sysconfdir}/openmw/

# Desktop file and icon
install -d -m755  $RPM_BUILD_ROOT%{_datadir}/applications
install -m644 files/openmw.desktop $RPM_BUILD_ROOT%{_datadir}/applications/

install -d -m755 $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m644 apps/launcher/resources/images/openmw.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/

# Resources
install -d -m755 $RPM_BUILD_ROOT%{_datadir}/games/openmw
cp -r resources $RPM_BUILD_ROOT%{_datadir}/games/openmw/ || exit 1
install -m644 launcher.qss $RPM_BUILD_ROOT%{_datadir}/games/openmw/resources

# this bit here will add menu entries immediately after the package is installed
# and don't forget to do the load library deal since we are installing a library
%post
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig

%postun
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_sysconfdir}/%{name}/*
%dir %{_sysconfdir}/%{name}
%{_bindir}/*
%{_datadir}/games/%{name}
%{_desktopdir}/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
# the pesky lib file
%{_libdir}/libMyGUIOgrePlatform.so

%changelog
A few of the <tabs> aren't formatting right pasted into the forum for some reason.
Had to change the http// line for the source back to original.

---------- Post added 11th March 2012 at 08:44 AM ---------- Previous post was 10th March 2012 at 11:30 PM ----------

Found another item that needs fixing. In the %files section, add: %dir %{_sysconfdir}/%{name}
I had given you that info earlier. Without it, when the package is removed, the /etc/openmw directory is left behind, orphaned.
I edited the posted spec file to include that.

Last edited by PabloTwo; 11th March 2012 at 03:18 PM.
Reply With Quote
  #44  
Old 11th March 2012, 05:37 PM
digimars Offline
Registered User
 
Join Date: May 2005
Posts: 47
linuxfirefox
Re: trouble with cmake in rpm building

Thanks! I used the new spec file you posted, and everything builds and works fine. I did a yum remove, and everything cleaned up nicely.

I believe that I'm good to go on this one. I just need to check with the original developers on how user config files are handled (the user should have his own copy of openmw.cfg) and make sure that I get that squared up during the install.

Thanks again for all your help!
Reply With Quote
  #45  
Old 5th August 2013, 01:47 PM
fedorabawks Offline
Registered User
 
Join Date: Apr 2013
Location: Hugh Kay
Posts: 34
linuxfirefox
Re: trouble with cmake in rpm building

You could also have tried using cpack -G RPM to generate a RPM.
Reply With Quote
Reply

Tags
building, cmake, rpm, trouble

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
[SOLVED] help with cmake ask4nutz Programming & Packaging 0 4th August 2011 09:06 AM
Cmake seabird Using Fedora 3 17th July 2011 05:28 AM
Still having trouble building TrueCrypt dhjdhjdhj Security and Privacy 10 23rd September 2009 06:37 PM
Having trouble building KGtk SpectrumDT Using Fedora 4 27th June 2009 06:18 PM
Trouble building module for rt2500 on FC4 chmims Servers & Networking 2 10th October 2005 04:20 PM


Current GMT-time: 10:36 (Wednesday, 23-04-2014)

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