Add mingw subpackages

This commit is contained in:
Sandro Mani 2022-02-24 11:02:38 +01:00
parent ee08bb57c6
commit e48f7f00c1

View File

@ -8,7 +8,7 @@
Name: openjpeg2
Version: 2.4.0
Release: 5%{?dist}
Release: 6%{?dist}
Summary: C-Library for JPEG 2000
# windirent.h is MIT, the rest is BSD
@ -46,6 +46,21 @@ BuildRequires: java-devel
BuildRequires: xerces-j2
%endif
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-zlib
BuildRequires: mingw32-libpng
BuildRequires: mingw32-libtiff
BuildRequires: mingw32-lcms2
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-zlib
BuildRequires: mingw64-libpng
BuildRequires: mingw64-libtiff
BuildRequires: mingw64-lcms2
%description
The OpenJPEG library is an open-source JPEG 2000 library developed in order to
promote the use of JPEG 2000.
@ -208,6 +223,39 @@ OpenJPEG2 JP3D module command line tools
%endif
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
%description -n mingw32-%{name}
%{summary}.
%package -n mingw32-%{name}-tools
Summary: Tools for the MinGW Windows %{name} library
Requires: mingw32-%{name} = %{version}-%{release}
%description -n mingw32-%{name}-tools
%{summary}.
%package -n mingw64-%{name}
Summary: MinGW Windows %{name} library
%description -n mingw64-%{name}
%{summary}.
%package -n mingw64-%{name}-tools
Summary: Tools for the MinGW Windows %{name} library
Requires: mingw64-%{name} = %{version}-%{release}
%description -n mingw64-%{name}-tools
%{summary}.
%{?mingw_debug_package}
%prep
%autosetup -p1 -n openjpeg-%{version} %{?runcheck:-a 1}
@ -216,6 +264,7 @@ find thirdparty/ -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;
%build
# Native build
# TODO: Consider
# -DBUILD_JPIP_SERVER=ON -DBUILD_JAVA=ON
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENJPEG_INSTALL_LIB_DIR=%{_lib} \
@ -224,11 +273,15 @@ find thirdparty/ -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;
-DBUILD_STATIC_LIBS=OFF \
-DBUILD_SHARED_LIBS=ON \
%{?runcheck:-DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT=$PWD/../data}
%cmake_build
# MinGW build
%mingw_cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PKGCONFIG_FILES=ON .
%mingw_make_build
%install
# Native build
%cmake_install
mv %{buildroot}%{_mandir}/man1/opj_compress.1 %{buildroot}%{_mandir}/man1/opj2_compress.1
@ -248,8 +301,17 @@ EOF
chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer
%endif
# MinGW build
%mingw_make_install
%ldconfig_scriptlets
# Delete files to exclude from package
rm -rf %{buildroot}%{mingw32_mandir}
rm -rf %{buildroot}%{mingw64_mandir}
rm -rf %{buildroot}%{mingw32_datadir}/doc
rm -rf %{buildroot}%{mingw64_datadir}/doc
%mingw_debug_install_post
%check
@ -259,7 +321,6 @@ chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer
%files
%{!?_licensedir:%global license %doc}
%license LICENSE
%doc AUTHORS.md NEWS.md README.md THANKS.md
%{_libdir}/libopenjp2.so.*
@ -329,8 +390,37 @@ chmod +x %{buildroot}%{_bindir}/opj2_jpip_viewer
%{_bindir}/opj2_jp3d*
%endif
%files -n mingw32-%{name}
%license LICENSE
%{mingw32_bindir}/libopenjp2.dll
%{mingw32_libdir}/libopenjp2.dll.a
%{mingw32_includedir}/openjpeg-2.4/
%{mingw32_libdir}/openjpeg-2.4/
%{mingw32_libdir}/pkgconfig/libopenjp2.pc
%files -n mingw32-%{name}-tools
%{mingw32_bindir}/opj2_compress.exe
%{mingw32_bindir}/opj2_decompress.exe
%{mingw32_bindir}/opj2_dump.exe
%files -n mingw64-%{name}
%license LICENSE
%{mingw64_bindir}/libopenjp2.dll
%{mingw64_libdir}/libopenjp2.dll.a
%{mingw64_includedir}/openjpeg-2.4/
%{mingw64_libdir}/openjpeg-2.4/
%{mingw64_libdir}/pkgconfig/libopenjp2.pc
%files -n mingw64-%{name}-tools
%{mingw64_bindir}/opj2_compress.exe
%{mingw64_bindir}/opj2_decompress.exe
%{mingw64_bindir}/opj2_dump.exe
%changelog
* Sat Feb 19 2022 Sandro Mani <manisandro@gmail.com> - 2.4.0-6
- Add mingw subpackage
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild