%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Name: libmng
Summary: A library of functions for manipulating MNG format files.
Version: 2.0.3
Release: 1%{?_dist_release}

Group: System Environment/Libraries
License: AS IS
URL: http://sourceforge.net/projects/libmng/

Source: http://prdownloads.sourceforge.net/libmng/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: lcms2-devel
BuildRequires: libjpeg-devel
BuildRequires: libtool
BuildRequires: zlib-devel

Vendor: Project Vine
Distribution: Vine Linux

%description
libmng - library for reading, writing, displaying and examing
Multiple-Image Network Graphics. MNG is the animation extension to the
popular PNG image-format.

%package devel
Summary: Development tools for programs to manipulate MNG format files.
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: lcms2-devel
Requires: libjpeg-devel
Requires: zlib-devel
Requires: pkgconfig

%description devel
The libmng-devel package contains the header files
necessary for developing programs using the MNG
(Multiple-Image Network Graphics) library.

%package static
Summary: Static libraries of %{name}
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}

%description static
The libmng-static package contains static libraries.

# compat32
%package -n compat32-%{name}
Summary: A library of functions for manipulating MNG format files.
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
libmng - library for reading, writing, displaying and examing
Multiple-Image Network Graphics. MNG is the animation extension to the
popular PNG image-format.

%package -n compat32-%{name}-devel
Summary: Development tools for programs to manipulate MNG format files.
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: compat32-%{name} = %{version}-%{release}
Requires: compat32-lcms2-devel
Requires: compat32-libjpeg-devel
Requires: compat32-zlib-devel

%description -n compat32-%{name}-devel
The libmng-devel package contains the header files
necessary for developing programs using the MNG
(Multiple-Image Network Graphics) library.


%prep
%setup -q

%build
#cp -p makefiles/configure.in .
#cp -p makefiles/Makefile.am .

#libtoolize -f -c 
#aclocal
#automake -a -c
#autoconf

%configure --enable-shared --with-zlib --with-jpeg \
	--with-gnu-ld --with-lcms
make

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall

rm $RPM_BUILD_ROOT%{_libdir}/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc CHANGES LICENSE README doc
%{_libdir}/*.so.*
%{_mandir}/man*/*

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc

%files static
%defattr(-,root,root)
%{_libdir}/*.a

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/*.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/*.so
%endif

%changelog
* Tue Feb 27 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.3-1
- updated to 2.0.3.

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.0.2-1
- update to 2.0.2
- change BuildRequires; lcms2-devel instead of lcms-devel

* Sun Mar 27 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.10-4
- rebuilt with new toolchain
- s/BuildPrereq/BuildRequires/g

* Mon Jul 20 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.0.10-3
- added compat32 package for x86_64 arch support

* Fri Mar 27 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0.10-2
- add libmng-static which is needed by tuxonice-userui
  - remove --disable-static
  - remove Obsoletes: libmng-static

* Wed Mar 19 2008 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.10-1
- new upstream release
- delete *.la
- add --disable-static

* Sat May 13 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.9-0vl1
- updated to 1.0.9
- added BuildPrereq: automake, autoconf, libtool

* Sun May 15 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.7-0vl3
- add BuildPrereq: lcms-devel and Requires: lcms
- add Requires: zlib-devel libjpeg-devel lcms-devel to -devel pkg
- add --with-lcms to configure option

* Wed May 11 2005 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.0.7-0vl2
- rebuilt to fix unwanted dependencies with lcms (ppc only)

* Thu Apr 22 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.0.7-0vl1
- rebuild with new toolchains
- updated to 1.0.7

* Tue Oct 15 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.4-0vl2
- License: AS IS
- Obsoletes: libmng-static, and merge %%{prefix}/lib/*.a to -devel pkg
- add PreReq: ldconfig
- revised summaries and descriptions

* Tue Oct 15 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.4-0vl1
- source upgrade
- add %%doc Changes LICENSE README doc
- add Requires: %%{name} = %%{version}-%%{release} for devel package
- add Requires: %%{name}-devel = %%{version}-%%{release} for static package

* Sat Oct 13 2001 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.3-0vl1
- Update to 1.0.3
- Build for VineSeed

* Mon Jun 11 2001 net_hal <net_hal@cwa.bai.ne.jp>
- First build for Vine2.1.5

* Wed Apr 11 2001 Rex Dieter <rdieter@unl.edu> 1.0.0-0.6x.2
- redhat6 backport based on rawhide's libmng-1.0.0-2

* Wed Feb 28 2001 Trond Eivind Glomsrd <teg@redhat.com>
- remove bogus symlink trick

* Mon Feb 26 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Update to 1.0.0 to make Qt 2.3.0 happy

* Fri Jan 19 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- 0.9.4, fixes MNG 1.0 spec compliance

* Tue Dec 19 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 0.9.3
- Add ldconfig calls in %%post and %%postun

* Tue Dec 05 2000 Florian La Roche <Florian.LaRoche@redhat.de>
- added a clean section to the spec file

* Tue Sep 19 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- initial rpm