Browse Source

dbus-1.12.20-1

Tomohiro "Tomo-p" KATO 2 years ago
parent
commit
85fbb02b7b
1 changed files with 225 additions and 58 deletions
  1. 225 58
      d/dbus/dbus-vl.spec

+ 225 - 58
d/dbus/dbus-vl.spec

@@ -1,27 +1,36 @@
+%bcond_with systemd
+
 %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
 %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
 
 
 %define _unpackaged_files_terminate_build 1
 %define _unpackaged_files_terminate_build 1
-%bcond_with systemd
 
 
 %define gettext_package dbus
 %define gettext_package dbus
 %define expat_version           2.0.1
 %define expat_version           2.0.1
 %define dbus_user_uid           81
 %define dbus_user_uid           81
 
 
+%global _localstatedir %{_var}
 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
 %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
-%define _localstatedir %{_var}
+%{!?_unitdir:%global _unitdir /lib/systemd/system}
+%{!?_userunitdir:%global _userunitdir /usr/lib/systemd/user}
 
 
 Summary: D-BUS message bus
 Summary: D-BUS message bus
 Summary(ja): D-BUS メッセージバスシステム
 Summary(ja): D-BUS メッセージバスシステム
 Name: dbus
 Name: dbus
-Version: 1.12.12
-Release: 1%{?_dist_release}
-URL: http://www.freedesktop.org/software/dbus/
-License: AFL/GPLv2
+Version: 1.12.20
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
 Group: System Environment/Libraries
 Group: System Environment/Libraries
+Vendor: Project Vine
+Distribution: Vine Linux
 
 
-Source0: %{name}-%{version}.tar.gz
+License: AFL/GPLv2
+URL: https://www.freedesktop.org/software/dbus/
+Source0: https://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz
 Source1: 00-start-message-bus.sh
 Source1: 00-start-message-bus.sh
 Source2: dbus.init
 Source2: dbus.init
+Source3: dbus.service
+Source4: dbus.user.service
+Source5: dbus.socket
+Source6: dbus.user.socket
 
 
 # from fedora package
 # from fedora package
 
 
@@ -29,9 +38,10 @@ Source2: dbus.init
 Patch1000: dbus-enable-elogind.patch
 Patch1000: dbus-enable-elogind.patch
 
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
-Requires(post): chkconfig >= 1.3.34
-Requires(preun): chkconfig >= 1.3.34
-Requires(pre): shadow-utils
+
+# default daemon
+Requires: %{name}-daemon = %{version}-%{release}
+
 BuildRequires: autoconf-archive
 BuildRequires: autoconf-archive
 BuildRequires: libtool
 BuildRequires: libtool
 BuildRequires: expat-devel >= %{expat_version}
 BuildRequires: expat-devel >= %{expat_version}
@@ -43,9 +53,11 @@ BuildRequires: libxslt
 BuildRequires: gettext
 BuildRequires: gettext
 BuildRequires: libX11-devel
 BuildRequires: libX11-devel
 BuildRequires: libSM-devel
 BuildRequires: libSM-devel
-
-Vendor: Project Vine
-Distribution: Vine Linux
+%if %{with systemd}
+BuildRequires: systemd-devel
+%else
+BuildRequires: elogind-devel
+%endif
 
 
 %description
 %description
 D-BUS is a system for sending messages between applications. It is
 D-BUS is a system for sending messages between applications. It is
@@ -57,11 +69,57 @@ D-BUS はアプリケーション間でメッセージを送受信するため
 システム全体のメッセージバスサービスとしても利用されますが、同様に
 システム全体のメッセージバスサービスとしても利用されますが、同様に
 ユーザ毎のログインセッションにおけるメッセージ基盤としても利用されます。
 ユーザ毎のログインセッションにおけるメッセージ基盤としても利用されます。
 
 
