smock: use $basearch in smock.mock.extra
[fedora-mingw.git] / dbus / mingw32-dbus.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 # We are using 'temporarily' the windbus project, which is a port of
8 # dbus and dbus-c++ to Windows.  At some point it is expected these
9 # will be merged back into the main dbus tree.
10 #
11 # In Fedora native, dbus and dbus-c++ are separate packages.  Here it
12 # is convenient to combine them into a single specfile / separate sub-
13 # packages.
14
15 %define date 20081031
16
17 Name:           mingw32-dbus
18 Version:        1.2.4
19 Release:        0.3.%{date}svn%{?dist}
20 Summary:        MinGW Windows port of DBus
21
22 License:        GPLv2+ or AFL
23 Group:          Development/Libraries
24 URL:            http://sourceforge.net/projects/windbus
25 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
26
27 # svn co https://windbus.svn.sourceforge.net/svnroot/windbus windbus
28 # tar zcf windbus-%{version}-%{date}.tar.gz trunk
29 # tar zcf windbus-c++-%{version}-%{date}.tar.gz dbuscxx
30 Source0:        windbus-%{version}-%{date}.tar.gz
31 Source1:        windbus-c++-%{version}-%{date}.tar.gz
32
33 # This patch is extremely hacky, and not upstream.
34 #
35 # windbus seems to prefer to use cmake to build instead of the
36 # original dbus autotools.  This patch hacks up the autotools
37 # files to work instead.  Really instead of just replacing the
38 # *unix*.c files with *win*.c we ought to include both and add
39 # proper #ifdef WIN32...#endif around the code.
40 Patch0:         mingw32-dbus-1.2.4-20081031-mingw32.patch
41
42 # This patch is almost, but not quite working.  For some reason
43 # the implementation of _dbus_poll (from the C library above) cannot
44 # be accessed by the C++ library.
45 Patch1:         mingw32-dbus-1.2.4-20081031-c++-mingw32.patch
46
47 BuildArch:      noarch
48
49 BuildRequires:  mingw32-filesystem >= 33
50 BuildRequires:  mingw32-gcc
51 BuildRequires:  mingw32-gcc-c++
52 BuildRequires:  mingw32-binutils
53 BuildRequires:  mingw32-glib2
54 BuildRequires:  mingw32-gtk2
55 BuildRequires:  mingw32-gtkmm24
56 BuildRequires:  mingw32-expat
57 BuildRequires:  libtool, automake, autoconf
58
59 # This keeps dbus-c++ subpackage happy while building.  We have
60 # hacked the Makefile to give the correct location of the libraries.
61 BuildRequires:  dbus-devel
62
63 Requires:       pkgconfig
64
65
66 %description
67 D-BUS is a system for sending messages between applications. It is
68 used both for the systemwide message bus service, and as a
69 per-user-login-session messaging facility.
70
71
72 %package c++
73 Summary:        MinGW Windows port of DBus
74 License:        LGPLv2+
75 Group:          Development/Libraries
76
77 %description c++
78 Native C++ bindings for D-Bus for use in C++ programs.
79
80
81 %prep
82 %setup -q -b 0 -c
83 %setup -q -a 1 -T -D
84
85 pushd trunk
86 %patch0 -p2
87 autoreconf
88 chmod +x configure
89 popd
90
91 pushd dbuscxx
92 %patch1 -p2
93 autoreconf
94 popd
95
96
97 %build
98 pushd trunk
99 # Avoid a test which fails when cross-compiling:
100 export ac_cv_have_abstract_sockets=no
101
102 # For unknown reasons, the configure script chokes if you
103 # pass --build explicitly.  We also need to pass -DDBUS_WIN
104 # as an extra flag.
105 PKG_CONFIG_PATH="%{_mingw32_libdir}/pkgconfig" \
106 CC="%{_mingw32_cc}" \
107 CFLAGS="%{_mingw32_cflags} -DDBUS_WIN -DDBUS_BUILD_TESTS" \
108 ./configure \
109   --host=%{_mingw32_host} \
110   --target=%{_mingw32_target} \
111   --prefix=%{_mingw32_prefix} \
112   --with-xml=expat
113 make
114 popd
115
116 pushd dbuscxx
117 %{_mingw32_configure}
118 # XXX Does not quite work yet.
119 make ||:
120 popd
121
122
123 %install
124 rm -rf $RPM_BUILD_ROOT
125 pushd trunk
126 make DESTDIR=$RPM_BUILD_ROOT install
127 popd
128
129 # Remove static libraries but DON'T remove *.dll.a files.
130 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libdbus-1.a
131
132 # Remove manpages because they duplicate what's in the
133 # Fedora native package already.
134 rm -r $RPM_BUILD_ROOT%{_mingw32_mandir}/man1
135
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140
141 %files
142 %defattr(-,root,root)
143 %doc trunk/COPYING
144 %{_mingw32_bindir}/dbus-daemon.exe
145 %{_mingw32_bindir}/i686-pc-mingw32-dbus-monitor.exe
146 %{_mingw32_bindir}/i686-pc-mingw32-dbus-send.exe
147 %{_mingw32_bindir}/libdbus-1-3.dll
148 %{_mingw32_libdir}/dbus-1.0/
149 %{_mingw32_libdir}/libdbus-1.dll.a
150 %{_mingw32_libdir}/libdbus-1.la
151 %{_mingw32_libdir}/pkgconfig/dbus-1.pc
152 %{_mingw32_sysconfdir}/dbus-1/
153 %{_mingw32_sysconfdir}/rc.d/init.d/i686-pc-mingw32-messagebus
154 %{_mingw32_includedir}/dbus-1.0/
155
156
157 %changelog
158 * Fri Feb  6 2009 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-0.3.20081031svn
159 - Include license.
160
161 * Tue Jan 13 2009 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-0.2.20081031svn
162 - Requires pkgconfig.
163
164 * Mon Nov  3 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.4-0.1.20081031svn
165 - Initial RPM release.