View Full Version : [SOLVED] trouble with cmake in rpm building
digimars
9th March 2012, 03:23 PM
Hi all,
I'm trying to build my first package, but I'm running into issues. The source needs cmake to build, so I have this in my spec file:
%build
%cmake .
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
However, I get this in the output of the rpmbuild process:
make: *** No rule to make target 'install'. Stop.
I ran cmake outside the buildroot, and this is what my cmake_install.cmake file contains:
# Install script for directory: /home/makerpm/Downloads/openmw-0.12.0-source
# Set the install prefix
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
IF(BUILD_TYPE)
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
ELSE(BUILD_TYPE)
SET(CMAKE_INSTALL_CONFIG_NAME "")
ENDIF(BUILD_TYPE)
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
IF(COMPONENT)
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
ELSE(COMPONENT)
SET(CMAKE_INSTALL_COMPONENT)
ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
# Install shared libraries without execute permission?
IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
SET(CMAKE_INSTALL_SO_NO_EXE "0")
ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
INCLUDE("/home/makerpm/Downloads/Build/extern/caelum/cmake_install.cmake")
INCLUDE("/home/makerpm/Downloads/Build/extern/mygui_3.0.1/cmake_install.cmake")
INCLUDE("/home/makerpm/Downloads/Build/components/cmake_install.cmake")
INCLUDE("/home/makerpm/Downloads/Build/apps/openmw/cmake_install.cmake")
INCLUDE("/home/makerpm/Downloads/Build/apps/esmtool/cmake_install.cmake")
INCLUDE("/home/makerpm/Downloads/Build/apps/launcher/cmake_install.cmake")
ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)
IF(CMAKE_INSTALL_COMPONENT)
SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
ELSE(CMAKE_INSTALL_COMPONENT)
SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
ENDIF(CMAKE_INSTALL_COMPONENT)
FILE(WRITE "/home/makerpm/Downloads/Build/${CMAKE_INSTALL_MANIFEST}" "")
FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
FILE(APPEND "/home/makerpm/Downloads/Build/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
ENDFOREACH(file)
Am I missing something? I can compile the source outside of the buildroot and run the application, I just can't do 'make install' as I get the error above.
Thanks in advance.
PabloTwo
9th March 2012, 05:27 PM
It would help if you posted the sequence of commands you used to successfully build and install the program outside of the buildroot. It might also be helpful if you mentions what program you're building, and maybe a link to the source code tarball.
Maybe your source code doesn't like something in "%cmake" in the spec file (?)
BASH:~/-> rpm --eval %cmake
CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FFLAGS ;
LDFLAGS="${LDFLAGS:--Wl,-z,relro }" ; export LDFLAGS ;
/usr/bin/cmake \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 \
-DINCLUDE_INSTALL_DIR:PATH=/usr/include \
-DLIB_INSTALL_DIR:PATH=/usr/lib64 \
-DSYSCONF_INSTALL_DIR:PATH=/etc \
-DSHARE_INSTALL_PREFIX:PATH=/usr/share \
%if "lib64" == "lib64"
-DLIB_SUFFIX=64 \
%endif
-DBUILD_SHARED_LIBS:BOOL=ON
digimars
9th March 2012, 05:32 PM
Here is the link to the source:
http://openmw.googlecode.com/files/openmw-0.12.0-source.tar.bz2
All I run outside of the buildroot are:
cmake
make
If I try to run 'make install' I get the same error, but I have no troubles running the program from within the directory that I compile the program.
PabloTwo
9th March 2012, 07:08 PM
I'm struggling with this one... running "cmake" in the top dir of the source code package bombs for me. The Building from Source section in the readme.txt file for GNUCC has no instructions. I can determine what directories should be created and what files install into directories for a UNIX (DPKG) build/install just by reading through the CMakeLists.txt file in the top dir.
/usr/share/applications/openmw.desktop
/usr/share/pixmaps/openmw.png
/etc/openmw/openmw.cfg <== file renamed from openmw.cfg.install
/etc/openmw/plugins.cfg
/usr/share/games/openmw/data/
I'd need to read all the other CMakeLists.txt files in the sub-dirs to see what/where else is supposed to get installed.. Looks like "Morrowind" must be installed (in wine) as a prerequisite.
---------- Post added at 02:08 PM ---------- Previous post was at 01:29 PM ----------
I looked at their download site and notice they have both 32 and 64 bit rpm packages for the latest version of openmw, as well as pre-built bianary tarballs.
digimars
9th March 2012, 07:36 PM
Correct. they do have rpm's but they were built on ubuntu and will not install on fedora. i was going to try my hand ar building fedora packages for them.
PabloTwo
9th March 2012, 08:36 PM
What version of cmake are you using? Mine is cmake-2.8.7-4.fc16.x86_64. Running cmake with no argument just spits out a "useage" list. When I specify a file (cmake ./CMakeLists.txt), I get results but I'm told right away I'm missing the "OGRE" module.
leigh123linux
9th March 2012, 08:46 PM
Try this, you will need to finish it.
Name: openmw
Version: 0.12.0
Release: 1%{?dist}
Summary: blah blah
License: GPLv2+
URL: http://openmw.googlecode.com
Source0: http://openmw.googlecode.com/files/openmw-0.12.0-source.tar.bz2
BuildRequires: cmake ogre-devel ois-devel bullet-devel
BuildRequires: openal-devel libmpg123-devel libuuid-devel
%description
blah blah
%prep
%setup -q -n %{name}-%{version}-source
%build
%cmake .
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}/
# 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
%files
http://aur.archlinux.org/packages/op/openmw/PKGBUILD
digimars
9th March 2012, 09:05 PM
This is my cmake version:
cmake-2.8.7-4.fc16.x86_64
I have the following packages installed so that I can compile the source:
ogre-devel, ois-devel, openal-soft-devel, bullet-devel, libsndfile-devel, libmpg123-devel (from rpmfusion), mygui-devel, libblkid-devel, libpng-devel, qt-devel
I REALLY appreciate your help. This is my first time trying to build an RPM package, and I would really like to be able to get it to work.
Thanks leigh123linux, I'll give your spec file a try.
---------- Post added at 04:05 PM ---------- Previous post was at 03:49 PM ----------
Even though there is no 'make install' directive any more, I'm still getting the " make: *** No rule to make target `install'. Stop." error message.
Here's the current spec file (I'll clean it up once I get an initial build completed):
Name: openmw
Version: 0.12.0
Release: 1%{?dist}
Summary: An open source engine for Bethesda Softwork's Elder Scrolls III Morrowind
Group: Applications/Games
License: GPLv3
URL: http://openmw.org/
Source0: %{name}-%{version}.tar.gz
Source1: %{name}.desktop
Source2: %{name}.png
BuildRequires: openal-soft-devel
BuildRequires: bullet-devel
BuildRequires: ois-devel
BuildRequires: libsndfile-devel
BuildRequires: libmpg123-devel
BuildRequires: mygui-devel
BuildRequires: libblkid-devel
BuildRequires: libpng-devel
BuildRequires: qt-devel
Requires: ogre
Requires: ois
Requires: libmpg123
Requires: mygui
Requires: bullet
Requires: libsndfile
%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
%build
%cmake .
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}/
# 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
%files
%defattr(-,root,root,-)
#%doc readme.txt
%{_bindir}/%{name}
%{_datadir}/%{name}
#%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%changelog
PabloTwo
9th March 2012, 09:40 PM
I got it to build in the source code top directory by throwing (most of) the output of "rpm --eval %cmake" to the command line (removing the %if and %endif lines) after installing the deps.
digimars
9th March 2012, 09:56 PM
You got the program to compile or the rpm to build?
PabloTwo
9th March 2012, 10:31 PM
The program to compile. I haven't tried to build the rpm package. For me, or Leigh, it would now be a a piece of cake to finish up the spec file he presented, but I understand that on your very first try at building an rpm package for Fedora, things aren't so obvious. Your %files section is not complete. You need to make reference to every file being installed, even if it's by *glob*.
%{_bindir}/%{name} should be %{_bindir}/*
as your sticking 3 binary files in /usr/bin, not just the one named opennw. Either that, or create 3 separate entries:
%{_bindir}/%{name}
%{_bindir}/omwlauncher
%{_bindir}/emstool
You don't have an entry for the %{_sysconfidir} at all.
Directory %{_sysconfidir}/%{name} should be declared as a directory in the %files section, as it is owned by the package.
%{_sysconfdir}/%{name}/*
%dir %{_sysconfdir}/%{name}
Account for every file and unique package directory in the %files section.
Use rpmlint openmw.spec to help find the fatal flaws in the spec file. When you get all ERRORS fixed, then work on getting the WARNINGS to a minimum. "yum install rpmlint".
digimars
9th March 2012, 10:37 PM
Thanks again.
I'll correct my files section this evening and try this again. I'll also run the rpmlint command you displayed. I'll report back my results after I make these changes.
PabloTwo
10th March 2012, 01:18 AM
Here's some more hints/suggestions/tid-bits and observations:
You can shorten %{_datadir}/applications/ by using %{_desktopdir}/
BASH:~/-> rpm --eval %{_desktopdir}
/usr/share/applications
You should add a %post and %postun section, just above the %files section, because your installing a menu *.desktop file into /usr/share/applications:
%post
/usr/bin/update-desktop-database &> /dev/null || :
%postun
/usr/bin/update-desktop-database &> /dev/null || :
These script commands will make the menu item available immediately after the package is installed, and make it immediately gone from the menu when the package is uninstalled.
You don't really need any "Requires" declarations at all. In fact, just assuming because you needed a *-devel package to do the build, doesn't automatically mean the package will need the associated binary package to run, though often it does. The rpm build macros will automatically determine what the real "requires" are and include that in the package meta-data, so it will pull in all needed deps from the repos when the package is installed with yum.
Your spec file doesn't need the Source1 and Source2 files, as those files are already provided by the source code package.
mygui-devel didn't appear to me to be a build requirement. My build went fine without it and there were no complaints it was missing. Sometimes, things are "optional", so maybe having that installed added "something" in the build.
Use the spec file Leigh posted as your guide, and only add the essential needed stuff to it.
---------- Post added at 08:18 PM ---------- Previous post was at 07:32 PM ----------
Here's a little "picky" thing I found that could use a fix:
BASH:~/-> desktop-file-validate /home/paul/src/openmw-0.12.0-source/files/openmw.desktop
/home/paul/src/openmw-0.12.0-source/files/openmw.desktop: error: value "0.11" for key "Version" in group "Desktop Entry" is not a known version
To fix that, in the %setup section, add the line:
sed -i 's/Version=0.11/Version=0.18/' files/openmw.desktop
digimars
10th March 2012, 02:35 AM
Ok, I've now gotten a LOT further than where I was.
However, now I get an rpath error:
ERROR 0002: file '/usr/bin/openmw' contains an invalid rpath '/home/makerpm/rpmbuild/BUILD/openmw-0.12.0-source/extern/mygui_3.0.1/OgrePlatform' in [/home/makerpm/rpmbuild/BUILD/openmw-0.12.0-source/extern/mygui_3.0.1/OgrePlatform]
error: Bad exit status from /var/tmp/rpm-tmp.lIe8fN (%install)
Which, if I'm reading this right, pertains to this error message (?):
0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
* nor relative filenames and can therefore be a SECURITY risk
And I've been looking over this (http://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath) to try and make sense of it. It looks like there are a few ways to fix this. What is the least intrusive way without modifying the original source code?
PabloTwo
10th March 2012, 03:08 AM
I don't have an immediate answer/solution for that. As stated in the guidelines you linked, if using %configure it would be much easier to tackle. Leigh's way more experienced at handling those situations than myself, maybe he'll volunteer a suggestion when he has time.
Glad to see you making such good progress though.
digimars
10th March 2012, 02:59 PM
Awesome! I was finally able to finish a build. I had to prepend this to my command:
QA_RPATHS=$[ 0x0002|0x0020 ] rpmbuild -ba openmw.spec
and modify my files section again, but I now have a built RPM file! I'm not sure if that was the cleanest way to approach that, but it did work.
Now I need to install it on a system and actually try it out.
Thanks to the both of you for your help!
---------- Post added at 09:59 AM ---------- Previous post was at 09:55 AM ----------
EDIT:
whoops, it's still broken. This is what I get when I try to install:
root@mis-laptop x86_64]# yum localinstall openmw-0.12.0-1.fc16.x86_64.rpm
Loaded plugins: langpacks, presto, refresh-packagekit
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
adobe-linux-i386 | 951 B 00:00
rpmfusion-free-updates | 3.3 kB 00:00
updates/metalink | 13 kB 00:00
updates | 4.5 kB 00:00
updates/primary_db | 5.3 MB 00:05
updates/group_gz | 431 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package openmw.x86_64 0:0.12.0-1.fc16 will be installed
--> Processing Dependency: libMyGUIOgrePlatform.so()(64bit) for package: openmw-0.12.0-1.fc16.x86_64
--> Finished Dependency Resolution
Error: Package: openmw-0.12.0-1.fc16.x86_64 (/openmw-0.12.0-1.fc16.x86_64)
Requires: libMyGUIOgrePlatform.so()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Would this be a problem with the requires seciton of the .spec file?
BuildRequires: openal-soft-devel
BuildRequires: bullet-devel
BuildRequires: ois-devel
BuildRequires: libsndfile-devel
BuildRequires: libmpg123-devel
BuildRequires: mygui-devel
BuildRequires: libblkid-devel
BuildRequires: libpng-devel
BuildRequires: qt-devel
BuildRequires: ogre-devel
Actually, I found that when I compiled the code outside of the rpmbuild directory by hand, I have a file called libMyGUIOgrePlatform.a. I'm thinking that is what the rpath error was pointing to to begin with, and that in this (http://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath) section about rpath, this could be one of those internal libraries I would have to specify in my spec file. But the thing that bothers me is that the file has a '.a' extension instead of a '.so' extension, so I'm not sure what to do here.
PabloTwo
10th March 2012, 04:05 PM
Whatever the fix is for the "rpaths" issue, it needs to be done in the spec file, not at the command line.
With some cursory googleing for "cmake and rpaths", it seems cmake needs to be passed some directive to "not use", or "skip" rpaths. Such a directive would be appended to the "%cmake" section.
Also, I just did this in my openmw source code top directory, with interesting results:
BASH:openmw-0.12.0-source/-> grep -i rpath *
CMakeCache.txt:CMAKE_SKIP_RPATH:BOOL=NO
CMakeCache.txt://ADVANCED property for variable: CMAKE_SKIP_RPATH
CMakeCache.txt:CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
Binary file omwlauncher matches
Binary file openmw matches
Keep in mind I did the build without having mygui-devel installed.
I don't know if just modifying the lline "CMAKE_SKIP_RPATH:BOOL=NO" in the CMakeCache.txt file to "CMAKE_SKIP_RPATH:BOOL=YES" would do the magic or not. That could be done with a sed command in the %setup section.
sed -i 's/RPATH\:BOOL=NO/RPATH\:BOOL=YES/' CMakeCache.txt
Or maybe adding the parameter: -DCMAKE_SKIP_RPATH:BOOL=YES to %cmake in the spec file would do the trick. I still haven't followed very many of the "hits" on the "remvoe rpath with cmake" google search.
Any .a or .la files are static libraries and Fedora avoids installing those. It's the rpaths that appear to be linking the installed binaries to them, which is what needs to be fixed. the "BuildRequires" entries do not affect the final rpm package "requires".
---------- Post added at 11:05 AM ---------- Previous post was at 10:50 AM ----------
Oh, and boost-devel should be one of the "BuildRequires". I compiled with boost-devel installed and doing:
ldd openmw
ldd omwlauncher
showed these:
BASH:openmw-0.12.0-source/-> ldd openmw | grep boost
libboost_system-mt.so.1.47.0 => /usr/lib64/libboost_system-mt.so.1.47.0 (0x00007fd501e71000)
libboost_filesystem-mt.so.1.47.0 => /usr/lib64/libboost_filesystem-mt.so.1.47.0 (0x00007fd501c53000)
libboost_program_options-mt.so.1.47.0 => /usr/lib64/libboost_program_options-mt.so.1.47.0 (0x00007fd5019f1000)
libboost_thread-mt.so.1.47.0 => /usr/lib64/libboost_thread-mt.so.1.47.0 (0x00007fd5017d6000)
libboost_date_time-mt.so.1.47.0 => /usr/lib64/libboost_date_time-mt.so.1.47.0 (0x00007fd500524000)
BASH:openmw-0.12.0-source/-> ldd omwlauncher | grep boost
libboost_system-mt.so.1.47.0 => /usr/lib64/libboost_system-mt.so.1.47.0 (0x00007f6998b57000)
libboost_filesystem-mt.so.1.47.0 => /usr/lib64/libboost_filesystem-mt.so.1.47.0 (0x00007f6998938000)
libboost_program_options-mt.so.1.47.0 => /usr/lib64/libboost_program_options-mt.so.1.47.0 (0x00007f69986d7000)
libboost_thread-mt.so.1.47.0 => /usr/lib64/libboost_thread-mt.so.1.47.0 (0x00007f69984bc000)
libboost_date_time-mt.so.1.47.0 => /usr/lib64/libboost_date_time-mt.so.1.47.0 (0x00007f6997862000)
I should install mygui-devel and recompile and check ldd paths again on those two binaries and see if the rpaths links show up.
digimars
10th March 2012, 04:33 PM
Thanks again. And I see the benefit of having everything in the spec file instead of on the command line. If I needed to hand the spec file off to someone else, all of the commands would be within that file, and they could just run the rpmbuild command against that. It makes sense.
I have now added the boost-devel as a build requirement.
I also tried adding the ...
sed -i 's/RPATH\:BOOL=NO/RPATH\:BOOL=YES/' CMakeCache.txt
...to the setup section, but it failed, saying that the CMakeCache.txt file didn't exist. I saw that that file doesn't get created until after cmake is ran, so I put that sed command in between the cmake and make commands in the %build section of the spec file, and that allowed the build to complete.
When I look at the output of the command that states what the RPM requires, I still see libMyGUIOgrePlatform.so()(64bit) listed. So if rpath is what is telling the binary files to link to that static library (thanks for clearing that up by the way), how can I get around that?
PabloTwo
10th March 2012, 06:49 PM
BASH:openmw-0.12.0-source/-> ls CMakeCache.txt
CMakeCache.txt
Once "%setup" has run, your current working directory should be in the top dir of the source code tarball in ..../rpmbuild/BUILD/openmw-0.12.0-source/ and the CMakeCache.txt file should be there. ??
I did a "make clean", installed mygui-devel did the sed command on the CMakeCache.txt file to flip the NO to YES. Then passed -"DCMAKE_SKIP_RPATH:BOOL=YES" to cmake and did the rebuild.
Checking with "ldd" on all 3 compiled binaries I find no link to anything "mygui" there, which only reinforces my suspicion that mygui-devel is not a build requirement. But doing the "grep -i rpath *" command again still shows the openmw and omwlauncher files still having a reference to rpath
BASH:openmw-0.12.0-source/-> grep -i rpath *
CMakeCache.txt:CMAKE_SKIP_RPATH:BOOL=YES
CMakeCache.txt://ADVANCED property for variable: CMAKE_SKIP_RPATH
CMakeCache.txt:CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
Binary file omwlauncher matches
Binary file openmw matchese to rpath.
I am fairly unfamiliar with "cmake" and sticky "rpaths" issues in rpm package building. This is probably going to take more expert advice than I can provide. Yes, all the fixes need to be in the spec file, otherwise, you don't have a "proper" spec file.
Yeah, doing "yum provides "libMyGUIOgrePlatform.so()(64bit)" turns up an empty search, as there is no package in the Fedora or RPMFusion repos that provides that.
---------- Post added at 12:48 PM ---------- Previous post was at 12:08 PM ----------
What is installed is /usr/lib64/libMyGUI.OgrePlatform.so which is installed by the mygui-devel package.
Notice it has a period "." between libMyGUI and OgrePlatform.so while the "libMyGUIOgrePlatform.so()(64bit)" does not. I have no clue at this time how to fix that, other than to "yum erase mygui*" then rebuild and see if that "requirement" is gone.
---------- Post added at 01:49 PM ---------- Previous post was at 12:48 PM ----------
Looking at all the files in openmw-0.12.0-source/resources/mygui/, I'm wondering if only the mygui binary is required as a run time app, but that mygui-devel is not required as a build requirement?
digimars
10th March 2012, 08:04 PM
What is installed is /usr/lib64/libMyGUI.OgrePlatform.so which is installed by the mygui-devel package.
Notice it has a period "." between libMyGUI and OgrePlatform.so while the "libMyGUIOgrePlatform.so()(64bit)" does not. I have no clue at this time how to fix that, other than to "yum erase mygui*" then rebuild and see if that "requirement" is gone.
What about a symlink? Could that be done in the spec file to get around that, having a symlink that would point the one without the dot to the one that Fedora has with the dot?
---------- Post added at 02:49 PM ---------- Previous post was at 02:41 PM ----------
I uninstalled mygui-devel, and commented out the BuildRequires mygui-devel from the spec file and recompiled. I was able to get the rpm to build, so apparently mygui-devel [I]isn't[I] needed to compile this.
However, when I try to install the newly created rpm file, it still fails on the libMyGUIOgrePlatform.so()(64bit) dependency.
---------- Post added at 03:04 PM ---------- Previous post was at 02:49 PM ----------
Ah, nevermind about the symbolic link, the rpmdb doesn't care about those, so that idea won't work.
However, after I did the recompile, I went and looked at the BUILD/openmw-0.12.0-source/extern/mygui_3.0.1/OgrePlatform directory, and there IS a libMyGUIOgrePlatform.so file in there. Should I have that as part of the install routine in the spec file? Would that be the fix?
PabloTwo
10th March 2012, 08:07 PM
...to the setup section, but it failed, saying that the CMakeCache.txt file didn't exist. I saw that that file doesn't get created until after cmake is ran, so I put that sed command in between the cmake and make commands in the %build section of the spec file, and that allowed the build to complete.
I guess I skimmed over that part too quickly and failed to absorb the bit about changing the location of the sed line. Yeah, you're right. the CMakeCache.txt file isn't part of the original tarball install. I lost sight of that fact.
On the libMyGUIOgrePlatform.so()(64bit) issue, a symlink won't help here. This dependency is "baked in" into the rpm package meta data. What it wants to install as a run time "dependency" is mygui-devel, but the difference in the .so file name (one with a dot and the other without), is blowing up any chance for yum to find that dependency. Why the Fedora package of mygui-devel even has an so file with a period in the name (excluding the dot to separate the extention so), is very puzzling to me. I've never seen that before.
If the "sed -i 's/RPATH\:BOOL=NO/RPATH\:BOOL=YES/' CMakeCache.txt" line isn't making any difference on the rpaths issue, then forget about using that.
digimars
10th March 2012, 08:12 PM
However, after I did the recompile, I went and looked at the BUILD/openmw-0.12.0-source/extern/mygui_3.0.1/OgrePlatform directory, and there IS a libMyGUIOgrePlatform.so file in there. Should I have that as part of the install routine in the spec file? Would that be the fix?
What do you think about that part?
PabloTwo
10th March 2012, 08:17 PM
In my /home/paul/src/openmw-0.12.0-source/extern/mygui_3.0.1/OgrePlatform directory, I'm seeing:
BASH:OgrePlatform/-> ll
total 836
drwxrwxr-x. 3 paul paul 4096 Mar 10 11:24 CMakeFiles
-rw-rw-r--. 1 paul paul 1185 Mar 9 16:27 cmake_install.cmake
-rw-r--r--. 1 paul paul 283 Mar 5 17:31 CMakeLists.txt
drwxr-xr-x. 2 paul paul 4096 Mar 5 17:31 include
-rw-rw-r--. 1 paul paul 812754 Mar 10 11:26 libMyGUIOgrePlatform.a
-rw-rw-r--. 1 paul paul 16032 Mar 9 16:27 Makefile
-rw-r--r--. 1 paul paul 1115 Mar 5 17:31 MyGUI.OgrePlatform.list
drwxr-xr-x. 2 paul paul 4096 Mar 5 17:31 src
No libMyGUIOgrePlatform.so file there for me. Maybe that's because I did my build using the "-DCMAKE_SKIP_RPATH:BOOL=YES" option to cmake (?). mygui-devel was installed on this last build.
In any case, this is an "external" file to the build and is not meant to be part of the install. the rpaths is linking to it though, and that's the problem. It's still just a "get rid of the rpaths links" problem.
digimars
10th March 2012, 08:20 PM
I had the libMyGUIOgrePlatform.a file too, but then I uninstalled mygui-devel and recompiled, and that's when I ended up with the .so file instead. I also still have the line in there to skip the rpath check in my spec file.
In any case, this is an "external" file to the build and is not meant to be part of the install. the rpaths is linking to it though, and that's the problem. It's still just a "get rid of the rpaths links" problem.
That's definetly outside of my current knowledge. I can compile applications, I just can't code them.
PabloTwo
10th March 2012, 08:29 PM
Rethinking this.... since the libMyGUIOgrePlatform.so in your build was "compiled" during the build, you could consider installing it as part of the package in /usr/lib[64]/. That way, the package "provides" the "dependency", which is common in many rpm packages. However, I think that's a kludge and will do nothing to solve the rpath problem, because the "dependency" upon "libMyGUIOgrePlatform.so" is caused by the rpath link (I think).
digimars
10th March 2012, 08:44 PM
Rethinking this.... since the libMyGUIOgrePlatform.so in your build was "compiled" during the build, you could consider installing it as part of the package in /usr/lib[64]/. That way, the package "provides" the "dependency", which is common in many rpm packages. However, I think that's a kludge and will do nothing to solve the rpath problem, because the "dependency" upon "libMyGUIOgrePlatform.so" is caused by the rpath link (I think).
That's what I was wondering, as I think it is along this line:
Rpath for Internal Libraries
When a program installs internal libraries they are often not installed in the system path. These internal libraries are only used for the programs that are present in the package (for example, to factor out code that's common to the executables). These libraries are not intended for use outside of the package. When this occurs, it is acceptable for the programs within the package to use an rpath to find these libraries.
Example:
# Internal libraries for myapp are present in:
%{_libdir}/myapp/
%{_libdir}/myapp/libmyapp.so.0.3.4
%{_libdir}/myapp/libmyapp.so
# myapp has an rpath to %{_libdir}/myapp/
readelf -d /usr/bin/myapp | grep RPATH
0x0000000f (RPATH) Library rpath: [/usr/lib/myapp]
from here (http://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath)
---------- Post added at 03:44 PM ---------- Previous post was at 03:36 PM ----------
So does this look like the right way to attempt this:
In the %install section:
install -d -m755 $RPM_BUILD_ROOT%{_libdir}
install -m755 extern/mygui_3.0.1/OgrePlatform/libMyGUIOgrePlatform.so $RPM_BUILD_ROOT%{_libdir}/
and in the %files section:
%{_libdir}/libMyGUIOgrePlatform.so
..or am I off bbase here?
PabloTwo
10th March 2012, 09:00 PM
Well, what you posted above to install the libMyGUIOgrePlatform.so file is exactly what I meant by saying "you could consider installing it as part of the package in /usr/lib[64]/.". But, as said, it's a kludge that would/should allow the completed rpm package to install without failing on that dependency.
If the rpath issue was solved, it wouldn't/shouldn't have that dependency.
I blew away my openmw-0.12.0-source directory and did a fresh untarring of the source code tarball to work in. Uninstalled mygui-devel and did a fresh build. I still got no libMyGUIOgrePlatform.so file created.
---------- Post added at 04:00 PM ---------- Previous post was at 03:57 PM ----------
Oh, and anytime you add a *.so file to your rpm package, you need to add this line to both the %post and %postun scripting sections:
/sbin/ldconfig
digimars
10th March 2012, 09:56 PM
I should clarify, that the rpmbulid process is what got me the .so instead of the .a file (wierd).
Just for grins and giggles, I'm going to try and set up the rpm with the lib file, and try and install that. I'll report back what I end up with.
---------- Post added at 04:44 PM ---------- Previous post was at 04:31 PM ----------
---------- Post added at 04:45 PM ---------- Previous post was at 04:44 PM ----------
]I think I found it!
I was looking in the output of the make command, and saw that it was pointing to the file:
BUILD/openmw-0.12.0-source/apps/openmw/CMakeFiles/openmw.dir/link.txt
And in there is this line:
CMakeFiles/openmw.dir/engine.cpp.o -o ../../openmw -rdynamic -lOgreMain -lpthread -lOIS -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lopenal -lmpg123 -lsndfile -lBulletDynamics -lBulletCollision -lLinearMath -lBulletSoftBody ../../extern/caelum/libcaelum.a ../../components/libcomponents.a ../../extern/mygui_3.0.1/MyGUIEngine/libMyGUIEngine.a ../../extern/mygui_3.0.1/OgrePlatform/libMyGUIOgrePlatform.so -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lfreetype -ldl -luuid -lOgreMain -lpthread
This line was at the end of the file, and it looks like this is the only place that libMyGUIOgrePlatform.so is mentioned.
So, would dropping in a sed statement after the cmake line and before the make line to change this to the libMyGUI.OgrePlatform that Fedora has solve the problem?
---------- Post added at 04:56 PM ---------- Previous post was at 04:45 PM ----------
Crud, I tried this:
%build
%cmake .
# try to avoid the rpaths issue
sed -i 's/RPATH\:BOOL=NO/RPATH\:BOOL=YES/' CMakeCache.txt
# try and fix the library issue
sed -i 's/libMyGUIOgrePlatform.so/libMyGUI.OgrePlatform.so/' apps/openmw/CMakeFiles/openmw.dir/link.txt
make %{?_smp_mflags}
However, it looks like the link.txt file is created DURING the make process, not the cmake process. I ran a test outside of the buildroot to try this, and I confirmed this.
Is there a way to modify the link.txt file while make is running?
PabloTwo
10th March 2012, 10:02 PM
I looked at the contents of my openmw-0.12.0-source/apps/openmw/CMakeFiles/openmw.dir/link.txt file and there is no reference to the libMyGUIOgrePlatform.so file in it, only the libMyGUIOgrePlatform.a file. So the link.txt file was created on-the-fly during the cmake or make process. If it was there after running %cmake then you could sed it out. Otherwise, it's too late.
---------- Post added at 05:02 PM ---------- Previous post was at 04:59 PM ----------
Is there a way to modify the link.txt file while make is running?
Not anyway that I'm aware of. It's kind of a shame the build takes as long as it does for this package. recompiling over and over and over again can sure eat up a lot of time.
Anyway, even if you could do that, then changing it to the Fedora package .so name would break the build process from using it (I think).
digimars
10th March 2012, 10:15 PM
Actually, it is there after the cmake process. I wasn't looking deep enough. For some reason, I can't seem to sed it out properly. Every time I look at the file, it still says the same thing.
As for the .a file, yeah, that shows up when it is built outside of the rpm buildroot (for some reason)
But when I build it in the rpm buildroot, from the spec file, I get the .so file instead.
---------- Post added at 05:15 PM ---------- Previous post was at 05:13 PM ----------
Ah, my sed statement was wrong, got it that time. I'm going to try a new build with this and see what happens.
PabloTwo
10th March 2012, 10:18 PM
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?
digimars
10th March 2012, 11:00 PM
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:
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 ----------
Is this what your doing in the spec file? : %cmake -DCMAKE_SKIP_RPATH:BOOL=YES
This is what I have in my spec file:
%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:
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.
PabloTwo
11th March 2012, 12:43 AM
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:
%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?
digimars
11th March 2012, 03:18 AM
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.
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.
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!
PabloTwo
11th March 2012, 03:32 AM
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.
digimars
11th March 2012, 03:39 AM
Nope, I didn't get the ldconfig line in there, I assume your're talking about this:
%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.
PabloTwo
11th March 2012, 03:42 AM
No.. I mean you should now have:
%post
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig
%postun
/usr/bin/update-desktop-database &> /dev/null || :
/sbin/ldconfig
digimars
11th March 2012, 03:44 AM
Ah, I'll correct that then.
So the %postun should have /sbin/config as opposed to /sbin/ldconfig?
PabloTwo
11th March 2012, 03:47 AM
%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
digimars
11th March 2012, 03:48 AM
Makes sense. Once more, I thank you. I've learned a lot from this process.
PabloTwo
11th March 2012, 04:19 AM
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.
digimars
11th March 2012, 04:30 AM
Sure thing:
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
PabloTwo
11th March 2012, 02:44 PM
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 ----------
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.
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.
digimars
11th March 2012, 05:37 PM
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!
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.