 |
 |
 |
 |
| Programming & Packaging A place to discuss programming and packaging. |

10th March 2012, 10:18 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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?
|

10th March 2012, 11:00 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
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.
|

11th March 2012, 12:43 AM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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.
|

11th March 2012, 03:18 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
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!
|

11th March 2012, 03:32 AM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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.
|

11th March 2012, 03:39 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
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.
|

11th March 2012, 03:42 AM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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.
|

11th March 2012, 03:44 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
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?
|

11th March 2012, 03:47 AM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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.
|

11th March 2012, 03:48 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
Re: trouble with cmake in rpm building
Makes sense. Once more, I thank you. I've learned a lot from this process.
|

11th March 2012, 04:19 AM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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.
|

11th March 2012, 04:30 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
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
|

11th March 2012, 02:44 PM
|
 |
"Registered User" T-Shirt Winner
|
|
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,128

|
|
|
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.
|

11th March 2012, 05:37 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 47

|
|
|
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!
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 21:18 (Saturday, 25-05-2013)
|
|
 |
 |
 |
 |
|
|