%?mingw_package_header %global versionmajor 6 %global versionminor 0 %global versionsuffix 0 %global mingw_pkg_name CxImage %global mingw_build_win32 1 %global mingw_build_win64 1 Name: mingw-CxImage Version: %{versionmajor}%{versionminor}%{versionsuffix} Release: 2%{?dist} Summary: MinGW image manipulation library Group: Development/Libraries License: zlib URL: http://sourceforge.net/projects/cximage Source0: http://sourceforge.net/projects/cximage/files/%{versionmajor}.%{versionminor}%{versionsuffix}/cximage%{version}_full.7z Source1: cximage.pc Patch0: cximage-6.0.0-disable-some-formats.patch Patch1: cximage-6.0.0-std_min_max.patch Patch2: cximage-6.0.0-fix-include-name.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: mingw32-filesystem >= 52 BuildRequires: mingw32-gcc BuildRequires: mingw32-jasper BuildRequires: mingw32-libjpeg-turbo BuildRequires: mingw32-libpng BuildRequires: mingw32-libtiff BuildRequires: mingw32-zlib BuildRequires: p7zip Requires: pkgconfig %description CxImage is a C++ image processing library. It can load, save, display, transform images in a very simple and fast way, with transparency, multiple layers and selections, support for BMP GIF JPG PNG MNG TIF ICO TGA PCX J2K JBG RAS PNM RAW PSD. # Mingw32 %package -n mingw32-%{mingw_pkg_name} Summary: %{summary} %description -n mingw32-%{mingw_pkg_name} Cross compiled CxImage library. #%package -n mingw32-%{mingw_pkg_name}-static #Summary: Static version of the cross compiled lcms library #Requires: mingw32-%{mingw_pkg_name} = %{version}-%{release} #%description -n mingw32-%{mingw_pkg_name}-static #Static version of the cross compiled Pixman library. # Mingw64 %package -n mingw64-%{mingw_pkg_name} Summary: %{summary} %description -n mingw64-%{mingw_pkg_name} MinGW Windows CxImage library. #%package -n mingw64-%{mingw_pkg_name}-static #Summary: Static version of the cross compiled lcms library #Requires: mingw64-%{mingw_pkg_name} = %{version}-%{release} #%description -n mingw64-%{mingw_pkg_name}-static #Static version of the cross compiled lcms library. %prep mkdir %{name}-%{version} cd %{name}-%{version} 7za x %{SOURCE0} %patch0 -p1 %patch1 -p1 %patch2 -p1 %build %global cximage_cppflags -D_USRDLL -D_USRCxImageCrtDll -DCxImageCrtDll_EXPORTS %global cximage32_pkg_flags $(%{mingw32_pkg_config} --cflags --libs libpng15 zlib) %global cximage64_pkg_flags $(%{mingw64_pkg_config} --cflags --libs libpng15 zlib) %global cximage32_ldflags -lgdi32 -lws2_32 -ljpeg -ltiff -ljasper %global cximage64_ldflags -lgdi32 -lws2_32 -ljpeg -ltiff -ljasper cd %{name}-%{version} %if %{mingw_build_win32} mkdir build_win32 cd build_win32 %{mingw32_cxx} %{mingw32_cflags} %{cximage_cppflags} -shared -o cximage.dll ../CxImage/*.cpp ../CxImage/CxImageDLL/CxImageCrtDll.cpp %{cximage32_ldflags} %{cximage32_pkg_flags} cd .. %endif %if %{mingw_build_win64} mkdir build_win64 cd build_win64 %{mingw64_cxx} %{mingw64_cflags} %{cximage_cppflags} -shared -o cximage.dll ../CxImage/*.cpp ../CxImage/CxImageDLL/CxImageCrtDll.cpp %{cximage64_ldflags} %{cximage64_pkg_flags} cd .. %endif %install cd %{name}-%{version} %if %{mingw_build_win32} install -d $RPM_BUILD_ROOT/%{mingw32_bindir} install -d $RPM_BUILD_ROOT/%{mingw32_libdir}/pkgconfig install -m0644 %{SOURCE1} $RPM_BUILD_ROOT/%{mingw32_libdir}/pkgconfig sed -i s!@PREFIX@!%{mingw32_prefix}!g $RPM_BUILD_ROOT/%{mingw32_libdir}/pkgconfig/cximage.pc install -m0644 build_win32/cximage.dll $RPM_BUILD_ROOT/%{mingw32_libdir}/cximage.dll.a install -d $RPM_BUILD_ROOT/%{mingw32_includedir}/CxImage/ install -m0644 CxImage/*.h $RPM_BUILD_ROOT/%{mingw32_includedir}/CxImage/ %endif %if %{mingw_build_win64} install -d $RPM_BUILD_ROOT/%{mingw64_bindir} install -d $RPM_BUILD_ROOT/%{mingw64_libdir}/pkgconfig install -m0644 %{SOURCE1} $RPM_BUILD_ROOT/%{mingw64_libdir}/pkgconfig sed -i s!@PREFIX@!%{mingw64_prefix}!g $RPM_BUILD_ROOT/%{mingw64_libdir}/pkgconfig/cximage.pc install -m0644 build_win64/cximage.dll $RPM_BUILD_ROOT/%{mingw64_libdir}/cximage.dll.a install -d $RPM_BUILD_ROOT/%{mingw64_includedir}/CxImage/ install -m0644 CxImage/*.h $RPM_BUILD_ROOT/%{mingw64_includedir}/CxImage/ %endif %files -n mingw32-%{mingw_pkg_name} %defattr(-,root,root,-) %{mingw32_libdir}/pkgconfig/cximage.pc %{mingw32_libdir}/cximage.dll.a %{mingw32_includedir}/CxImage/ %files -n mingw64-%{mingw_pkg_name} %defattr(-,root,root,-) %{mingw64_libdir}/pkgconfig/cximage.pc %{mingw64_libdir}/cximage.dll.a %{mingw64_includedir}/CxImage/ %changelog * Thu Feb 23 2012 Christophe Fergeau - 6.0.0-2 - Added 64 bit support * Wed Feb 22 2012 Christophe Fergeau - 6.0.0-1 - Initial mingw build of CxImage