File upstart.spec of Package upstart

#
# spec file for package upstart
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define soname  libupstart
%define sover   1
Name:           upstart
Version:        1.13.2
Release:        0
Summary:        An event-driven init system
License:        GPL-2.0-only
Group:          System/Daemons
URL:            https://upstart.ubuntu.com/
Source:         https://upstart.ubuntu.com/download/%{version}/%{name}-%{version}.tar.gz
Source1:        https://upstart.ubuntu.com/download/%{version}/%{name}-%{version}.tar.gz.asc
Source2:        %{name}.keyring
Source3:        %{name}-xinitrc.sh
Source4:        %{name}.cron
Source5:        baselibs.conf
# PATCH-FIX-OPENSUSE upstart-fix-includes.patch -- Add missing includes.
Patch0:         upstart-fix-includes.patch
BuildRequires:  fdupes
BuildRequires:  gettext
BuildRequires:  gobject-introspection-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(dbus-1) >= 1.2.16
BuildRequires:  pkgconfig(dconf) >= 0.14
BuildRequires:  pkgconfig(gio-2.0) >= 2.36
BuildRequires:  pkgconfig(json) >= 0.10
BuildRequires:  pkgconfig(libcgmanager)
BuildRequires:  pkgconfig(libnih) >= 1.0.2
BuildRequires:  pkgconfig(libnih-dbus) >= 1.0.0
BuildRequires:  pkgconfig(libudev) >= 146
Requires:       cron
Recommends:     %{name}-lang
Suggests:       graphviz
Suggests:       python3
Suggests:       upstart-monitor

%description
upstart is an event-based replacement for the /sbin/init daemon
which handles starting of tasks and services during boot, stopping
them during shutdown and supervising them while the system is
running.

This package provides all essential upstart components, sufficient
for running user sessions managed by upstart.

%lang_package

%package dconf-bridge
Summary:        DConf bridge for upstart
Group:          System/Daemons
Requires:       upstart >= 1.10

%description dconf-bridge
This package contains a bridge that allows upstart jobs to react
when DConf/GSettings keys are changed.

%package -n %{soname}%{sover}
Summary:        Upstart Client Library
Group:          System/Libraries

%description -n %{soname}%{sover}
The libupstart library allows access to services provided by the
upstart init daemon without having to use low-level D-Bus calls.

This package contains the shared library.

%package -n %{soname}-devel
Summary:        Development files for libupstart
Group:          Development/Libraries/C and C++
Requires:       %{soname}%{sover} >= %{version}
Requires:       pkgconfig

%description -n %{soname}-devel
The libupstart library allows access to services provided by the
upstart init daemon without having to use low-level D-Bus calls.

This package contains the static library and C header files which
are needed for developing software using libupstart.

%package monitor
Summary:        Event monitor for upstart
Group:          System/Monitoring
Requires:       dbus-1-python3
Requires:       python3-gobject
Requires:       python3-gobject-Gdk
Requires:       upstart >= 1.7
BuildArch:      noarch

%description monitor
This package contains a utility that may be run both as a
command-line tool or as a graphical one that displays upstart
events as they are emitted. It is useful for observing system
changes and for determining appropriate events for new jobs.

%prep
%autosetup -p1
cp %{SOURCE3} %{name}-xinitrc.sh
cp %{SOURCE4} %{name}.cron

%build
%configure \
  --disable-static                              \
  --disable-silent-rules                        \
  --sbindir=/sbin                               \
  --program-transform-name="s/^init\$/%{name}/"
%make_build

%install
%make_install \
  pkgconfigdir=%{_libdir}/pkgconfig

chmod a+x %{buildroot}%{_bindir}/init-checkconf

install -Dm 0644 %{name}-xinitrc.sh \
  %{buildroot}%{_sysconfdir}/X11/xinit/xinitrc.d/%{name}.sh
install -Dm 0755 %{name}.cron \
  %{buildroot}%{_sysconfdir}/cron.daily/%{name}

# Don't package upstart-sysvinit: only the "user session" is supported.
rm %{buildroot}/sbin/{halt,poweroff,reboot,runlevel,shutdown,telinit}
rm %{buildroot}%{_mandir}/man5/inittab.5
rm %{buildroot}%{_mandir}/man7/runlevel.7
rm %{buildroot}%{_mandir}/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8

