Unit Test
[platform/upstream/libxml2.git] / packaging / libxml2.spec
1
2 %if "%{run_tests}" == "1"
3         %define check %%check
4 %endif
5
6
7 Name:           libxml2
8 Version:        2.9.4
9 Release:        0
10 Summary:        A Library to Manipulate XML Files
11 License:        MIT
12 Group:          System/Libraries
13 Url:            http://xmlsoft.org
14 # Source ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz changes every day
15 Source:         ftp://xmlsoft.org/libxml2/%{name}-%{version}.tar.gz
16 Source2:        baselibs.conf
17 Source1001:     libxml2.manifest
18 BuildRequires:  pkg-config
19 BuildRequires:  readline-devel
20 BuildRequires:  xz-devel
21 BuildRequires:  zlib-devel
22
23 %description
24 The XML C library was initially developed for the GNOME project. It is
25 now used by many programs to load and save extensible data structures
26 or manipulate any kind of XML files.
27
28 This library implements a number of existing standards related to
29 markup languages, including the XML standard, name spaces in XML, XML
30 Base, RFC 2396, XPath, XPointer, HTML4, XInclude, SGML catalogs, and
31 XML catalogs. In most cases, libxml tries to implement the
32 specification in a rather strict way. To some extent, it provides
33 support for the following specifications, but does not claim to
34 implement them: DOM, FTP client, HTTP client, and SAX.
35
36 The library also supports RelaxNG. Support for W3C XML Schemas is in
37 progress.
38
39
40 %package tools
41 Summary:        Tools using libxml
42 Group:          System/Libraries
43
44 %description tools
45 This package contains xmllint, a very useful tool proving libxml's power.
46
47 %package devel
48 Summary:        Include Files and Libraries mandatory for Development
49 Group:          Development/Libraries
50 Requires:       %{name} = %{version}
51 Requires:       %{name}-tools = %{version}
52 Requires:       glibc-devel
53 Requires:       readline-devel
54 Requires:       xz-devel
55 Requires:       zlib-devel
56
57 %description devel
58 This package contains all necessary include files and libraries needed
59 to develop applications that require these.
60
61 %prep
62 %setup -q
63 cp %{SOURCE1001} .
64
65 %build
66 %configure --disable-static \
67     --docdir=%_docdir/%name \
68     --with-html-dir=%_docdir/%name/html \
69     --with-fexceptions \
70     --with-history \
71     --without-python \
72     --enable-ipv6 \
73     --with-sax1 \
74     --with-regexps \
75     --with-threads \
76     --with-reader \
77     --with-http
78
79 make %{?_smp_mflags} BASE_DIR="%_docdir" DOC_MODULE="%name"
80
81 %check
82 rm -f /tmp/%{name}_test
83 %__make runtests | tee -i /tmp/%{name}_log
84 cat /tmp/%{name}_log | grep "^TEST: " > /tmp/%{name}_test
85 chmod +x ./run_test.sh
86 ./run_test.sh %{name} %{version}
87 rm -f /tmp/%{name}_log
88
89
90 %install
91 make install DESTDIR="%buildroot" BASE_DIR="%_docdir" DOC_MODULE="%name"
92 ln -s libxml2/libxml %{buildroot}%{_includedir}/libxml
93
94 %remove_docs
95
96 %post -p /sbin/ldconfig
97
98 %postun -p /sbin/ldconfig
99
100 %files
101 %manifest %{name}.manifest
102 %defattr(-, root, root)
103 %license Copyright
104 %{_libdir}/lib*.so.*
105
106 %files tools
107 %manifest %{name}.manifest
108 %defattr(-, root, root)
109 %license Copyright
110 %{_bindir}/xmllint
111 %{_bindir}/xmlcatalog
112
113 %files devel
114 %manifest %{name}.manifest
115 %defattr(-, root, root)
116 %license Copyright
117 %{_bindir}/xml2-config
118 %dir %{_datadir}/aclocal
119 %{_datadir}/aclocal/libxml.m4
120 %{_includedir}/libxml
121 %{_includedir}/libxml2
122 %{_libdir}/lib*.so
123 # libxml2.la is needed for the python-libxml2 build. Deleting it breaks build of python-libxml2.
124 %{_libdir}/libxml2.la
125 %{_libdir}/*.sh
126 %{_libdir}/pkgconfig/*.pc
127 %{_libdir}/cmake/libxml2/libxml2-config.cmake
128
129 %changelog