smock: sort the commandline options
[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:        3%{?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 # XQLexer uses EOF symbol from stdio.
31 Patch1003:      xqilla-lexer-cstdio.patch
32
33 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
34 BuildArch:      noarch
35
36 BuildRequires:  mingw32-filesystem >= 35
37 BuildRequires:  mingw32-gcc
38 BuildRequires:  mingw32-gcc-c++
39 BuildRequires:  mingw32-binutils
40
41 BuildRequires:  mingw32-xerces-c >= 2.8.0
42 BuildRequires:  flex
43 BuildRequires:  autoconf, automake, libtool
44 BuildRequires:  doxygen, graphviz
45
46
47 %description
48 XQilla is an XQuery and XPath 2.0 implementation written in C++ and based
49 on Xerces-C. It implements the DOM 3 XPath API, as well as having it's own
50 more powerful API. It conforms to the W3C proposed recomendation of XQuery
51 and XPath 2.0.
52
53
54 %prep
55 %setup -q -a 1 -n XQilla-%{version}
56
57 pushd xerces-c-src_2_8_0
58 %patch1000 -p1
59 popd
60
61 %patch1001 -p1
62 %patch1002 -p1
63 %patch1003 -p1
64
65
66 %build
67 # XQilla requires a _built_ copy of Xerces-C.  Thus we have to build
68 # one first, copying much of the code from 'mingw32-xerces-c.spec'.
69 # Native Fedora package instead patches the configure script to look
70 # at the installed copy.
71 pushd xerces-c-src_2_8_0
72 export XERCESCROOT="$PWD"
73 cd $XERCESCROOT/src/xercesc
74 CXXFLAGS="%{_mingw32_cflags}" \
75 CFLAGS="%{_mingw32_cflags}" \
76 ./runConfigure \
77   -pmingw-msys \
78   -c%{_mingw32_cc} \
79   -x%{_mingw32_cxx} \
80   -minmem \
81   -nwinsock \
82   -tWin32 \
83   -b32 \
84   -P %{_mingw32_prefix} \
85   -C --libdir="%{_mingw32_libdir}" -C --host=%{_mingw32_host}
86 %{__make} DLLWRAP=%{_mingw32_dllwrap}
87 popd
88
89 rm -f aclocal.m4
90 aclocal
91 libtoolize --force --copy
92 automake --add-missing --copy --force
93 autoconf
94
95 MINGW32_CFLAGS="%{_mingw32_cflags} -DXQILLA_APIS" \
96 MINGW32_CXXFLAGS="%{_mingw32_cflags} -DXQILLA_APIS" \
97 %{_mingw32_configure} \
98   --disable-static \
99   --disable-rpath \
100   --with-xerces=$(pwd)/xerces-c-src_2_8_0
101 make %{?_smp_mflags}
102
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 export CPPROG="cp -p"
108 make install DESTDIR=$RPM_BUILD_ROOT
109 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f '{}' ';'
110 mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
111 cp -pr ChangeLog LICENSE $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
112 cp -pr docs/dom3-api docs/simple-api \
113         $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}
114 for file in `find $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}`; do\
115         if ! [ -s "$file" ]; then rm -f "$file"; fi;
116 done
117
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122
123 %files
124 %defattr(-,root,root)
125 %doc LICENSE
126 %{_mingw32_bindir}/i686-pc-mingw32-xqilla.exe
127 %{_mingw32_bindir}/libxqilla-5.dll
128 %{_mingw32_libdir}/libxqilla.dll.a
129 %{_mingw32_includedir}/xqc.h
130 %{_mingw32_includedir}/xqilla/
131
132
133 %changelog
134 * Sat Feb 21 2009 Richard W.M. Jones <rjones@redhat.com> - 2.2.0-3
135 - Rebuild for mingw32-gcc 4.4
136
137 * Wed Feb 18 2009 Richard W.M. Jones <rjones@redhat.com> - 2.2.0-1
138 - Initial RPM release.