Пакет libatomic7: Specfile

%global _unpackaged_files_terminate_build 1

# I'm putting here the GCC version this lib is based on
# (and the corresponding lcc is claimed to be compatible with;
# as printed by gcc --version):
%global compat_gcc_branch 7
%global compat_gcc_version 7.3

%global lcc_branch 1.25
%global sover 1
%global llcs_ver 1.24.07

Name:     libatomic%compat_gcc_branch
Version:  %{lcc_branch}.08
Release:  alt1.E2K.2

Summary:  The GNU Atomic library
License:  GPLv3+ with GCC-exception-3.1
Group:    System/Libraries
Url:      http://www.mcst.ru/
Packager: Andrew Savchenko <bircoph@altlinux.org>

Source: %name-%version.tar

ExclusiveArch: %e2k

BuildRequires: lcc-libs-common-source = %llcs_ver

%package -n libatomic%sover
Summary:  The GNU Atomic library
Group:    System/Libraries
Conflicts: lcc-libs < 1.21.24-alt1.E2K.0

%package devel
Summary:  The GNU Atomic library
Group:    System/Libraries
Requires: libatomic%sover >= %EVR
Obsoletes: libatomic5-devel

%package devel-static
Group:   System/Libraries
Summary: The GNU Atomic static library
Requires: %name-devel >= %EVR
Conflicts: lcc-libs < 1.21.24-alt1.E2K.0
Obsoletes: libatomic1-devel-static < 1.23-alt2.E2K.0
Obsoletes: libatomic1.23-devel-static <= 1.23-alt2.E2K.0
Obsoletes: lcc1.21-libatomic-devel-static < 1.21.24-alt7
Obsoletes: libatomic5-devel-static

%global libatomic_desc the GNU Atomic library for\
e2k architecture, which is an lcc support runtime library for\
atomic operations not supported by hardware.

# Doesn't produce a binary rpm, only for the src.rpm:
%description
This package contains %libatomic_desc

%description -n libatomic%sover
This package contains %libatomic_desc

%description devel
This package contains devel files for %libatomic_desc

%description devel-static
This package contains static version of %libatomic_desc

%prep
%setup
tar xf /usr/src/lcc-libs-common-source/%llcs_ver/gcc-%{compat_gcc_branch}.tar --one-top-level=..

%build
mkdir .deps
# follow MCST build script
%add_optflags -fvisibility=protected
%add_optflags -Wno-error=pointer-qual -Wno-error=invalid-memory-model
%configure \
    --enable-shared \
    --disable-multilib \
    --with-target-subdir="."
# --with-target-subdir is required for config-ml.in to be found properly

%make_build

%install
%makeinstall_std
rm %buildroot%_libdir/libatomic.so
ln -s libatomic.so.%sover %buildroot%_libdir/libatomic.so

%files -n libatomic%sover
%_libdir/*.so.%{sover}*

%files devel
%_libdir/*.so

%files devel-static
%_libdir/*.a

%changelog
* Sat May 01 2021 Andrew Savchenko <bircoph@altlinux.org> 1.25.08-alt1.E2K.2
- Add Obsoletes for gcc compat branch 5.

* Tue Sep 08 2020 Andrew Savchenko <bircoph@altlinux.org> 1.25.08-alt1.E2K.1
- Update to MCST version 1.25.08.

* Mon Jul 27 2020 Andrew Savchenko <bircoph@altlinux.org> 1.25.06-alt1.E2K.1
- Update to MCST version 1.25.06.

* Thu Jun 25 2020 Andrew Savchenko <bircoph@altlinux.org> 1.24.07-alt1.E2K.3
- Provide devel package, as .so is removed from lcc package.

* Thu May 21 2020 Andrew Savchenko <bircoph@altlinux.org> 1.24.07-alt1.E2K.2
- Make common sources unpacking more future proof.

* Mon May 18 2020 Andrew Savchenko <bircoph@altlinux.org> 1.24.07-alt1.E2K.1
- Update to MCST version 1.24.07 (built from source).

* Fri Feb 08 2019 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt2.E2K.3
- Remove obsolete blobs macroses.

* Fri Feb 08 2019 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt2.E2K.3
- Remove obsolete blobs macroses.

* Fri Feb 08 2019 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt2.E2K.2
- Respect CFLAGS during so linking.

* Mon Jan 21 2019 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt2.E2K.1
- Respect CFLAGS.

* Sun Jan 20 2019 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt2.E2K.0
- Build from source.

* Mon Nov 12 2018 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt1.E2K.2
- Remove devel subpackage as files will be provided from lcc.

* Mon Nov 12 2018 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt1.E2K.1
- Install devel and static subpackages

* Fri Nov 09 2018 Andrey Savchenko <bircoph@altlinux.org> 1.23.12-alt1.E2K.0
- Initial 1.23.12 binary version.