tizen 2.3 release
[external/expat.git] / packaging / expat.spec
1 Name:           expat
2 Version:        2.0.1
3 Release:        8
4 Summary:        An XML parser library
5 Group:          System/Libraries
6 Source:         %{name}-%{version}.tar.gz
7 Patch0:         expat-2.0.1-CVE-2009-3720.diff
8 Patch1:         expat-2.0.1-confcxx.patch
9
10 License:        MIT
11 Url:            http://www.libexpat.org/
12 BuildRequires:  autoconf,
13 BuildRequires:  automake,
14 BuildRequires:  libtool
15
16 %description
17 This is expat, the C library for parsing XML, written by James Clark. Expat
18 is a stream oriented XML parser. This means that you register handlers with
19 the parser prior to starting the parse. These handlers are called when the
20 parser discovers the associated structures in the document being parsed. A
21 start tag is an example of the kind of structures for which you may
22 register handlers.
23
24 %package devel
25 Summary:        Libraries and header files to develop applications using expat
26 Group:          Development/Libraries
27 Requires:       expat = %{version}
28
29 %description devel
30 The expat-devel package contains the libraries, include files and documentation
31 to develop XML applications with expat.
32
33 %package doc
34 Summary:        Documentation for the expat package
35 Group:          Development/Documentation
36 Requires:       expat = %{version}
37
38 %description doc
39 Documentation for the expat package
40
41 %prep
42 %setup -q
43 %patch0 -p0 -b .CVE-2009-3720
44 %patch1 -p1 -b .confcxx
45 %build
46 rm -rf autom4te*.cache
47 cp `aclocal --print-ac-dir`/libtool.m4 conftools || exit 1
48 libtoolize --copy --force --automake && aclocal && autoheader && autoconf
49 export CFLAGS="%{optflags} -fPIC"
50 %configure --libdir=/%{_lib}
51 make %{?_smp_mflags}
52
53 %install
54
55 mkdir -p %{buildroot}/usr/share/license
56 cp COPYING %{buildroot}/usr/share/license/%{name}
57
58 rm -f examples/*.dsp
59 chmod 644 README COPYING Changes doc/* examples/*
60
61 %make_install
62
63 mkdir -p %{buildroot}%{_libdir}
64 mv %{buildroot}/%{_lib}/libexpat.so %{buildroot}%{_libdir}
65
66 lib=`echo %{buildroot}/%{_lib}/libexpat.so.*.*`
67 ln -sf ../../%{_lib}/`basename ${lib}` %{buildroot}%{_libdir}/libexpat.so
68
69 %check
70 make check
71
72 %clean
73 rm -rf %{buildroot}
74
75 %post -p /sbin/ldconfig
76 %postun -p /sbin/ldconfig
77
78 %files
79 %manifest expat.manifest
80 %defattr(-,root,root,-)
81 %doc COPYING
82 %{_bindir}/*
83 /%{_lib}/lib*.so.*
84 /usr/share/license/%{name}
85
86 %files devel
87 %defattr(-,root,root)
88 %{_libdir}/lib*.so
89 %{_includedir}/*.h
90
91 %files doc
92 %defattr(-,root,root,-)
93 %doc %{_mandir}/*/*
94 %doc README
95 %doc Changes doc examples