%global gituser libass
%global gitname libass
%global commit b2fe9d8770678a7b5271387d38c20657ebf3429a
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global gitcounter 7
%global extraopts -v --nocfprotection --nobranchprotection
Name: libass
Version: 0.17.5.git.%{gitcounter}
Release: %{shortcommit}%{?dist}
Summary: Portable library for SSA/ASS subtitles rendering
License: ISC
URL: https://github.com/%{gituser}/%{gitname}
Source0: %{url}/tarball/%{commit}/%{name}-%{shortcommit}.tar.gz
BuildRequires: gcc nasm autoconf automake libtool
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(fribidi)
BuildRequires: pkgconfig(harfbuzz)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libunibreak)
BuildRequires: devscripts
%description
Libass is a portable library for SSA/ASS subtitles rendering.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%autosetup -p1 -n %{gituser}-%{gitname}-%{shortcommit}
%build
%set_build_flags
export CFLAGS=$(echo "$CFLAGS" | sed -e 's|-g |-g1 |' -e 's|-march=x86-64|-march=x86-64-v2 -fvect-cost-model=dynamic|')
export CXXFLAGS=$(echo "$CXXFLAGS" | sed -e 's|-g |-g1 |' -e 's|-march=x86-64|-march=x86-64-v2 -fvect-cost-model=dynamic|')
./autogen.sh
%configure --disable-static
%make_build
%install
%make_install
find %{buildroot} -name '*.la' -delete
%check
make check
hardening-check %{extraopts} %{buildroot}%{_libdir}/%{name}.so.9.*
%ldconfig_scriptlets
%files
%license COPYING
%doc Changelog
%{_libdir}/%{name}.so.9*
%files devel
%{_includedir}/ass/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%changelog
* Sat Aug 08 2026 samoht0 git-master
- testing x86-64-v2
* Sat Aug 20 2022 samoht0 git-master
- enable libunibreak support
* Sat Jan 16 2021 samoht0 git-master
- spec and history cleanup