+%package common
+Summary:        D-BUS message bus configuration
+BuildArch:      noarch
+%if %{with systemd}
+%{?systemd_requires}
+Requires:       systemd
+%endif
+
+%description common
+The %{name}-common package provides the configuration and setup files for D-Bus
+implementations to provide a System and User Message Bus.
+
+%package daemon
+Summary:        D-BUS message bus
+%{?systemd_requires}
+Requires:       dbus-common = %{version}-%{release}
+Requires:       dbus-libs%{?_isa} = %{version}-%{release}
+Requires:       dbus-tools = %{version}-%{release}
+Requires(pre):  shadow-utils
+%if %{with systemd}
+%{?systemd_requires}
+Requires:       systemd
+%else
+Requires(post): chkconfig >= 1.3.34
+Requires(preun): chkconfig >= 1.3.34
+%endif
+
+%description daemon
+D-BUS is a system for sending messages between applications. It is
+used both for the system-wide message bus service, and as a
+per-user-login-session messaging facility.
+
+%package libs
+Summary: Libraries for accessing D-BUS
+
+%description libs
+This package contains lowlevel libraries for accessing D-BUS.
+
+%package tools
+Summary:        D-BUS Tools and Utilities
+Requires:       dbus-libs%{?_isa} = %{version}-%{release}
+
+%description tools
+Tools and utilities to interact with a running D-Bus Message Bus, provided by
+the reference implementation.
+
 %package devel
 %package devel
 Summary: Libraries and headers for D-BUS
 Summary: Libraries and headers for D-BUS
 Summary(ja): D-BUS 用のライブラリとヘッダファイル
 Summary(ja): D-BUS 用のライブラリとヘッダファイル
 Group: Development/Libraries
 Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
+Requires: %{name}-libs = %{version}-%{release}
 Requires: xml-common
 Requires: xml-common
 
 
 %description devel
 %description devel
@@ -114,7 +172,11 @@ Requires: %{name}-devel = %{version}-%{release}
 Headers and static libraries for D-BUS.
 Headers and static libraries for D-BUS.
 
 
 %prep
 %prep
-%autosetup -p1
+%setup
+%if ! %{with systemd}
+%patch1000 -p1 -b .elogind
+%endif
+
 
 
 %build
 %build
 # Avoid rpath.
 # Avoid rpath.
@@ -122,12 +184,23 @@ if test -f autogen.sh; then env NOCONFIGURE=1 ./autogen.sh; else autoreconf --ve
 rbose --force --install; fi
 rbose --force --install; fi
 
 
 COMMON_ARGS="--enable-selinux=no \
 COMMON_ARGS="--enable-selinux=no \
+%if %{with systemd}
+		SYSTEMCTL=/bin/systemctl \
+		--enable-systemd \
+		--with-init-scripts=redhat \
+		--with-systemdsystemunitdir=%{_unitdir} \
+		--with-systemduserunitdir=%{_userunitdir} \
+		--enable-user-session \
+		--with-system-pid-file=/run/messagebus.pid \
+		--with-system-socket=/run/dbus/system_bus_socket
+%else
 		--enable-elogind \
 		--enable-elogind \
-		--disable-libaudit \
 		--with-system-pid-file=%{_localstatedir}/run/messagebus.pid \
 		--with-system-pid-file=%{_localstatedir}/run/messagebus.pid \
+%endif
+		--disable-libaudit \
 		--with-dbus-user=dbus \
 		--with-dbus-user=dbus \
 		--libdir=/%{_lib} --bindir=/bin \
 		--libdir=/%{_lib} --bindir=/bin \
-		--libexecdir=/%{_lib}/dbus-1 \
+		--libexecdir=/lib/dbus-1 \
 		--docdir=%{_pkgdocdir} \
 		--docdir=%{_pkgdocdir} \
 		--sysconfdir=%{_sysconfdir} --exec-prefix=/"
 		--sysconfdir=%{_sysconfdir} --exec-prefix=/"
 
 
@@ -151,6 +224,8 @@ install --directory %{buildroot}%{_sysconfdir}/dbus-1/system.d
 install --directory %{buildroot}%{_datadir}/dbus-1/interfaces
 install --directory %{buildroot}%{_datadir}/dbus-1/interfaces
 
 
 %if %{with systemd}
 %if %{with systemd}
+%__make install-data DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
+
 # Make sure that when somebody asks for D-Bus under the name of the
 # Make sure that when somebody asks for D-Bus under the name of the
 # old SysV script, that he ends up with the standard dbus.service name
 # old SysV script, that he ends up with the standard dbus.service name
 # now.
 # now.
@@ -158,9 +233,13 @@ ln -s dbus.service %{buildroot}%{_unitdir}/messagebus.service
 
 
 ## %find_lang %{gettext_package}
 ## %find_lang %{gettext_package}
 # Delete the old legacy sysv init script
 # Delete the old legacy sysv init script
-rm -rf %{buildroot}%{_initrddir}
+#rm -rf %{buildroot}%{_initrddir}
 %else
 %else
 rm -rf %{buildroot}%{_sysconfdir}/systemd
 rm -rf %{buildroot}%{_sysconfdir}/systemd
