]> granicus.if.org Git - libjpeg-turbo/commitdiff
SRPM build: Define _libdir based on build arch
authorDRC <information@libjpeg-turbo.org>
Wed, 20 Sep 2017 18:11:03 +0000 (18:11 +0000)
committerDRC <information@libjpeg-turbo.org>
Wed, 20 Sep 2017 18:13:23 +0000 (18:13 +0000)
Setting _libdir to CMAKE_INSTALL_FULL_LIBDIR only works when doing an
in-tree RPM build.  SRPMs are architecture-agnostic, so the spec needs
to compute_libdir at the time the SRPM is rebuilt, not at the time it
is generated.

This is a regression introduced when implementing the new CMake-based
cross-platform build system.

release/rpm.spec.in

index 075e69b6f3e5e0c826290524d9c6dc0c42ab0ae3..54101bc79f83e9fae17169e877e5d62d49805da8 100644 (file)
@@ -4,7 +4,6 @@
 %define _docdir %{_defaultdocdir}/%{name}-%{version}
 %define _includedir @CMAKE_INSTALL_FULL_INCLUDEDIR@
 %define _javadir @CMAKE_INSTALL_FULL_JAVADIR@
-%define _libdir @CMAKE_INSTALL_FULL_LIBDIR@
 %define _mandir @CMAKE_INSTALL_FULL_MANDIR@
 %define _enable_static @ENABLE_STATIC@
 %define _enable_shared @ENABLE_SHARED@
 %endif
 %endif
 
+#-->%if 1
+%if "%{_bits}" == "64"
+%define _libdir %{_exec_prefix}/lib64
+%else
+%if "%{_prefix}" == "/opt/libjpeg-turbo"
+%define _libdir %{_exec_prefix}/lib32
+%endif
+%endif
+#-->%else
+%define _libdir @CMAKE_INSTALL_FULL_LIBDIR@
+#-->%endif
+
 Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
 Name: @PKGNAME@
 Version: @VERSION@