More files in bindir.
[fedora-mingw.git] / xerces-c / mingw32-xerces-c.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-xerces-c
8 Version:        2.8.0
9 Release:        2%{?dist}
10 Summary:        Validating XML parser
11
12 License:        ASL 2.0
13 Group:          Development/Libraries
14
15 URL:            http://xml.apache.org/xerces-c/
16 Source0:        http://www.apache.org/dist/xerces/c/2/sources/xerces-c-src_2_8_0.tar.gz
17
18 # Patch allows dllwrap to be overridden.
19 Patch1000:      xerces-c-dllwrap.patch
20
21 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
22 BuildArch:      noarch
23
24 BuildRequires:  mingw32-filesystem >= 35
25 BuildRequires:  mingw32-gcc
26 BuildRequires:  mingw32-gcc-c++
27 BuildRequires:  mingw32-binutils
28
29
30 %description
31 Xerces-C is a validating XML parser written in a portable subset of
32 C++. Xerces-C makes it easy to give your application the ability to
33 read and write XML data. A shared library is provided for parsing,
34 generating, manipulating, and validating XML documents. Xerces-C is
35 faithful to the XML 1.0 recommendation and associated standards (DOM
36 1.0, DOM 2.0. SAX 1.0, SAX 2.0, Namespaces).
37
38
39 %prep
40 %setup -q -n xerces-c-src_2_8_0
41
42 %patch1000 -p1
43
44 rm -rf doc/html/resources/.svn
45 find ./doc -type f -perm 755 -exec chmod 644 {} \;
46 find ./samples -type f -perm 755 -exec chmod 644 {} \;
47 %{__perl} -pi.orig -e 's|(PREFIX.)/lib\b|$1/%{_lib}|g' src/xercesc/configure */Makefile.in
48 rm doc/html/apiDocs/XMLRegisterCleanup_8hpp__incl.map
49 rm doc/html/apiDocs/XSConstants_8hpp__incl.map
50
51 # make rpmlint happy
52 sed -i 's/\r//' doc/charter.xml
53 iconv -f iso8859-1 -t utf-8 credits.txt > credits.utf8 && mv -f credits.{utf8,txt}
54 iconv -f iso8859-1 -t utf-8 doc/feedback.xml > doc/feedback.utf8 && mv -f doc/feedback.{utf8,xml}
55 iconv -f iso8859-1 -t utf-8 doc/migration.xml > doc/migration.utf8 && mv -f doc/migration.{utf8,xml}
56 iconv -f iso8859-1 -t utf-8 doc/releases_archive.xml > doc/releases_archive.utf8 && mv -f doc/releases_archive.{utf8,xml}
57
58
59 %build
60 export XERCESCROOT="$PWD"
61
62 # Let Makefiles be verbose
63 find -name 'Makefile.*' | while read f; do
64         sed -i -e 's/$Q//g' \
65         -e 's/{MAKE} -s/(MAKE)/g' \
66         -e '/echo \"  (/d' \
67         $f
68 done
69
70 # Remove conflicting flags from runConfigure
71 find -name runConfigure | while read f; do
72         sed -i -e 's/-w -O -DNDEBUG/-DNDEBUG/g' $f
73 done
74
75 cd $XERCESCROOT/src/xercesc
76 CXXFLAGS="%{_mingw32_cflags}" \
77 CFLAGS="%{_mingw32_cflags}" \
78 ./runConfigure \
79   -pmingw-msys \
80   -c%{_mingw32_cc} \
81   -x%{_mingw32_cxx} \
82   -minmem \
83   -nwinsock \
84   -tWin32 \
85   -b32 \
86   -P %{_mingw32_prefix} \
87   -C --libdir="%{_mingw32_libdir}" -C --host=%{_mingw32_host}
88
89 # not smp safe
90 %{__make} DLLWRAP=%{_mingw32_dllwrap}
91
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95
96 export XERCESCROOT="$PWD"
97 %{__make} install -C src/xercesc DESTDIR="$RPM_BUILD_ROOT"
98
99 # Move the DLLs into the bindir.
100 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
101 mv $RPM_BUILD_ROOT%{_mingw32_libdir}/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}/
102
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107
108 %files
109 %defattr(-,root,root)
110 %doc LICENSE
111 %{_mingw32_includedir}/xercesc/
112 %{_mingw32_bindir}/libxerces-c.dll
113 %{_mingw32_bindir}/libxerces-c28.dll
114 %{_mingw32_bindir}/libxerces-c2_8_0.dll
115 %{_mingw32_bindir}/libxerces-depdom.dll
116 %{_mingw32_bindir}/libxerces-depdom28.dll
117 %{_mingw32_bindir}/libxerces-depdom2_8_0.dll
118
119
120 %changelog
121 * Wed Feb 18 2009 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-2
122 - Initial RPM release.