e7a87f2
# Run tests in check section
e7a87f2
# disable for bootstrapping
e7a87f2
%bcond_with check
67e0706
e6c032d
# out of memory on armv7hl
e6c032d
%ifarch %{arm}
e6c032d
%global _smp_mflags -j1
e6c032d
%endif
e6c032d
e7a87f2
%global goipath  pkg.deepin.io/dde/api
e7a87f2
%global forgeurl https://github.com/linuxdeepin/dde-api
0b329b0
Version:        5.0.0
0b329b0
%global tag     5.0.0
e7a87f2
e7a87f2
%gometa
e7a87f2
67e0706
Name:           deepin-api
0b329b0
Release:        1%{?dist}
67e0706
Summary:        Go-lang bingding for dde-daemon
67e0706
License:        GPLv3+
e7a87f2
URL:            %{gourl}
e7a87f2
Source0:        %{gosource}
e7a87f2
Patch0:         %{name}_makefile.patch
67e0706
c991917
BuildRequires:  pkgconfig(alsa)
67e0706
BuildRequires:  pkgconfig(cairo-ft)
67e0706
BuildRequires:  pkgconfig(gio-2.0)
67e0706
BuildRequires:  pkgconfig(gtk+-3.0)
67e0706
BuildRequires:  pkgconfig(gdk-pixbuf-xlib-2.0)
67e0706
BuildRequires:  pkgconfig(gudev-1.0)
67e0706
BuildRequires:  pkgconfig(libcanberra)
c991917
BuildRequires:  pkgconfig(libpulse-simple)
67e0706
BuildRequires:  pkgconfig(librsvg-2.0)
67e0706
BuildRequires:  pkgconfig(poppler-glib)
67e0706
BuildRequires:  pkgconfig(polkit-qt5-1)
67e0706
BuildRequires:  pkgconfig(systemd)
67e0706
BuildRequires:  pkgconfig(xfixes)
67e0706
BuildRequires:  pkgconfig(xcursor)
67e0706
BuildRequires:  pkgconfig(x11)
67e0706
BuildRequires:  pkgconfig(xi)
ff95e67
BuildRequires:  deepin-gettext-tools
67e0706
BuildRequires:  deepin-gir-generator
67e0706
BuildRequires:  golang(pkg.deepin.io/lib)
e7a87f2
BuildRequires:  golang(github.com/linuxdeepin/go-x11-client)
f6370a6
BuildRequires:  golang(github.com/linuxdeepin/go-dbus-factory/org.bluez)
67e0706
BuildRequires:  golang(github.com/BurntSushi/xgb)
67e0706
BuildRequires:  golang(github.com/BurntSushi/xgbutil)
67e0706
BuildRequires:  golang(github.com/disintegration/imaging)
c991917
BuildRequires:  golang(github.com/cryptix/wav)
f6370a6
BuildRequires:  golang(github.com/fogleman/gg)
e7a87f2
BuildRequires:  golang(github.com/nfnt/resize)
67e0706
BuildRequires:  golang(gopkg.in/alecthomas/kingpin.v2)
67e0706
%{?systemd_requires}
67e0706
Requires:       deepin-desktop-base
67e0706
Requires:       rfkill
077bc92
Requires(pre):  shadow-utils
67e0706
67e0706
%description
e7a87f2
%{summary}.
67e0706
67e0706
%package -n golang-%{name}-devel
67e0706
Summary:        %{summary}
e7a87f2
BuildArch:      noarch
67e0706
67e0706
%description -n golang-%{name}-devel
67e0706
%{summary}.
67e0706
67e0706
This package contains library source intended for
67e0706
building other packages which use import path with
e7a87f2
%{goipath} prefix.
67e0706
67e0706
%prep
e7a87f2
%forgeautosetup -p1
67e0706
67e0706
sed -i 's|/usr/lib|%{_libexecdir}|' misc/*services/*.service \
67e0706
    misc/systemd/system/deepin-shutdown-sound.service \
67e0706
    lunar-calendar/main.go \
5f17903
    theme_thumb/gtk/gtk.go \
67e0706
    thumbnails/gtk/gtk.go
67e0706
e7a87f2
sed -i 's|PREFIX}${libdir|LIBDIR|; s|libdir|LIBDIR|; s|boot/grub/|boot/grub2/|' \
e7a87f2
    Makefile adjust-grub-theme/main.go
67e0706
67e0706
%build
e7a87f2
%gobuildroot
e7a87f2
for cmd in $(make binaries); do
e7a87f2
    %gobuild -o _bin/$cmd %{goipath}/$cmd
e7a87f2
done
e7a87f2
%make_build
67e0706
67e0706
%install
e7a87f2
rm -rf $(make binaries)
e7a87f2
gofiles=$(find $(make libraries) %{?gofindfilter} -print)
e7a87f2
%goinstall $gofiles
67e0706
%make_install SYSTEMD_SERVICE_DIR="%{_unitdir}" LIBDIR="%{_libexecdir}"
077bc92
# HOME directory for user deepin-sound-player
077bc92
mkdir -p %{buildroot}%{_sharedstatedir}/deepin-sound-player
67e0706
e7a87f2
%if %{with check}
e7a87f2
%check
e7a87f2
%gochecks
e7a87f2
%endif
e7a87f2
077bc92
%pre
077bc92
getent group deepin-sound-player >/dev/null || groupadd -r deepin-sound-player
077bc92
getent passwd deepin-sound-player >/dev/null || \
077bc92
    useradd -r -g deepin-sound-player -d %{_sharedstatedir}/deepin-sound-player\
077bc92
    -s /sbin/nologin \
077bc92
    -c "User of com.deepin.api.SoundThemePlayer.service" deepin-sound-player
077bc92
exit 0
077bc92
67e0706
%post
67e0706
%systemd_post deepin-shutdown-sound.service
67e0706
67e0706
%preun
67e0706
%systemd_preun deepin-shutdown-sound.service
67e0706
67e0706
%postun
67e0706
%systemd_postun_with_restart deepin-shutdown-sound.service
67e0706
67e0706
%files
67e0706
%doc README.md
67e0706
%license LICENSE
e7a87f2
/boot/grub2/themes/deepin-fallback/
bb68b62
%{_bindir}/dde-open
67e0706
%{_libexecdir}/%{name}/
67e0706
%{_unitdir}/*.service
67e0706
%{_datadir}/dbus-1/services/*.service
67e0706
%{_datadir}/dbus-1/system-services/*.service
67e0706
%{_datadir}/dbus-1/system.d/*.conf
67e0706
%{_datadir}/icons/hicolor/*/actions/*
2390bac
%{_datadir}/dde-api/data/pkg_depends
f6370a6
%{_datadir}/dde-api/data/grub-themes/
67e0706
%{_polkit_qt_policydir}/com.deepin.api.locale-helper.policy
f6370a6
%{_polkit_qt_policydir}/com.deepin.api.device.unblock-bluetooth-devices.policy
f6370a6
%{_var}/lib/polkit-1/localauthority/10-vendor.d/com.deepin.api.device.pkla
077bc92
%attr(-, deepin-sound-player, deepin-sound-player) %{_sharedstatedir}/deepin-sound-player
67e0706
e7a87f2
%files -n golang-%{name}-devel -f devel.file-list
67e0706
67e0706
%changelog
0b329b0
* Mon Aug  5 2019 Robin Lee <cheeselee@fedoraproject.org> - 5.0.0-1
0b329b0
- Release 5.0.0
0b329b0
0ed3e06
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.17.0-3
0ed3e06
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0ed3e06
b8bed53
* Tue May 28 2019 Robin Lee <cheeselee@fedoraproject.org> - 3.17.0-2
b8bed53
- Fix a security issue
b8bed53
077bc92
* Tue Feb 26 2019 mosquito <sensor.wen@gmail.com> - 3.17.0-1
077bc92
- Update to 3.17.0
077bc92
31df5fd
* Tue Feb 19 2019 Kalev Lember <klember@redhat.com> - 3.16.0-2
31df5fd
- Rebuilt against fixed atk (#1626575)
31df5fd
5f17903
* Thu Jan 31 2019 mosquito <sensor.wen@gmail.com> - 3.16.0-1
5f17903
- Update to 3.16.0
5f17903
077bc92
* Thu Jan 31 2019 Robin Lee <cheeselee@fedoraproject.org> - 3.12.0-3
077bc92
- Create deepin-sound-player user
077bc92
5f17903
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.0-2
cf805ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
cf805ae
e7a87f2
* Wed Dec 12 2018 mosquito <sensor.wen@gmail.com> - 3.12.0-1
e7a87f2
- Update to 3.12.0
e7a87f2
c19299c
* Thu Nov 29 2018 mosquito <sensor.wen@gmail.com> - 3.10.0-1
c19299c
- Update to 3.10.0
c19299c
f271307
* Wed Nov 21 2018 mosquito <sensor.wen@gmail.com> - 3.9.0-1
f271307
- Update to 3.9.0
f271307
f6370a6
* Fri Nov  9 2018 mosquito <sensor.wen@gmail.com> - 3.5.0-1
f6370a6
- Update to 3.5.0
f6370a6
f04e4d7
* Sat Aug 25 2018 mosquito <sensor.wen@gmail.com> - 3.1.26-1
f04e4d7
- Update to 3.1.26
f6370a6
- build error with gobject-introspection 1.58 by gir-generator
f6370a6
  https://github.com/linuxdeepin/developer-center/issues/604
bb68b62
35860cb
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 3.1.20-3
35860cb
- Rebuild with fixed binutils
35860cb
80c0e6b
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.20-2
80c0e6b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
80c0e6b
2390bac
* Fri Feb 16 2018 mosquito <sensor.wen@gmail.com> - 3.1.20-1
2390bac
- Update to 3.1.20
2390bac
8fff501
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.18.1-3
8fff501
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
8fff501
367709e
* Thu Jan 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.1.18.1-2
367709e
- Remove obsolete scriptlets
367709e
c991917
* Thu Dec 21 2017 mosquito <sensor.wen@gmail.com> - 3.1.18.1-1
c991917
- Update to 3.1.18.1
c991917
ff95e67
* Wed Nov 15 2017 mosquito <sensor.wen@gmail.com> - 3.1.17-1
ff95e67
- Update to 3.1.17
ff95e67
ff95e67
* Fri Oct 27 2017 mosquito <sensor.wen@gmail.com> - 3.1.15-1
ff95e67
- Update to 3.1.15
ff95e67
e6c032d
* Mon Oct 16 2017 mosquito <sensor.wen@gmail.com> - 3.1.14-2
e6c032d
- Fix out of memory on armv7hl
e6c032d
4086dc0
* Sat Oct 14 2017 mosquito <sensor.wen@gmail.com> - 3.1.14-1
4086dc0
- Update to 3.1.14
4086dc0
67e0706
* Sat Aug 26 2017 mosquito <sensor.wen@gmail.com> - 3.1.13-1
67e0706
- Update to 3.1.13
67e0706
67e0706
* Tue Aug  8 2017 mosquito <sensor.wen@gmail.com> - 3.1.11-2
67e0706
- Rename deepin-api-devel to golang-deepin-api-devel
67e0706
67e0706
* Tue Aug  1 2017 mosquito <sensor.wen@gmail.com> - 3.1.11-1
67e0706
- Update to 3.1.11
67e0706
67e0706
* Fri Jul 14 2017 mosquito <sensor.wen@gmail.com> - 3.1.10-1.git79125e7
67e0706
- Update to 3.1.10
67e0706
67e0706
* Fri May 19 2017 mosquito <sensor.wen@gmail.com> - 3.1.7-1.git4c8e030
67e0706
- Update to 3.1.7
67e0706
67e0706
* Sun Feb 26 2017 mosquito <sensor.wen@gmail.com> - 3.1.2-1.gitf93dbd7
67e0706
- Update to 3.1.2
67e0706
67e0706
* Tue Jan 17 2017 mosquito <sensor.wen@gmail.com> - 3.0.16.1-1.gitcfdb295
67e0706
- Update to 3.0.16.1
67e0706
67e0706
* Mon Jan 16 2017 Jaroslav <cz.guardian@gmail.com> Stepanek 3.0.16-1
67e0706
- Update to version 3.0.16
67e0706
67e0706
* Sun Dec 18 2016 Jaroslav <cz.guardian@gmail.com> Stepanek 3.0.15-1
67e0706
- Update to version 3.0.15
67e0706
67e0706
* Wed Dec 07 2016 Jaroslav <cz.guardian@gmail.com> Stepanek 3.0.14-2
67e0706
- Changed compilation procedure
67e0706
67e0706
* Wed Sep 28 2016 Jaroslav <cz.guardian@gmail.com> Stepanek 3.0.14-1
67e0706
- Initial package build