File mingw32-openjpeg.spec of Package mingw32-openjpeg

%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
%define __os_install_post %{_mingw32_debug_install_post} \
                          %{_mingw32_install_post}

Name:           mingw32-openjpeg
Version:        1.5.0
Release:        0
Summary:        An open-source JPEG 2000 codec

License:        BSD-2-Clause
Group:          Development/Libraries
Url:            http://www.openjpeg.org
Source:         http://openjpeg.googlecode.com/files/openjpeg-%{version}.tar.gz
Patch1:         openjpeg-1.5.0-CANONICAL.patch
Patch2:         0002-Install-jpwl-man-pages-only-if-jpwl-is-enabled.patch
Patch3:         0003-Improve-check-for-standard-libs.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildArch:      noarch
#!BuildIgnore: post-build-checks

BuildRequires:  mingw32-filesystem
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-binutils
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-liblcms2-devel
BuildRequires:  mingw32-libtiff-devel
BuildRequires:  mingw32-libpng-devel
BuildRequires:  mingw32-zlib-devel

# For patch openjpeg-1.5.0-CANONICAL.patch
# For patch 0002-Install-jpwl-man-pages-only-if-jpwl-is-enabled.patch
# For patch 0003-Improve-check-for-standard-libs.patch
BuildRequires:  autoconf automake libtool

%description
OpenJPEG library is an open-source JPEG 2000 codec written in C. It has been
developed in order to promote the use of JPEG 2000, the new still-image
compression standard from the Joint Photographic Experts Group (JPEG).


%package -n mingw32-libopenjpeg-devel
Summary:        Development files for the OpenJPEG library
Group:          Development/Libraries

%description -n mingw32-libopenjpeg-devel
This package contains header files and libraries needed for developing programs
using the OpenJPEG library.


%package -n mingw32-libopenjpeg1
Summary:        An open-source JPEG 2000 codec
Group:          Development/Libraries

%description -n mingw32-libopenjpeg1
OpenJPEG library is an open-source JPEG 2000 codec written in C. It has been
developed in order to promote the use of JPEG 2000, the new still-image
compression standard from the Joint Photographic Experts Group (JPEG).


%{_mingw32_debug_package}


%prep
%setup -q -n openjpeg-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
# For patch openjpeg-1.5.0-CANONICAL.patch
# For patch 0002-Install-jpwl-man-pages-only-if-jpwl-is-enabled.patch
# For patch 0003-Improve-check-for-standard-libs.patch
autoreconf

echo "lt_cv_deplibs_check_method='pass_all'" >>%{_mingw32_cache}

# Only build shared libraries.
configure_args="--enable-shared --disable-static"

# Configure
%{_mingw32_configure} ${configure_args}

# Make
%{_mingw32_make} %{?_smp_mflags} || %{_mingw32_make}


%install
make DESTDIR=$RPM_BUILD_ROOT install


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_mingw32_docdir}/openjpeg-1.5/CHANGES
%{_mingw32_docdir}/openjpeg-1.5/LICENSE
%{_mingw32_bindir}/image_to_j2k.exe
%{_mingw32_bindir}/j2k_dump.exe
%{_mingw32_bindir}/j2k_to_image.exe
%{_mingw32_mandir}/man1/image_to_j2k.1.*
%{_mingw32_mandir}/man1/j2k_dump.1.*
%{_mingw32_mandir}/man1/j2k_to_image.1.*

%files -n mingw32-libopenjpeg-devel
%defattr(-,root,root)
%{_mingw32_includedir}/openjpeg-1.5/openjpeg.h
%{_mingw32_includedir}/openjpeg.h
%{_mingw32_libdir}/pkgconfig/libopenjpeg.pc
%{_mingw32_libdir}/pkgconfig/libopenjpeg1.pc
%{_mingw32_libdir}/libopenjpeg.dll.a
%{_mingw32_mandir}/man3/libopenjpeg.3.*

%files -n mingw32-libopenjpeg1
%defattr(-,root,root)
%{_mingw32_bindir}/libopenjpeg-1.dll

%changelog

openSUSE Build Service is sponsored by