File expat.spec of Package failed_expat

Name:           expat
Version:        2.0.1
Release:        1.1
Summary:        XML parsing library
License:        MIT
Group:          System/Libraries
URL:            https://libexpat.github.io/
Source0:        expat-2.0.1.tar.bz2

BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildArch:      %_target

%description
Expat is an XML parsing library written in C.

%package -n libexpat1
Summary:        Shared library for Expat
Group:          System/Libraries
Requires:       %{name} = %{version}-%{release}

%description -n libexpat1
Shared library package for Expat.

%package devel -n libexpat-devel
Summary:        Development files for Expat
Group:          Development/Libraries
Requires:       libexpat1 = %{version}-%{release}

%description -n libexpat-devel
Development files (headers, symlinks) for building against Expat.

%prep
%setup -q -n expat-2.0.1

%build
# Use the standard configure wrapper; explicitly disable building static libraries
# to avoid creating lto-only static archives and related rpmlint errors.
%configure --disable-static --libdir=/lib64 --prefix=/usr
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install

# Ensure conventional locations for shared library symlinks
# (upstream build may place real .so under /lib64 and symlinks under /usr/lib64)
if [ -d %{buildroot}/lib64 ]; then
  mkdir -p %{buildroot}/usr/lib64 || true
  for f in %{buildroot}/lib64/libexpat.so.*; do
    [ -e "$f" ] || continue
    ln -sf ../../lib64/$(basename "$f") %{buildroot}/usr/lib64/$(basename "$f")
  done
fi

%files
%defattr(-,root,root,-)
/usr/bin/xmlwf
%doc COPYING Changes README expatfaq.html
/usr/share/doc/packages/expat
/lib64/libexpat.so.*

%files -n libexpat-devel
%defattr(-,root,root,-)
/usr/include/expat.h
/usr/include/expat_external.h
/usr/lib64/libexpat.so

%changelog
* Thu Aug 14 2025 Packager <packager@example.com> - 2.0.1-1.1
- Disable static library to avoid LTO-only archive issues
- Remove obsolete %clean usage and make file lists explicit to satisfy rpmlint
openSUSE Build Service is sponsored by