Make sombok-devel package multilib safe

This commit is contained in:
Petr Písař 2020-07-03 11:03:40 +02:00
parent de3d72877d
commit e051f13e4c
2 changed files with 53 additions and 1 deletions

42
sombok.h Normal file
View File

@ -0,0 +1,42 @@
#if defined(__i386__)
#include "sombok-i386.h"
#elif defined(__ia64__)
#include "sombok-ia64.h"
#elif defined(__powerpc64__)
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#include "sombok-ppc64.h"
#else
#include "sombok-ppc64le.h"
#endif
#elif defined(__powerpc__)
#include "sombok-ppc.h"
#elif defined(__s390x__)
#include "sombok-s390x.h"
#elif defined(__s390__)
#include "sombok-s390.h"
#elif defined(__x86_64__)
#include "sombok-x86_64.h"
#elif defined(__arm__)
#include "sombok-arm.h"
#elif defined(__alpha__)
#include "sombok-alpha.h"
#elif defined(__sparc__) && defined (__arch64__)
#include "sombok-sparc64.h"
#elif defined(__sparc__)
#include "sombok-sparc.h"
#elif defined(__aarch64__)
#include "sombok-aarch64.h"
#elif defined(__mips64) && defined(__MIPSEL__)
#include "sombok-mips64el.h"
#elif defined(__mips64)
#include "sombok-mips64.h"
#elif defined(__mips) && defined(__MIPSEL__)
#include "sombok-mipsel.h"
#elif defined(__mips)
#include "sombok-mips.h"
#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
#include "sombok-riscv64.h"
#else
#error "This sombok-devel package does not support your architecture."
#endif

View File

@ -1,10 +1,12 @@
Name: sombok Name: sombok
Version: 2.4.0 Version: 2.4.0
Release: 11%{?dist} Release: 12%{?dist}
Summary: Unicode Text Segmentation Package Summary: Unicode Text Segmentation Package
License: GPLv2+ or Artistic clarified License: GPLv2+ or Artistic clarified
URL: http://sf.net/projects/linefold/ URL: http://sf.net/projects/linefold/
Source0: https://github.com/hatukanezumi/sombok/archive/%{name}-%{version}.tar.gz Source0: https://github.com/hatukanezumi/sombok/archive/%{name}-%{version}.tar.gz
# A multilib-safe wrapper, bug #1853260
Source1: sombok.h
BuildRequires: libthai-devel BuildRequires: libthai-devel
BuildRequires: autoconf BuildRequires: autoconf
@ -44,6 +46,11 @@ make %{?_smp_mflags}
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# Rename sombok.h to sombok-ARCH.h and install a sombok.h wrapper to avoid
# a file conflict on multilib systems, bug #1853260
mv %{buildroot}/%{_includedir}/sombok.h %{buildroot}/%{_includedir}/sombok-%{_arch}.h
install -m 0644 %{SOURCE1} %{buildroot}/%{_includedir}/sombok.h
%ldconfig_scriptlets %ldconfig_scriptlets
@ -61,6 +68,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%changelog %changelog
* Fri Jul 03 2020 Petr Pisar <ppisar@redhat.com> - 2.4.0-12
- Make sombok-devel package multilib safe (bug #1853260)
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-11 * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild