fix systemd->dbus->systemd circular dependency
authorAdrian Negreanu <adrian.m.negreanu@intel.com>
Tue, 6 Aug 2013 12:02:04 +0000 (15:02 +0300)
committerAdrian Szyndela <adrian.s@samsung.com>
Fri, 19 Feb 2016 10:09:56 +0000 (11:09 +0100)
extract libdbus and dbus-devel as separate packages

Change-Id: Ia097a2b3fee2911ee89000dd2d5762a112bf17f6
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
packaging/dbus.spec
packaging/libdbus.spec [new file with mode: 0644]

index 9848449..17b6788 100644 (file)
@@ -7,8 +7,6 @@ License:        GPL-2.0+ or AFL-2.1
 Group:          Base/IPC
 # COMMON1-BEGIN
 
-# We can't enable this right now, because it will create a build cycle between
-# dbus-1 and systemd. Fun!
 %define with_systemd 1
 
 BuildRequires:  doxygen
@@ -34,19 +32,7 @@ BuildRequires:  libcap-ng-devel
 # COMMON1-END
 Requires(pre):  /usr/sbin/groupadd /usr/sbin/useradd
 
-Provides:      dbus-1
 
-%package -n libdbus
-Summary:        Library package for D-Bus
-Group:          Base/IPC
-
-%package devel
-
-Summary:        Developer package for D-Bus
-Group:          Development/Libraries
-Requires:       libdbus = %{version}
-Requires:       dbus
-Requires:       glibc-devel
 
 %package devel-doc
 
@@ -63,22 +49,6 @@ a general one-to-one message passing framework, which can be used by
 any two apps to communicate directly (without going through the message
 bus daemon).
 
-%description -n libdbus
-D-Bus is a message bus system, a simple way for applications to talk to
-one another. D-Bus supplies both a system daemon and a
-per-user-login-session daemon. Also, the message bus is built on top of
-a general one-to-one message passing framework, which can be used by
-any two apps to communicate directly (without going through the message
-bus daemon).
-
-%description devel
-D-Bus is a message bus system, a simple way for applications to talk to
-one another. D-Bus supplies both a system daemon and a
-per-user-login-session daemon. Also, the message bus is built on top of
-a general one-to-one message passing framework, which can be used by
-any two apps to communicate directly (without going through the message
-bus daemon).
-
 %description devel-doc
 D-Bus is a message bus system, a simple way for applications to talk to
 one another. D-BUS supplies both a system daemon and a
@@ -126,10 +96,7 @@ mkdir -p %{buildroot}/%{_libdir}/pkgconfig
 mkdir -p %{buildroot}/lib/dbus-1/system-services
 mkdir -p %{buildroot}/%{_datadir}/dbus-1/system-services
 mkdir -p %{buildroot}/%{_datadir}/dbus-1/interfaces