+rm -rf %{buildroot}/lib/systemd
+rm -rf %{buildroot}%{_prefix}/lib/systemd
+rm -rf %{buildroot}%{_prefix}/lib/sysuserd.d
+rm -rf %{buildroot}%{_prefix}/lib/tmpfiles.d
 install -Dm755 %{SOURCE2} %{buildroot}%{_initrddir}/messagebus
 install -Dm755 %{SOURCE2} %{buildroot}%{_initrddir}/messagebus
 %endif
 %endif
 
 
@@ -186,7 +265,7 @@ ret=0
 i=0
 i=0
 tmpdir=\$(mktemp --directory --tmpdir dbus-run-installed-tests.XXXXXX)
 tmpdir=\$(mktemp --directory --tmpdir dbus-run-installed-tests.XXXXXX)
 
 
-for t in /%{_lib}/dbus-1/installed-tests/dbus/test-*; do
+for t in /lib/dbus-1/installed-tests/dbus/test-*; do
     i=\$(( \$i + 1 ))
     i=\$(( \$i + 1 ))
     echo "# \$i - \$t ..."
     echo "# \$i - \$t ..."
     echo "x" > "\$tmpdir/result"
     echo "x" > "\$tmpdir/result"
@@ -211,7 +290,7 @@ echo "1..\$i"
 exit \$ret
 exit \$ret
 EOF
 EOF
 
 
-install -pm 755 -t %{buildroot}/%{_lib}/dbus-1 dbus-run-installed-tests
+install -pm 755 -t %{buildroot}/lib/dbus-1 dbus-run-installed-tests
 
 
 ## vine stuff
 ## vine stuff
 
 
@@ -221,83 +300,161 @@ mv -f \
   %{buildroot}/%{_lib}/cmake/DBus1/DBus1ConfigVersion.cmake \
   %{buildroot}/%{_lib}/cmake/DBus1/DBus1ConfigVersion.cmake \
   %{buildroot}%{_libdir}/cmake/DBus1/
   %{buildroot}%{_libdir}/cmake/DBus1/
 
 
-mkdir -p $RPM_BUILD_ROOT/%{_bindir}
-mv -f $RPM_BUILD_ROOT/bin/dbus-launch $RPM_BUILD_ROOT/%{_bindir}/
+mkdir -p %{buildroot}/%{_bindir}
+mv -f %{buildroot}/bin/dbus-launch %{buildroot}/%{_bindir}/
 
 
 mkdir -p %{buildroot}/%{_libdir}/dbus-1.0
 mkdir -p %{buildroot}/%{_libdir}/dbus-1.0
 mv %{buildroot}/%{_lib}/dbus-1.0/include %{buildroot}/%{_libdir}/dbus-1.0/
 mv %{buildroot}/%{_lib}/dbus-1.0/include %{buildroot}/%{_libdir}/dbus-1.0/
 
 
-mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
+mkdir -p %{buildroot}/%{_libdir}/pkgconfig
 #change the arch-deps.h include directory to /usr/lib[64] instead of /lib[64]
 #change the arch-deps.h include directory to /usr/lib[64] instead of /lib[64]
-sed -e 's@-I${libdir}@-I${prefix}/%{_lib}@' $RPM_BUILD_ROOT/%{_lib}/pkgconfig/dbus-1.pc > $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/dbus-1.pc
-rm -f $RPM_BUILD_ROOT/%{_lib}/pkgconfig/dbus-1.pc
+sed -e 's@-I${libdir}@-I${prefix}/%{_lib}@' %{buildroot}/%{_lib}/pkgconfig/dbus-1.pc > %{buildroot}/%{_libdir}/pkgconfig/dbus-1.pc
+rm -f %{buildroot}/%{_lib}/pkgconfig/dbus-1.pc
+
+rm -f %{buildroot}/lib/dbus-1/dbus-run-installed-tests
+
+%if %{with systemd}
+rm -rf %{buildroot}/var/run/dbus
+install -m644 %{SOURCE3} %{buildroot}%{_unitdir}/dbus.service
+install -m644 %{SOURCE4} %{buildroot}%{_userunitdir}/dbus.service
+install -m644 %{SOURCE5} %{buildroot}%{_unitdir}/dbus.socket
+install -m644 %{SOURCE6} %{buildroot}%{_userunitdir}/dbus.socket
+%endif
 
 
-rm -f $RPM_BUILD_ROOT/%{_lib}/dbus-1/dbus-run-installed-tests
 
 
 %clean
 %clean
 rm -rf %{buildroot}
 rm -rf %{buildroot}
 
 
