Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to create a .spec file for creating mapserver as an rpm package. I am building on an RHEL6 64-bit server. I am a bit new to the whole concept, so bear with me if I am not seeing something very obvious. 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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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}

share|improve this answer
    
I'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. –  John Sep 4 '13 at 15:20
    
@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 –  jhauris Sep 4 '13 at 16:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.