-rm -f %{buildroot}/%{_libdir}/*.la
 #
-rm -f %{buildroot}/%{_bindir}/dbus-launch
-rm -f %{buildroot}/%{_mandir}/man1/dbus-launch.1*
 chmod a-x AUTHORS COPYING HACKING NEWS README doc/*.txt doc/file-boilerplate.c doc/TODO
 #
 install -d %{buildroot}%{_sysconfdir}/ConsoleKit/run-session.d
@@ -140,6 +107,15 @@ touch %{buildroot}/%{_localstatedir}/lib/dbus/machine-id
 mkdir -p %{buildroot}%{_unitdir_user}
 install -m0644 %{SOURCE5} %{buildroot}%{_unitdir_user}/dbus.service
 install -m0644 %{SOURCE6} %{buildroot}%{_unitdir_user}/dbus.socket
+# File packaged by libdbus and dbus-devel
+rm -rf %{buildroot}/%{_includedir}/*
+rm -rf %{buildroot}/%{_libdir}/*.la
+rm -rf %{buildroot}/%{_libdir}/libdbus-1.so
+rm -rf %{buildroot}/%{_libdir}/libdbus-1.so.*
+rm -rf %{buildroot}/%{_libdir}/dbus-1.0/include
+rm -rf %{buildroot}/%{_libdir}/pkgconfig/dbus-1.pc
+rm -rf %{buildroot}/%{_mandir}/man1/dbus-launch.1*
+rm -rf %{buildroot}/%{_bindir}/dbus-launch
 
 
 %pre
@@ -148,10 +124,6 @@ install -m0644 %{SOURCE6} %{buildroot}%{_unitdir_user}/dbus.socket
 /usr/sbin/useradd -c 'System message bus' -u %{dbus_user_uid} -g %{dbus_user_uid} \
         -s /sbin/nologin -r -d '/' dbus 2> /dev/null || :
 
-%post -n libdbus -p /sbin/ldconfig
-
-%postun -n libdbus -p /sbin/ldconfig
-
 %docs_package
 
 %files
@@ -185,27 +157,6 @@ install -m0644 %{SOURCE6} %{buildroot}%{_unitdir_user}/dbus.socket
 %dir %{_unitdir}/sockets.target.wants
 %{_unitdir}/sockets.target.wants/dbus.socket
 
-%files -n libdbus
-%defattr(-, root, root)
-%{_libdir}/libdbus-1.so.*
-# Own those directories in the library instead of dbus-1, since dbus users
-# often ship files there
-%dir %{_sysconfdir}/dbus-1
-%dir %{_sysconfdir}/dbus-1/session.d
-%dir %{_sysconfdir}/dbus-1/system.d
-%dir %{_datadir}/dbus-1
-%dir %{_datadir}/dbus-1/interfaces
-%dir %{_datadir}/dbus-1/services
-%dir %{_datadir}/dbus-1/system-services
-
-%files devel
-%defattr(-,root,root)
-%{_includedir}/*
-%{_libdir}/libdbus-1.so
-%dir %{_libdir}/dbus-1.0
-%{_libdir}/dbus-1.0/include
-%{_libdir}/pkgconfig/dbus-1.pc
-
 %files devel-doc
 %defattr(-,root,root)
 %dir %{_datadir}/doc/dbus
diff --git a/packaging/libdbus.spec b/packaging/libdbus.spec
new file mode 100644 (file)
index 0000000..7b6d87e
--- /dev/null
@@ -0,0 +1,115 @@
+Name:           libdbus
+Url:            http://dbus.freedesktop.org/
+Summary:        Library package for D-Bus
+License:        GPL-2.0+ or AFL-2.1
+Group:          System/Libraries
+Version:        1.6.12
+Release:        0
+Source0:        http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz
+
+BuildRequires:  expat-devel
+BuildRequires:  libtool
+
+
+
+%package -n dbus-devel
+Summary:        Developer package for D-Bus
+Group:          Development/Libraries
+Requires:       libdbus = %{version}
+Provides:       dbus-1
+
+
+
+%description
+D-Bus is a message bus system, a simple way for applications to talk to
+one another. D-Bus supplies both a system daemon and a
+per-user-login-session daemon. Also, the message bus is built on top of
+a general one-to-one message passing framework, which can be used by
+any two apps to communicate directly (without going through the message
+bus daemon).
+
+
+
+%description -n dbus-devel
+D-Bus is a message bus system, a simple way for applications to talk to
+one another. D-Bus supplies both a system daemon and a
+per-user-login-session daemon. Also, the message bus is built on top of
+a general one-to-one message passing framework, which can be used by
+any two apps to communicate directly (without going through the message
+bus daemon).
+
+
+
+%prep
+# COMMON2-BEGIN
+%setup -n dbus-%{version} -q
+
+
+
+%build
+autoreconf -fi
+# We use -fpie/-pie for the whole build; this is the recommended way to harden
+# the build upstream, see discussion in fdo#46570
+export CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -fPIC -fpie"
+export LDFLAGS="-pie"
+export CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
+export CFLAGS="$CFLAGS -fstack-protector"
+export CXXFLAGS="$CXXFLAGS -fstack-protector"
+export V=1
+%configure \
+    --disable-static                                                   \
+    --with-pic                                                         \
+    --with-dbus-user=dbus                                              \
+    --libexecdir=%{_libdir}/%{name}                                    \
+    --libdir=%{_libdir}                                                        \
+    --with-init-scripts=suse                                           \
+    --enable-inotify                                                   \
+    --with-console-auth-dir=/var/run/dbus/at_console/                  \
+    --with-systemdsystemunitdir=%{_unitdir}
+
+make %{?_smp_mflags} -C dbus libdbus-1.la
+
+
+
+%install
+make DESTDIR=%{buildroot} -C dbus \
+     lib_LTLIBRARIES=libdbus-1.la \
+     install-libLTLIBRARIES \
+     install-dbusincludeHEADERS \
+     install-nodist_dbusarchincludeHEADERS
+
+make DESTDIR=%{buildroot} install-pkgconfigDATA
+
+
+
+%post -p /sbin/ldconfig
+
+
+
+%postun -p /sbin/ldconfig
+
+
+
+%files
+%defattr(-, root, root)
+%{_libdir}/libdbus-1.so.*
+# Own those directories in the library instead of dbus-1, since dbus users
+# often ship files there
+#%dir %{_sysconfdir}/dbus-1
+#%dir %{_sysconfdir}/dbus-1/session.d
+#%dir %{_sysconfdir}/dbus-1/system.d
+#%dir %{_datadir}/dbus-1
+#%dir %{_datadir}/dbus-1/interfaces
+#%dir %{_datadir}/dbus-1/services
+#%dir %{_datadir}/dbus-1/system-services
+
+
+
+%files -n dbus-devel
+%defattr(-,root,root)
+%{_includedir}/*
+%{_libdir}/libdbus-1.la
+%{_libdir}/libdbus-1.so
+%{_libdir}/dbus-1.0/include
+%{_libdir}/pkgconfig/dbus-1.pc
+%dir %{_libdir}/dbus-1.0