Implementation of windbus.
[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.1.%{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
60 %description
61 D-BUS is a system for sending messages between applications. It is
62 used both for the systemwide message bus service, and as a
63 per-user-login-session messaging facility.
64
65
66 %package c++
67 Summary:        MinGW Windows port of DBus
68 License:        LGPLv2+
69 Group:          Development/Libraries
70
71 %description c++
72 Native C++ bindings for D-Bus for use in C++ programs.
73
74
75 %prep
76 %setup -q -b 0 -c
77 %setup -q -a 1 -T -D
78
79 pushd trunk
80 %patch0 -p2
81 autoreconf
82 chmod +x configure
83 popd
84
85 pushd dbuscxx
86 %patch1 -p2
87 autoreconf
88 popd
89
90
91 %build
92 pushd trunk
93 # For unknown reasons, the configure script chokes if you
94 # pass --build explicitly.  We also need to pass -DDBUS_WIN
95 # as an extra flag.
96 PKG_CONFIG_PATH="%{_mingw32_libdir}/pkgconfig" \
97 CC="%{_mingw32_cc}" \
98 CFLAGS="%{_mingw32_cflags} -DDBUS_WIN -DDBUS_BUILD_TESTS" \
99 ./configure \
100   --host=%{_mingw32_host} \
101   --target=%{_mingw32_target} \
102   --prefix=%{_mingw32_prefix} \
103   --with-xml=expat
104 make
105 popd
106
107 pushd dbuscxx
108 %{_mingw32_configure}
109 # XXX Does not quite work yet.
110 make ||:
111 popd
112
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116 pushd trunk
117 make DESTDIR=$RPM_BUILD_ROOT install
118 popd
119
120 # Remove static libraries but DON'T remove *.dll.a files.
121 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libdbus-1.a
122
123 # Remove manpages because they duplicate what's in the
124 # Fedora native package already.
125 rm -r $RPM_BUILD_ROOT%{_mingw32_mandir}/man1
126
127
128 %clean
129 rm -rf $RPM_BUILD_ROOT
130
131
132 %files
133 %defattr(-,root,root)
134 %{_mingw32_bindir}/dbus-daemon.exe
135 %{_mingw32_bindir}/i686-pc-mingw32-dbus-monitor.exe
136 %{_mingw32_bindir}/i686-pc-mingw32-dbus-send.exe
137 %{_mingw32_bindir}/libdbus-1-3.dll
138 %{_mingw32_libdir}/dbus-1.0/
139 %{_mingw32_libdir}/libdbus-1.dll.a
140 %{_mingw32_libdir}/libdbus-1.la
141 %{_mingw32_libdir}/pkgconfig/dbus-1.pc
142 %{_mingw32_sysconfdir}/dbus-1/
143 %{_mingw32_sysconfdir}/rc.d/init.d/i686-pc-mingw32-messagebus
144 %{_mingw32_includedir}/dbus-1.0/
145
146
147
148 %changelog
149 * Wed Sep 24 2008 Your Name <you@example.com> - 1.2.3-1
150 - Initial RPM release.