File libindicator.spec of Package libindicator

#
# spec file for package libindicator
#
# 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/
#


%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "gtk2"
%global gtkver 2
%endif
%if "%{flavor}" == "gtk3"
%global psuffix 3
%global gtkver 3
%endif
%define sover   7
%define _version 16.10.0+18.04.20180321.1
Name:           libindicator
Version:        16.10.0~bzr20180321.539
Release:        0
Summary:        Panel indicator applet libraries
License:        GPL-3.0-only
Group:          System/GUI/Other
URL:            https://launchpad.net/libindicator
Source:         https://launchpad.net/ubuntu/+archive/primary/+files/%{name}_%{_version}.orig.tar.gz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  fdupes
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(systemd)
%if "%{flavor}" == ""
ExclusiveArch:  do-not-build
%endif
%if "%{flavor}" == "gtk2"
BuildRequires:  pkgconfig(gtk+-2.0)
%else
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libido3-0.1)
%endif

%description
This library contains information to build indicators to go into
the indicator applet.

%package -n libindicator%{?psuffix:%{psuffix}-}%{sover}
Summary:        Panel indicator applet library
Group:          System/Libraries

%description -n libindicator%{?psuffix:%{psuffix}-}%{sover}
This package provides the libraries required to build indicators
and to go into the indicator applet.

%package -n libindicator%{?psuffix}-devel
Summary:        Development files for the Panel indicator applet
Group:          Development/Libraries/Other
Requires:       libindicator%{?psuffix:%{psuffix}-}%{sover} = %{version}

%description -n libindicator%{?psuffix}-devel
This package provides the development files required to build
indicators and to go into the indicator applet.

%package -n indicator-common
Summary:        Indicator shared files
Group:          System/Libraries

%description -n indicator-common
A package that has files needed to work with the indicators. This
includes the systemd indicators-pre.target.

%prep
%autosetup -p1 -c

%build
export CFLAGS="%{optflags} -Wno-error"
autoreconf -vfi
%configure \
  --disable-static \
  --with-gtk=%{gtkver}
%make_build

%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print

%if "%{flavor}" == "gtk2"
# To avoid conflicting with libindicator3-devel
rm -r %{buildroot}%{_datadir}/libindicator/
%endif

# This dummy indicator is fairly useless, it is not shipped in Ubuntu.
rm %{buildroot}%{_libdir}/libdummy-indicator*.so

%post -n libindicator%{?psuffix:%{psuffix}-}%{sover} -p /sbin/ldconfig

%postun -n libindicator%{?psuffix:%{psuffix}-}%{sover} -p /sbin/ldconfig

%files -n libindicator%{?psuffix:%{psuffix}-}%{sover}
%license COPYING
%doc AUTHORS NEWS
%{_libdir}/libindicator%{?psuffix}.so.%{sover}*

%files -n libindicator%{?psuffix}-devel
%{_includedir}/libindicator%{?psuffix}-0.4/
%{_libdir}/libindicator%{?psuffix}.so
%{_libdir}/pkgconfig/indicator%{?psuffix}-0.4.pc
%if "%{flavor}" != "gtk2"
%{_libexecdir}/indicator-loader%{?psuffix}
%{_datadir}/libindicator/
%endif

%files -n indicator-common
%{_prefix}/lib/systemd/user/indicators-pre.target

%changelog
openSUSE Build Service is sponsored by