Пакет expat: Specfile

Name: expat
Version: 2.0.1
Release: alt0.1.M41.1

%def_enable static
%define pkgdocdir %_docdir/%name-%version

Summary: An XML parser written in C
License: MIT/X Consortium
Group: System/Base

URL: http://expat.sourceforge.net
Source: %name-%version-%release.tar
Patch1: expat-1.95.8-CVE-2009-3560-revised.patch
Patch2: expat-1.95.8-CVE-2009-3720.patch

Requires: lib%name = %version-%release

%package -n lib%name
Summary: XML parser library
Group: System/Libraries
%if "%_lib" == "lib64"
Provides: libexpat.so.0()(64bit)
%else
Provides: libexpat.so.0
%endif

%package -n lib%name-devel
Summary: Development files for Expat, an XML parser library for C
Group: Development/C
Requires: lib%name = %version-%release
Provides: expat-devel = %version
Obsoletes: expat-devel

%package -n lib%name-devel-static
Summary: Static library for developing static applications which will manipulate XML files
Group: Development/C
Requires: lib%name-devel = %version-%release

%description
Expat is a stream-oriented XML parser written in C.

%description -n lib%name
Expat is a stream-oriented XML parser written in C.
This package provides the Expat parser as a shared library.

%description -n lib%name-devel
Expat is a stream-oriented XML parser written in C.
This package is needed if you want to build programs which use Expat
library.

%description -n lib%name-devel-static
Expat is a stream-oriented XML parser written in C.
This package provides the Expat parser as a library for static linking.

%prep
%setup -q -n %name-%version-%release
%patch1 -p1
%patch2 -p1

%build
autoreconf -i
%configure %{subst_enable static}

# SMP-incompatible build.
make

%install
%make_install DESTDIR=%buildroot install

# Provide symlink for backward compatibility
ln -s libexpat.so.1 %buildroot%_libdir/libexpat.so.0

install -d -m755 %buildroot%pkgdocdir
install -p -m644 README COPYING Changes %buildroot%pkgdocdir/
install -p -m644 doc/*.{html,css,png} %buildroot%pkgdocdir/
install -d -m755 %buildroot%pkgdocdir/examples
install -p -m644 examples/*.c %buildroot%pkgdocdir/examples/

%post -n lib%name -p %post_ldconfig
%postun -n lib%name -p %postun_ldconfig

%triggerpostun -n lib%name -- libexpat < 2.0.0-alt1
/bin/ln -snf libexpat.so.1 %_libdir/libexpat.so.0
/sbin/ldconfig

%files
%_bindir/*
%_man1dir/*

%files -n lib%name
%_libdir/*.so.*
%dir %pkgdocdir
%pkgdocdir/Changes
%pkgdocdir/COPYING
%pkgdocdir/README

%files -n lib%name-devel
%_libdir/*.so
%_includedir/*
%dir %pkgdocdir
%pkgdocdir/*.html
%pkgdocdir/*.css
%pkgdocdir/*.png
%pkgdocdir/examples

%if_enabled static
%files -n lib%name-devel-static
%_libdir/*.a
%endif	# enabled static

%changelog
* Thu Dec 01 2011 Andriy Stepanov <stanv@altlinux.ru> 2.0.1-alt0.1.M41.1
- CVE-2009-3560
  CVE-2009-3720

* Sun Apr 08 2007 Alexey Tourbin <at@altlinux.ru> 2.0.1-alt0.1
- updated to 20061213 cvs snapshot

* Thu Jan 19 2006 Dmitry V. Levin <ldv@altlinux.org> 2.0.0-alt3.1
- Fixed recently added Provides for x86_64.

* Tue Jan 17 2006 Mikhail Zabaluev <mhz@altlinux.ru> 2.0.0-alt3
- Added triggerpostun to correct libexpat.so.0 symlink after an upgrade
  from a pre-2.0 version

* Tue Jan 17 2006 Mikhail Zabaluev <mhz@altlinux.ru> 2.0.0-alt2
- Provide libexpat.so.0 as a symlink for backward compatibility

* Thu Jan 12 2006 Mikhail Zabaluev <mhz@altlinux.ru> 2.0.0-alt1
- 2.0.0
- Consolidated documentation in one directory
- Improved summaries and descriptions
- Buildreq

* Fri Feb 11 2005 Mikhail Zabaluev <mhz@altlinux.ru> 1.95.8-alt2
- Formal rebuild to bring static library to Sisyphus [bug #6087]

* Mon Jul 26 2004 Mikhail Zabaluev <mhz@altlinux.ru> 1.95.8-alt1
- New upstream release
- Excluded *.la files

* Thu Oct 23 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1.95.7-alt1
- New upstream release
- Patch0 is now obsolete

* Tue Apr 01 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1.95.6-alt2
- Relocate an enum declaration for better buildability (Vitaly Lipatov)
  [Patch0]

* Thu Feb 20 2003 Mikhail Zabaluev <mhz@altlinux.ru> 1.95.6-alt1
- 1.95.6

* Mon Sep 23 2002 Mikhail Zabaluev <mhz@altlinux.ru> 1.95.5-alt1
- 1.95.5

* Tue Sep 03 2002 AEN <aen@altlinux.ru> 1.95.4-alt1
- new version

* Mon Sep 02 2002 AEN <aen@logic.ru> 1.95.2-alt3
- rebuilt with gcc-3.2.1

* Fri Mar 15 2002 Dmitry V. Levin <ldv@alt-linux.org> 1.95.2-alt2
- Fixed build.

* Tue Jul 31 2001 Dmitry V. Levin <ldv@altlinux.ru> 1.95.2-alt1
- 1.95.2
- Libification.

* Wed Dec 27 2000 Dmitry V. Levin <ldv@fandra.org> 1.95.1-ipl1
- 1.95.1
- Included new summaries and descriptions
  (from Alexander Bokovoy <ab@avilink.net>).

* Sat Dec 09 2000 Dmitry V. Levin <ldv@fandra.org> 1.1-ipl2
- RE adaptions.
- FHSification.
- Moved library and headers to devel subpackage.

* Mon Jan 10 2000 Dmitry V. Levin <ldv@fandra.org>
- Fandra adaptions.

* Tue Jul 28 1999 Greg LaPolla <glapolla@earthlink.net>
- Made spec file
- Built on redhat 6.0