-%pre
+
+%pre daemon
 # Add the "dbus" user
 # Add the "dbus" user
 /usr/sbin/useradd -c 'System message bus' -u %{dbus_user_uid} \
 /usr/sbin/useradd -c 'System message bus' -u %{dbus_user_uid} \
 	-s /sbin/nologin -r -d '/' dbus 2> /dev/null || :
 	-s /sbin/nologin -r -d '/' dbus 2> /dev/null || :
 
 
-%post
-/sbin/ldconfig
+%post daemon
+%if %{with systemd}
+%systemd_post dbus.service
+%systemd_user_post dbus.service
+%else
 /sbin/chkconfig --add messagebus
 /sbin/chkconfig --add messagebus
 /sbin/chkconfig messagebus resetpriorities
 /sbin/chkconfig messagebus resetpriorities
+%endif
 
 
-%preun
+%preun daemon
+%if %{with systemd}
+%systemd_preun dbus.service
+%systemd_user_preun dbus.service
+%else
 if [ $1 = 0 ]; then
 if [ $1 = 0 ]; then
     service messagebus stop > /dev/null 2>&1
     service messagebus stop > /dev/null 2>&1
     /sbin/chkconfig --del messagebus
     /sbin/chkconfig --del messagebus
 fi
 fi
+if [ -x /sbin/systemctl ]; then
+    /sbin/chkconfig --del messagebus
+fi
+%endif
 
 
-%postun
-/sbin/ldconfig
+%postun daemon
+%if %{with systemd}
+%systemd_postun dbus.service
+%systemd_user_postun dbus.service
+%endif
 
 
-%post -n compat32-%{name} -p /sbin/ldconfig
+%if !%{with systemd}
+%triggerpostun daemon -- dbus-daemon < 1.12.16-2
+/sbin/chkconfig --add messagebus
+/sbin/chkconfig messagebus resetpriorities
+%endif
+
+%if %{with systemd}
+%post common
+%systemd_post dbus.socket
+%systemd_user_post dbus.socket
 
 
+%preun common
+%systemd_preun dbus.socket
+%systemd_user_preun dbus.socket
+
+%postun common
+%systemd_postun dbus.socket
+%systemd_user_postun dbus.socket
+%endif
+
+%post libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
+
+%post -n compat32-%{name} -p /sbin/ldconfig
 %postun -n compat32-%{name} -p /sbin/ldconfig
 %postun -n compat32-%{name} -p /sbin/ldconfig
 
 
 %files
 %files
+# dummy package
+
+%files common
+%dir %{_sysconfdir}/dbus-1
+%dir %{_sysconfdir}/dbus-1/session.d
+%dir %{_sysconfdir}/dbus-1/system.d
+%config %{_sysconfdir}/dbus-1/session.conf
+%config %{_sysconfdir}/dbus-1/system.conf
+%dir %{_datadir}/dbus-1
+%dir %{_datadir}/dbus-1/session.d
+%dir %{_datadir}/dbus-1/system.d
+%{_datadir}/dbus-1/session.conf
+%{_datadir}/dbus-1/system.conf
+%{_datadir}/dbus-1/services
+%{_datadir}/dbus-1/system-services
+%{_datadir}/dbus-1/interfaces
+%if %{with systemd}
+%{_sysusersdir}/dbus.conf
+%{_unitdir}/dbus.socket
+%{_userunitdir}/dbus.socket
+%endif
+
+%files daemon
 %defattr(-,root,root)
 %defattr(-,root,root)
 %{!?_licensedir:%global license %%doc}
 %{!?_licensedir:%global license %%doc}
 %license COPYING
 %license COPYING
 %doc AUTHORS ChangeLog NEWS README
 %doc AUTHORS ChangeLog NEWS README
