From 28d69c2c80ecdc093381723f27d465851da5785f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 21 Dec 2011 22:36:39 +0100 Subject: [PATCH] Create path variables. As the new x86_64 architecture places libs in lib64 instead of lib we need to define it somewhere. To change other paths in the future, we use a lot of variables for them that have been introduced here. (Also fix libtool rpath fix - that never worked before.) --- macros/arch.macro | 41 +++++++++++++++++++++++++++++++++++++++++ macros/build.macro | 2 +- macros/constants.macro | 12 +++--------- macros/templates.macro | 26 +++++++++++++------------- 4 files changed, 58 insertions(+), 23 deletions(-) create mode 100644 macros/arch.macro diff --git a/macros/arch.macro b/macros/arch.macro new file mode 100644 index 000000000..e756b8e42 --- /dev/null +++ b/macros/arch.macro @@ -0,0 +1,41 @@ + +# Definitions for architectures. + +prefix = /usr +exec_prefix = %{prefix} +bindir = %{exec_prefix}/bin +sbindir = %{exec_prefix}/sbin +libexecdir = %{exec_prefix}/lib +datadir = %{prefix}/share +sysconfdir = /etc +sharedstatedir = %{prefix}/com +localstatedir = /var +lib = lib +libdir = %{exec_prefix}/%{lib} +includedir = %{prefix}/include +infodir = %{datadir}/info +mandir = %{datadir}/man + +if "%{DISTRO_ARCH}" == "x86_64" + # Libs are installed in /lib64 and %{prefix}/lib64 on x86_64 + lib = lib64 +end + +CONFIGURE_SCRIPT = configure +configure_options = \ + --host=%{DISTRO_MACHINE} \ + --build=%{DISTRO_MACHINE} \ + --prefix=%{prefix} \ + --exec-prefix=%{exec_prefix} \ + --bindir=%{bindir} \ + --sbindir=%{sbindir} \ + --sysconfdir=%{sysconfdir} \ + --datadir=%{datadir} \ + --includedir=%{includedir} \ + --libdir=%{libdir} \ + --libexecdir=%{libexecdir} \ + --localstatedir=%{localstatedir} \ + --sharedstatedir=%{sharedstatedir} \ + --mandir=%{mandir} \ + --infodir=%{infodir} \ + --disable-dependency-tracking diff --git a/macros/build.macro b/macros/build.macro index 61a42a035..5d6a003e8 100644 --- a/macros/build.macro +++ b/macros/build.macro @@ -99,7 +99,7 @@ build ./%{CONFIGURE_SCRIPT} \ %{configure_options} - ${MACRO_FIX_LIBTOOL} + %{MACRO_FIX_LIBTOOL} fi # Run custom commands. diff --git a/macros/constants.macro b/macros/constants.macro index aeab1eff5..07459a39e 100644 --- a/macros/constants.macro +++ b/macros/constants.macro @@ -9,12 +9,6 @@ DIR_SRC = %{DIR_BUILD}/source DIR_TMP = /tmp DIR_SOURCE = %{BASEDIR} -CONFIGURE_SCRIPT = configure -configure_options = \ - --host=%{DISTRO_MACHINE} \ - --build=%{DISTRO_MACHINE} \ - --prefix=/usr - # By default, take all patches from the patches directory # in alphabetical order. patches = $(find %{DIR_PATCHES} -not -type d 2>/dev/null | sort) @@ -28,9 +22,9 @@ MACRO_EXTRACT = tar xaf # Remove rpath from libtool. MACRO_FIX_LIBTOOL - if [ -e "%{DIR_APP}/libtool" ]; then - sed -e %{DIR_APP}/libtool \ - -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' + if [ -e "libtool" ]; then + sed -i libtool \ + -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' fi end diff --git a/macros/templates.macro b/macros/templates.macro index 8fb502d98..05eeb5370 100644 --- a/macros/templates.macro +++ b/macros/templates.macro @@ -21,8 +21,8 @@ packages description = Runtime library files of the package %{thisapp}. def files - /lib/lib*.so.* - /usr/lib*/lib*.so.* + /%{lib}/*.so.* + ${libdir}/lib*.so.* end def configfiles @@ -38,17 +38,17 @@ packages requires = %{name}=%{thisver} def files - /usr/bin/*-config - /usr/include - /usr/lib/*.a - /usr/lib/pkgconfig - /usr/share/aclocal - /usr/lib/*.so - /usr/share/*/cmake - /usr/share/man/man2 - /usr/share/man/man3 - /usr/share/pkgconfig - /usr/share/vala + %{bindir}/*-config + %{includedir} + %{libdir}//*.a + %{libdir}/pkgconfig + %{datadir}/aclocal + %{libdir}/*.so + %{datadir}/*/cmake + %{mandir}/man2 + %{mandir}/man3 + %{datadir}/pkgconfig + %{datadir}/vala end def configfiles -- 2.39.5