%global debug_package %{nil}

%global forgeurl https://github.com/ladislav-zezula/StormLib

Version:        9.25

%forgemeta

Name:           StormLib
Release:        1%{?dist}
License:        MIT
Summary:        An open-source project to work with Blizzard MPQ archives.
URL:	        %{forgeurl}
Source:         %{forgesource}
BuildRequires:	cmake
BuildRequires:	gcc-c++
BuildRequires:	pkgconfig(bzip2)
BuildRequires:	pkgconfig(libtomcrypt)
BuildRequires:	pkgconfig(zlib)

%description
An open-source project to work with Blizzard MPQ archives.

%package devel
Summary: SDL_audiolib - development environment
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig

%description devel
This package provides the StormLib headers and development environment.

%prep
%forgesetup

%build
%cmake -DWITH_LIBTOMCRYPT=ON
%cmake_build

%install
# No way to set target lib folder, just copy library
install -D src/StormLib.h %{buildroot}%{_includedir}/StormLib.h
install -D src/StormPort.h %{buildroot}%{_includedir}/StormPort.h

install -D %{_vpath_builddir}/libstorm.so %{buildroot}%{_libdir}/libstorm.so
install -D %{_vpath_builddir}/libstorm.so.9 %{buildroot}%{_libdir}/libstorm.so.9
install -D %{_vpath_builddir}/libstorm.so.9.22.0 %{buildroot}%{_libdir}/libstorm.so.9.22.0

%files
%license LICENSE
%doc README.md
%{_libdir}/libstorm.so.9
%{_libdir}/libstorm.so.9.22.0

%files devel
%{_includedir}/StormLib.h
%{_includedir}/StormPort.h
%{_libdir}/libstorm.so

%changelog
* Fri Sep 15 2023 Brandon Nielsen <nielsenb@jetfuse.net> 9.25-1
- Update to 9.25

* Sat Jan 22 2022 Brandon Nielsen <nielsenb@jetfuse.net> 9.23-4
- Backport fixes for asserts on aarch64, s390x

* Sat Jan 22 2022 Brandon Nielsen <nielsenb@jetfuse.net> 9.23-3
- Use system libtomcrypt

* Sat Jan 15 2022 Brandon Nielsen <nielsenb@jetfuse.net> 9.23-2
- Remove useless ldconfig scriptlet
- Don't set permissions on installed files to fix autoprovides in F34

* Fri Jan 14 2022 Brandon Nielsen <nielsenb@jetfuse.net> 9.23-1
- Initial specfile