How does RPM handle file locations?
Solution 1
This problem stems from the fact that RHEL wants 64-bit libraries to be installed to the /usr/lib64 directory, rather than the default /usr/lib directory.
mapserver 6.2.1 uses autoconf, and includes a --libdir option. In your .spec file modify the ./configure command: %configure --libdir=$RPM_BUILD_ROOT%{_libdir}
Solution 2
I faced this problem because of missing install command to create that specific directory. Once i have added the install command under %install
, the rpm
generated successfully
install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d
Related videos on Youtube
Comments
-
Jesper Kihlberg over 1 year
I am trying to create a .spec file for creating mapserver as an rpm package. I am building on an RHEL6 64-bit server.
In rpm files I can use some dir references like
%{_libdir}
,%{_bindir}
and%{_libexecdir}
. Where are these dir paths configured, and which can be used?The %files part of my rpm spec looks lige this:
%files %defattr(-,root,root) %doc README COMMITERS GD-COPYING HISTORY.TXT %doc INSTALL MIGRATION_GUIDE.txt %doc symbols tests %doc fonts %{_bindir}/* %{_libdir}/libmapserver*.so %{_libexecdir}/mapserv
but when I run my build I get the errors:
File not found by glob: /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/lib64/libmapserver*.so File not found: /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/libexec/mapserv
It seems like the files that are missing are insted located in
/home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/lib/libmapserver-6.2.1.so /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/lib/libmapserver.la /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/lib/libmapserver.so /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/lib/debug/usr/lib/libmapserver-6.2.1.so.debug /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/lib/debug/usr/lib/libmapserver.so.debug /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/usr/bin/mapserv /home/kfadm/rpmbuild/BUILDROOT/mapserver-6.2.1-3.x86_64/var/www/cgi-bin/mapserv
How do I fix the rpm spec to find the files at the correct path?
-
John over 10 yearsI'm looking at the Makefile produced by a
configure
run on mapserver-6.2.1, and as best I can tell, the problem lies in how autoconf detects the value for @libdir@. The easiest workaround is to add--libdir=/usr/lib64
to your configure directive in your specfile. There's a reference to a .m4 solution at gnu-autoconf.7623.n7.nabble.com/…, but that's a bit over my head. -
jhauris over 10 years@John thanks for pointing out the version... I was looking at 6.4.0 which transitioned to CMake. Modified to make sense for the specific version Jesper is looking for