98774c3a19a30154a569c458c37c1de23ffec967
[fedora-mingw.git] / xqilla / mingw32-xqilla.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-xqilla
8 Version:        2.2.0
9 Release:        1%{?dist}
10 Summary:        XQilla is an XQuery and XPath 2.0 library, built on top of Xerces-C
11
12 License:        ASL 2.0
13 Group:          Development/Libraries
14
15 URL:            http://xqilla.sourceforge.net/HomePage
16 Source0:        http://downloads.sourceforge.net/xqilla/XQilla-%{version}.tar.gz
17 Source1:        http://www.apache.org/dist/xerces/c/2/sources/xerces-c-src_2_8_0.tar.gz
18
19 # Patch from Xerces-C.
20 Patch1000:      xerces-c-dllwrap.patch
21
22 # Use ifdef WIN32 instead of MSVC-specific tests.
23 Patch1001:      xqilla-xmark-test-win32.patch
24
25 # XQC (the C API) does not work.  The library part compiles OK but for
26 # reasons unknown the symbols never get added to the libxqilla.dll.a
27 # implib.  The patch disables those sample programs.
28 Patch1002:      xqilla-no-xqc-tests.patch
29
30 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
31 BuildArch:      noarch
32
33 BuildRequires:  mingw32-filesystem >= 35
34 BuildRequires:  mingw32-gcc
35 BuildRequires:  mingw32-gcc-c++
36 BuildRequires:  mingw32-binutils
37
38 BuildRequires:  mingw32-xerces-c >= 2.8.0
39 BuildRequires:  flex
40 BuildRequires:  autoconf, automake, libtool
41 BuildRequires:  doxygen, graphviz
42
43
44 %description
45 XQilla is an XQuery and XPath 2.0 implementation written in C++ and based
46 on Xerces-C. It implements the DOM 3 XPath API, as well as having it's own
47 more powerful API. It conforms to the W3C proposed recomendation of XQuery
48 and XPath 2.0.
49
50
51 %prep
52 %setup -q -a 1 -n XQilla-%{version}
53
54 pushd xerces-c-src_2_8_0
55 %patch1000 -p1
56 popd
57
58 %patch1001 -p1
59 %patch1002 -p1
60
61
62 %build
63 # XQilla requires a _built_ copy of Xerces-C.  Thus we have to build
64 # one first, copying much of the code from 'mingw32-xerces-c.spec'.
65 # Native Fedora package instead patches the configure script to look
66 # at the installed copy.
67 pushd xerces-c-src_2_8_0
68 export XERCESCROOT="$PWD"
69 cd $XERCESCROOT/src/xercesc
70 CXXFLAGS="%{_mingw32_cflags}" \
71 CFLAGS="%{_mingw32_cflags}" \
72 ./runConfigure \
73   -pmingw-msys \
74   -c%{_mingw32_cc} \
75   -x%{_mingw32_cxx} \
76   -minmem \
77   -nwinsock \
78   -tWin32 \
79   -b32 \
80   -P %{_mingw32_prefix} \
81   -C --libdir="%{_mingw32_libdir}" -C --host=%{_mingw32_host}
82 %{__make} DLLWRAP=%{_mingw32_dllwrap}
83 popd
84
85 rm -f aclocal.m4
86 aclocal
87 libtoolize --force --copy
88 automake --add-missing --copy --force
89 autoconf
90
91 MINGW32_CFLAGS="%{_mingw32_cflags} -DXQILLA_APIS" \
92 MINGW32_CXXFLAGS="%{_mingw32_cflags} -DXQILLA_APIS" \
93 %{_mingw32_configure} \
94   --disable-static \
95   --disable-rpath \
96   --with-xerces=$(pwd)/xerces-c-src_2_8_0
97 make %{?_smp_mflags}
98
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102
103 export CPPROG="cp -p"
104 make install DESTDIR=$RPM_BUILD_ROOT
105 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f '{}' ';'
106 mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
107 cp -pr ChangeLog LICENSE $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
108 cp -pr docs/dom3-api docs/simple-api \
109         $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
110 for file in `find $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}`; do\
111         if ! [ -s "$file" ]; then rm -f "$file"; fi;
112 done
113
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118
119 %files
120 %defattr(-,root,root)
121 %doc LICENSE
122 %{_mingw32_bindir}/i686-pc-mingw32-xqilla.exe
123 %{_mingw32_bindir}/libxqilla-5.dll
124 %{_mingw32_libdir}/libxqilla.dll.a
125 %{_mingw32_includedir}/xqc.h
126 %{_mingw32_includedir}/xqilla/
127
128
129 %changelog
130 * Wed Feb 18 2009 Richard W.M. Jones <rjones@redhat.com> - 2.2.0-1
131 - Initial RPM release.