Sophie

Sophie

distrib > Arklinux > devel > i586 > by-pkgid > 790432a8411dcc56e6372a8f0442902c > files > 6

openjpeg-1.4-1ark.src.rpm

Name:    openjpeg
Version: 1.4
Release: 1ark
Summary: JPEG 2000 command line tools

Group:   Applications/Multimedia
License: BSD
URL:     http://code.google.com/p/openjpeg/ 
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Source0: http://openjpeg.googlecode.com/files/openjpeg_v1_4_sources_r697.tgz 

BuildRequires: cmake 
BuildRequires: libtiff-devel

Requires: %{name}-libs%{?_isa} = %{version}-%{release}

## upstreamable patches
Patch: openjpeg-1.4-libpng-1.5.patch
# libopenjpeg has undefined references, http://bugzilla.redhat.com/467661
# http://groups.google.com/group/openjpeg/browse_thread/thread/fba9ad2a35b12e6a
Patch50: openjpeg-1.4-no_undefined.patch
# Use soversion 3 (instead of 1.4)
# http://groups.google.com/group/openjpeg/browse_thread/thread/b9a1d1bfb6f8d09a
Patch51: openjpeg-1.4-cmake_soversion_3.patch
# fix autoconf buildsys (+DESTDIR support mostly) 
# http://groups.google.com/group/openjpeg/browse_thread/thread/6326363ebb969a99
Patch52: openjpeg-1.4-autoconf.patch
# fix cmake to install pkgconfig file(s)
# http://groups.google.com/group/openjpeg/browse_thread/thread/545a90cf2b0e4af2
Patch53: openjpeg-1.4-cmake_pkgconfig.patch

%description
OpenJPEG 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 libs
Summary: JPEG 2000 codec runtime library
Group:   System Environment/Libraries
%description libs
The %{name}-libs package contains runtime libraries for applications that use
OpenJPEG.

%package  devel
Summary:  Development files for %{name} 
Group:    Development/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use OpenJPEG.


%prep
%setup -q -n openjpeg_v1_4_sources_r697

# Make sure we use system libraries
rm -rf libs

%patch -p1 -b .libpng15~

%patch50 -p1 -b .no_undefined~
%patch51 -p1 -b .cmake_soversion_3~
%patch53 -p1 -b .cmake_pkgconfig~

%build

mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake} \
  -DBUILD_EXAMPLES:BOOL=ON \
  -DBUILD_SHARED_LIBS:BOOL=ON \
  -DOPENJPEG_INSTALL_BIN_DIR:PATH=%{_bindir} \
  -DOPENJPEG_INSTALL_DATA_DIR:PATH=%{_datadir} \
  -DOPENJPEG_INSTALL_INCLUDE_DIR:PATH=%{_includedir} \
  -DOPENJPEG_INSTALL_LIB_DIR:PATH=%{_libdir} \
   ..
popd

make %{?_smp_mflags} -C %{_target_platform}

%install
rm -rf %{buildroot}

make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
ln -s openjpeg-1.4/openjpeg.h %{buildroot}%{_includedir}/openjpeg.h
ln -s libopenjpeg1.pc %{buildroot}%{_libdir}/pkgconfig/libopenjpeg.pc
ln -s openjpeg-1.4 %{buildroot}%{_includedir}/openjpeg

## unpackaged files
# we use %%doc in -libs below instead
rm -rfv %buildroot%{_docdir}/openjpeg-1.4/

%clean
rm -rf %{buildroot}

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/image_to_j2k
%{_bindir}/j2k_dump
%{_bindir}/j2k_to_image
%{_mandir}/man1/image_to_j2k.1*
%{_mandir}/man1/j2k_dump.1*
%{_mandir}/man1/j2k_to_image.1*

%files libs
%defattr(-,root,root,-)
%doc CHANGES LICENSE 
%{_libdir}/libopenjpeg.so*
%{_mandir}/man3/libopenjpeg.3*

%files devel
%defattr(-,root,root,-)
%{_includedir}/openjpeg-1.4/
%{_libdir}/pkgconfig/libopenjpeg.pc
%{_libdir}/pkgconfig/libopenjpeg1.pc
%{_libdir}/openjpeg-1.4/
# legacy/compat header locations
%{_includedir}/openjpeg.h
%{_includedir}/openjpeg/


%changelog
* Sun Jan 16 2011 Bernhard Rosenkraenzer <bero@arklinux.org> 1.4-1ark
- 1.4
- Build with libpng 1.5

* Tue Jan 12 2010 Bernhard Rosenkraenzer <bero@arklinux.org> 1.3-2ark
- Rebuild for libtiff 4

* Sun Sep 28 2008 Bernhard Rosenkraenzer <bero@arklinux.org> 1.3-1ark
- Initial packaging.