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:

%doc symbols tests
%doc fonts

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



How do I fix the rpm spec to find the files at the correct path?


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}

  • 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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