find %{buildroot} -type f -name "*.la" -delete -print
%suse_update_desktop_file -r %{name}-monitor System Monitor

%fdupes %{buildroot}%{_datadir}/
%find_lang %{name}

%post -n %{soname}%{sover} -p /sbin/ldconfig

%postun -n %{soname}%{sover} -p /sbin/ldconfig

%files
%license COPYING
%doc AUTHORS NEWS README
%dir %{_sysconfdir}/X11/xinit/
%dir %{_sysconfdir}/X11/xinit/xinitrc.d/
%config %{_sysconfdir}/X11/xinit/xinitrc.d/%{name}.sh
%dir %{_sysconfdir}/cron.daily/
%{_sysconfdir}/cron.daily/%{name}
%config %{_sysconfdir}/init/
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/Upstart.conf
/sbin/%{name}-*-bridge
%exclude /sbin/%{name}-dconf-bridge
/sbin/%{name}
/sbin/initctl
/sbin/reload
/sbin/start
/sbin/status
/sbin/stop
/sbin/restart
%{_bindir}/init-checkconf
%{_bindir}/initctl2dot
%{_mandir}/man5/%{name}.5%{?ext_man}
%{_mandir}/man7/%{name}.7%{?ext_man}
%{_mandir}/man7/*-device-added.7%{?ext_man}
%{_mandir}/man7/*-device-removed.7%{?ext_man}
%{_mandir}/man7/*-event.7%{?ext_man}
%exclude %{_mandir}/man7/dconf-event.7%{?ext_man}
%{_mandir}/man7/control-alt-delete.7%{?ext_man}
%{_mandir}/man7/keyboard-request.7%{?ext_man}
%{_mandir}/man7/power-status-changed.7%{?ext_man}
%{_mandir}/man7/session-end.7%{?ext_man}
%{_mandir}/man7/started.7%{?ext_man}
%{_mandir}/man7/starting.7%{?ext_man}
%{_mandir}/man7/startup.7%{?ext_man}
%{_mandir}/man7/stopped.7%{?ext_man}
%{_mandir}/man7/stopping.7%{?ext_man}
%{_mandir}/man8/%{name}.8%{?ext_man}
%{_mandir}/man8/%{name}-*-bridge.8%{?ext_man}
%exclude %{_mandir}/man8/%{name}-dconf-bridge.8%{?ext_man}
%{_mandir}/man8/init-checkconf.8%{?ext_man}
%{_mandir}/man8/initctl.8%{?ext_man}
%{_mandir}/man8/initctl2dot.8%{?ext_man}
%{_mandir}/man8/reload.8%{?ext_man}
%{_mandir}/man8/restart.8%{?ext_man}
%{_mandir}/man8/start.8%{?ext_man}
%{_mandir}/man8/status.8%{?ext_man}
%{_mandir}/man8/stop.8%{?ext_man}
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/sessions/
%exclude %{_datadir}/%{name}/sessions/%{name}-dconf-bridge.conf

%files lang -f %{name}.lang

%files dconf-bridge
/sbin/%{name}-dconf-bridge
%{_datadir}/%{name}/sessions/%{name}-dconf-bridge.conf
%{_mandir}/man8/%{name}-dconf-bridge.8%{?ext_man}
%{_mandir}/man7/dconf-event.7%{?ext_man}

%files -n %{soname}%{sover}
%{_libdir}/%{soname}.so.%{sover}*

%files -n %{soname}-devel
%{_includedir}/%{name}/
%{_includedir}/%{name}.h
%{_libdir}/%{soname}.so
%{_libdir}/pkgconfig/%{soname}.pc

%files monitor
%{_bindir}/%{name}-monitor
%dir %{_datadir}/%{name}/icons/
%{_datadir}/%{name}/icons/%{name}-monitor.svg
%{_datadir}/applications/%{name}-monitor.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}-monitor.svg
%{_mandir}/man8/%{name}-monitor.8%{?ext_man}

%changelog
openSUSE Build Service is sponsored by