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