File deepin-api.spec of Package deepin-api
#
# spec file for package deepin-api
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%define repo dde-api
%define import_path pkg.deepin.io/dde/api
Name: deepin-api
Version: 3.1.22
Release: 0
Summary: Go-lang bingding for dde-daemon
License: GPL-3.0+
URL: https://github.com/linuxdeepin/dde-api
Source0: https://github.com/linuxdeepin/dde-api/archive/%{version}/%{repo}-%{version}.tar.gz
Source99: %{name}-rpmlintrc
Group: Development/Languages/Golang
BuildRequires: fdupes
BuildRequires: golang-gir-generator-source
BuildRequires: golang-gir-generator
BuildRequires: deepin-gettext-tools
BuildRequires: golang-packaging
BuildRequires: golang-dbus-factory
BuildRequires: golang-go-lib
BuildRequires: golang-github-burntsushi-xgb
BuildRequires: golang-github-burntsushi-xgbutil
BuildRequires: golang-github-disintegration-imaging
BuildRequires: golang-github-alecthomas-kingpin
BuildRequires: golang-github-nfnt-resize
BuildRequires: golang-gopkgin-check
BuildRequires: golang-org-x-text
BuildRequires: golang-org-x-image >= 1.0.3+git20161212
BuildRequires: pkgconfig(cairo-ft)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(gdk-pixbuf-xlib-2.0)
BuildRequires: pkgconfig(gudev-1.0)
BuildRequires: pkgconfig(libcanberra)
BuildRequires: pkgconfig(librsvg-2.0)
BuildRequires: pkgconfig(poppler-glib)
BuildRequires: pkgconfig(polkit-qt5-1)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(xfixes)
BuildRequires: pkgconfig(xcursor)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xi)
BuildRequires: pkgconfig(libpulse-simple)
BuildRequires: pkgconfig(alsa)
BuildRequires: update-desktop-files
BuildRequires: deepin-sound-theme
Requires: deepin-desktop-base
Requires: rfkill
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{go_provides}
%{?systemd_requires}
%description
The deepin-api is DDE API provides some dbus interfaces that is used for screen
zone detecting, thumbnail generating, sound playing, etc.
%package -n golang-%{name}-source
Summary: %{summary}
%if 0%{?suse_version} < 1330
Requires: golang-github-burntsushi-xgb
Requires: golang-github-disintegration-imaging
Requires: golang-go-lib
Requires: golang-dbus-factory
Requires: golang(gir/gio-2.0)
Requires: golang(gir/glib-2.0)
%endif
BuildArch: noarch
%description -n golang-%{name}-source
The deepin-api is DDE API provides some dbus interfaces that is used for screen
zone detecting, thumbnail generating, sound playing, etc.
This package contains library source intended forbuilding other packages which
use import path with pkg.deepin.io/dde/api prefix.
%prep
%setup -q -n %{repo}-%{version}
sed -i 's|PREFIX}${libdir|LIBDIR|g; s|libdir|LIBDIR|g; s|go build|go build -buildmode=pie|g' Makefile
%build
%goprep %{import_path}
echo %{import_path} > /tmp/importpath.txt
make %{?_smp_mflags}
%install
%make_install \
SYSTEMD_SERVICE_DIR="%{_unitdir}" \
LIBDIR="%{_libexecdir}" \
GOSITE_DIR="%{go_contribsrcdir}/../"
install -d %{buildroot}%{_sbindir}
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcdeepin-shutdown-sound
%gofilelist
%fdupes %{buildroot}
%pre
%service_add_pre deepin-shutdown-sound.service
%post
%icon_theme_cache_post
%service_add_post deepin-shutdown-sound.service
%preun
%service_del_preun deepin-shutdown-sound.service
%postun
%icon_theme_cache_post
%service_del_postun deepin-shutdown-sound.service
%posttrans
%icon_theme_cache_post
%files
%defattr(-,root,root,-)
%doc README.md LICENSE
%{_libexecdir}/%{name}/
%{_sbindir}/rcdeepin-shutdown-sound
%{_unitdir}/*.service
%{_datadir}/dde-api
%{_datadir}/dbus-1/services/*.service
%{_datadir}/dbus-1/system-services/*.service
%dir %{_datadir}/dbus-1/system.d/
%{_datadir}/dbus-1/system.d/*.conf
%{_datadir}/icons/hicolor/*/actions/*
%{_datadir}/polkit-1/actions/com.deepin.api.locale-helper.policy
%files -n golang-%{name}-source -f file.lst
%defattr(-,root,root,-)
%changelog