-%dir %{_sysconfdir}/dbus-1
 %config %{_sysconfdir}/dbus-1/*.conf
 %config %{_sysconfdir}/dbus-1/*.conf
 %ghost %dir /run/%{name}
 %ghost %dir /run/%{name}
-%{_sysconfdir}/rc.d/init.d/*
-%dir %{_sysconfdir}/dbus-1/system.d
-%dir %{_sysconfdir}/dbus-1/session.d
-%dir %{_localstatedir}/run/dbus
 %dir %{_localstatedir}/lib/dbus/
 %dir %{_localstatedir}/lib/dbus/
 /bin/dbus-daemon
 /bin/dbus-daemon
-/bin/dbus-send
 /bin/dbus-cleanup-sockets
 /bin/dbus-cleanup-sockets
-/bin/dbus-monitor
 /bin/dbus-run-session
 /bin/dbus-run-session
 /bin/dbus-test-tool
 /bin/dbus-test-tool
-/bin/dbus-update-activation-environment
-/bin/dbus-uuidgen
-/%{_lib}/*dbus-1*.so.*
-%{_mandir}/man*/dbus-cleanup-sockets.1.gz
 %{_mandir}/man*/dbus-daemon.1.gz
 %{_mandir}/man*/dbus-daemon.1.gz
-%{_mandir}/man*/dbus-monitor.1.gz
+%{_mandir}/man*/dbus-cleanup-sockets.1.gz
 %{_mandir}/man*/dbus-run-session.1.gz
 %{_mandir}/man*/dbus-run-session.1.gz
-%{_mandir}/man*/dbus-send.1.gz
 %{_mandir}/man1/dbus-test-tool.1.gz
 %{_mandir}/man1/dbus-test-tool.1.gz
+%dir /lib/dbus-1
+%attr(4750,root,dbus) /lib/dbus-1/dbus-daemon-launch-helper
+%if %{with systemd}
+%{_tmpfilesdir}/dbus.conf
+%{_unitdir}/dbus.service
+%{_unitdir}/messagebus.service
+%{_unitdir}/multi-user.target.wants/dbus.service
+%{_unitdir}/sockets.target.wants/dbus.socket
+%{_userunitdir}/dbus.service
+%{_userunitdir}/sockets.target.wants/dbus.socket
+%else
+%dir %{_localstatedir}/run/dbus
+%{_sysconfdir}/rc.d/init.d/*
+%endif
+
+%files tools
+%license COPYING
+/bin/dbus-send
+/bin/dbus-monitor
+/bin/dbus-update-activation-environment
+/bin/dbus-uuidgen
+%{_mandir}/man*/dbus-send.1.gz
+%{_mandir}/man*/dbus-monitor.1.gz
 %{_mandir}/man1/dbus-update-activation-environment.1.gz
 %{_mandir}/man1/dbus-update-activation-environment.1.gz
 %{_mandir}/man*/dbus-uuidgen.1.gz
 %{_mandir}/man*/dbus-uuidgen.1.gz
-%dir %{_datadir}/dbus-1
-%{_datadir}/dbus-1/session.conf
-%{_datadir}/dbus-1/system.conf
-%{_datadir}/dbus-1/services
-%{_datadir}/dbus-1/system-services
-%{_datadir}/dbus-1/interfaces
-%dir /%{_lib}/dbus-1
-%attr(4750,root,dbus) /%{_lib}/dbus-1/dbus-daemon-launch-helper
+
+%files libs
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+/%{_lib}/*dbus-1*.so.*
 
 
 %files devel
 %files devel
 %defattr(-,root,root)
 %defattr(-,root,root)
@@ -321,10 +478,6 @@ fi
 %defattr(-,root,root)
 %defattr(-,root,root)
 %{_pkgdocdir}/*
 %{_pkgdocdir}/*
 %{_datadir}/gtk-doc
 %{_datadir}/gtk-doc
-%exclude %{_pkgdocdir}/AUTHORS
-%exclude %{_pkgdocdir}/ChangeLog
-%exclude %{_pkgdocdir}/NEWS
-%exclude %{_pkgdocdir}/README
 
 
 # compat32
 # compat32
 %if %{build_compat32}
 %if %{build_compat32}
@@ -338,6 +491,20 @@ fi
 %endif
 %endif
 
 
 %changelog
 %changelog
+* Wed Jul 22 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.20-1
+- new upstream release.
+- moved dbus-daemon-launch-helper from /lib64/dbus-1 to /lib/dbus-1.
+
+* Fri Jun 12 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.18-1
+- new upstream release.
+
+* Wed Apr 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.16-2
+- added subpackages: common, daemon, libs and tools.
+
+* Wed Sep 18 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.16-1
+- new upstream release.
+- built for systemd.
+
 * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.12-1
 * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.12.12-1
 - new upstream release.
 - new upstream release.
 - added elogind support.
 - added elogind support.