## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autochangelog
## END: Set by rpmautospec

%global gvc_commit a1ae68ff11dc6156f9c80069194ea39679700f3f
%global libcall_ui_commit 6798b38d4d66d069751151b3e9a202c6de8d7f3c
%global libgmobile_commit f1b50f0f90604e0f125412932dae9b1e08d57ddc

Name:		phosh
Version:	0.32.0
Release:	1%{?dist}
Summary:	Graphical shell for mobile devices
License:	GPLv3+
URL:		https://gitlab.gnome.org/World/Phosh/phosh
Source0:	https://gitlab.gnome.org/World/Phosh/phosh/-/archive/v%{version}/%{name}-v%{version}.tar.gz

# This library doesn't compile into a DSO or ever has had any releases.
# Other projects, such as gnome-shell use it this way.
Source1:	https://gitlab.gnome.org/GNOME/libgnome-volume-control/-/archive/%{gvc_commit}/libgnome-volume-control-%{gvc_commit}.tar.gz

# Similar sutiation as gvc
Source2:	https://gitlab.gnome.org/World/Phosh/libcall-ui/-/archive/%{libcall_ui_commit}/libcall-ui-%{libcall_ui_commit}.tar.gz

Source3:	https://gitlab.gnome.org/guidog/gmobile/-/archive/%{libgmobile_commit}/gmobile-%{libgmobile_commit}.tar.gz

Source4:	phosh

# Needed when not using the OSK package
Source5:	sm.puri.OSK0.desktop

# Tests failing
ExcludeArch:	i686

BuildRequires:	gcc
BuildRequires:	meson
BuildRequires:	cmake
BuildRequires:	pam-devel
BuildRequires:	callaudiod-devel
BuildRequires:	feedbackd-devel >= 0.2.0
BuildRequires:	dbus-daemon
BuildRequires:	pkgconfig(alsa)
BuildRequires:	pkgconfig(evince-document-3.0)
BuildRequires:	pkgconfig(gcr-3) >= 3.7.5
BuildRequires:	pkgconfig(gio-2.0) >= 2.58
BuildRequires:	pkgconfig(gio-unix-2.0) >= 2.58
BuildRequires:	pkgconfig(glib-2.0) >= 2.72.0
BuildRequires:	pkgconfig(gnome-desktop-3.0) >= 3.26
BuildRequires:	pkgconfig(gobject-2.0) >= 2.50.0
BuildRequires:	pkgconfig(gudev-1.0)
BuildRequires:	pkgconfig(gtk+-3.0) >= 3.24.36
BuildRequires:	pkgconfig(gtk4) >= 4.8.3
BuildRequires:	pkgconfig(gtk+-wayland-3.0) >= 3.22
BuildRequires:	pkgconfig(libadwaita-1)
BuildRequires:	pkgconfig(libhandy-1) >= 1.1.90
BuildRequires:	pkgconfig(libnm) >= 1.14
BuildRequires:	pkgconfig(libpulse) >= 2.0
BuildRequires:	pkgconfig(libpulse-mainloop-glib)
BuildRequires:	pkgconfig(libsystemd) >= 241
BuildRequires:	pkgconfig(polkit-agent-1) >= 0.105
BuildRequires:	pkgconfig(upower-glib) >= 0.99.1
BuildRequires:	pkgconfig(wayland-client) >= 1.14
BuildRequires:	pkgconfig(wayland-protocols) >= 1.12
BuildRequires:	pkgconfig(libfeedback-0.0)
BuildRequires:	pkgconfig(libsecret-1)
BuildRequires:	pkgconfig(libecal-2.0)
BuildRequires:	at-spi2-core
BuildRequires:	/usr/bin/xvfb-run
BuildRequires:	/usr/bin/xauth
BuildRequires:	desktop-file-utils
BuildRequires:	git-core
BuildRequires:	systemd-rpm-macros

Requires:	phoc >= 0.25.0
Requires:	iio-sensor-proxy
Requires:	gnome-session
Requires:	gnome-shell
Requires:	lato-fonts
Requires:	hicolor-icon-theme

Recommends:	squeekboard >= 1.21.0
Recommends:	phosh-mobile-settings

%description
Phosh is a simple shell for Wayland compositors speaking the layer-surface
protocol. It currently supports

* a lockscreen
* brightness control and nighlight
* the gcr system-prompter interface
* acting as a polkit auth agent
* enough of org.gnome.Mutter.DisplayConfig to make gnome-settings-daemon happy
* a homebutton that toggles a simple favorites menu
* status icons for battery, wwan and wifi


%prep
%setup -a1 -a2 -a3 -q -n %{name}-v%{version}

rmdir subprojects/gvc
mv libgnome-volume-control-%{gvc_commit} subprojects/gvc

rmdir subprojects/libcall-ui
mv libcall-ui-%{libcall_ui_commit} subprojects/libcall-ui

rmdir subprojects/gmobile
mv gmobile-%{libgmobile_commit} subprojects/gmobile


%build
%meson -Dphoc_tests=disabled -Dsystemd=true
%meson_build

%install
install -d %{buildroot}%{_sysconfdir}/pam.d/
cp %{SOURCE4} %{buildroot}%{_sysconfdir}/pam.d/

install -d %{buildroot}%{_datadir}/applications
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE5}

%meson_install
%find_lang %{name}

%{__install} -Dpm 0644 data/phosh.service %{buildroot}%{_unitdir}/phosh.service

%check
desktop-file-validate \
%{buildroot}%{_datadir}/applications/sm.puri.Phosh.desktop
LC_ALL=C.UTF-8 xvfb-run sh <<'SH'
%meson_test
SH

%files -f %{name}.lang
%{_bindir}/phosh-session
%{_libexecdir}/phosh
%{_libexecdir}/phosh-calendar-server
%{_datadir}/applications/sm.puri.Phosh.desktop
%{_datadir}/glib-2.0/schemas/sm.puri.phosh.gschema.xml
%{_datadir}/glib-2.0/schemas/sm.puri.phosh.enums.xml
%{_datadir}/glib-2.0/schemas/00_sm.puri.Phosh.gschema.override
%{_datadir}/glib-2.0/schemas/sm.puri.phosh.plugins.ticket-box.gschema.xml
%{_datadir}/gnome-session/sessions/phosh.session
%{_datadir}/wayland-sessions/phosh.desktop
%{_datadir}/phosh
%{_sysconfdir}/pam.d/phosh
%{_unitdir}/phosh.service
%{_userunitdir}/gnome-session@phosh.target.d/session.conf
%{_userunitdir}/sm.puri.Phosh.service
%{_userunitdir}/sm.puri.Phosh.target
%{_datadir}/applications/sm.puri.OSK0.desktop
%{_datadir}/xdg-desktop-portal/portals/phosh.portal
%{_datadir}/xdg-desktop-portal/phosh-portals.conf
%{_libdir}/phosh/plugins/libphosh-plugin-calendar.so
%{_libdir}/phosh/plugins/calendar.plugin
%{_libdir}/phosh/plugins/libphosh-plugin-upcoming-events.so
%{_libdir}/phosh/plugins/upcoming-events.plugin
%{_libdir}/phosh/plugins/libphosh-plugin-ticket-box.so
%{_libdir}/phosh/plugins/ticket-box.plugin
%{_datadir}/icons/hicolor/symbolic/apps/sm.puri.Phosh-symbolic.svg
%{_datadir}/dbus-1/services/sm.puri.Phosh.CalendarServer.service
%{_includedir}/phosh/phosh-plugin.h
%{_libdir}/phosh/plugins/emergency-info.plugin
%{_libdir}/phosh/plugins/libphosh-plugin-emergency-info.so
%{_libdir}/phosh/plugins/prefs/libphosh-plugin-prefs-ticket-box.so
%{_libdir}/phosh/plugins/prefs/libphosh-plugin-prefs-emergency-info.so
%{_libdir}/pkgconfig/phosh-plugins.pc

%doc README.md
%license COPYING

%changelog
* Tue Oct 17 2023 torbuntu <torbuntu@fedoraproject.org> - 0.32.0-1
- Uncommitted changes

* Sun Aug 06 2023 torbuntu <torbuntu@fedoraproject.org> - 0.30.0-1
- Update to 0.30.0

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.29.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Sat Jul 15 2023 torbuntu <torbuntu@fedoraproject.org> - 0.29.0-1
- Update to 0.29.0

* Sun Jun 04 2023 torbuntu <torbuntu@fedoraproject.org> - 0.28.0-1
- Update to 0.28.0

* Wed May 17 2023 torbuntu <torbuntu@fedoraproject.org> - 0.27.0-1
- Update to 0.27.0

* Wed Apr 05 2023 torbuntu <torbuntu@fedoraproject.org> - 0.26.0-1
- Update to 0.26.0

* Thu Mar 02 2023 torbuntu <torbuntu@fedoraproject.org> - 0.25.1-1
- Update to 0.25.1

* Thu Feb 02 2023 torbuntu <torbuntu@fedoraproject.org> - 0.24.0-2
- update gmobile to v 0.0.1

* Wed Feb 01 2023 torbuntu <torbuntu@fedoraproject.org> - 0.24.0-1
- Update to phosh 0.24.0

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Dec 28 2022 torbuntu <torbuntu@fedoraproject.org> - 0.23.0-1
- Update to 0.23.0

* Fri Nov 11 2022 torbuntu <torbuntu@fedoraproject.org> - 0.22.0-2
- Requires gnome-shell

* Mon Nov 07 2022 torbuntu <torbuntu@fedoraproject.org> - 0.22.0-1
- Update to 0.22.0

* Wed Sep 28 2022 torbuntu <torbuntu@fedoraproject.org> - 0.21.1-1
- Update to 0.21.1

* Thu Sep 01 2022 torbuntu <torbuntu@fedoraproject.org> - 0.21.0-1
- Update to 0.21.0

* Mon Aug 08 2022 torbuntu <torbuntu@fedoraproject.org> - 0.20.0-1
- Update to 0.20.0

* Sun Jul 31 2022 torbuntu <sorensentor@tuta.io> - 0.20.0~beta3-1
- Update to 0.20.0 beta 3

* Sat Jul 30 2022 torbuntu <torbuntu@fedoraproject.org> - 0.20.0~beta2-3
- Adding patch for polkit versioning

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0~beta2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jun 27 2022 torbuntu <torbuntu@fedoraproject.org> - 0.20.0~beta2-1
- Update to 0.20.0 beta 2

* Mon Jun 27 2022 torbuntu <sorensentor@tuta.io> - 0.20.0~beta1-2
- Test failures on i686

* Mon Jun 27 2022 torbuntu <sorensentor@tuta.io> - 0.20.0~beta1-1
- Update to phosh 0.20.0_beta1

* Fri Mar 25 2022 torbuntu <torbuntu@fedoraproject.org> - 0.17.0-1
- Update to 0.17

* Fri Feb 25 2022 torbuntu <torbuntu@fedoraproject.org> - 0.16.0-1
- Update to 0.16.0

* Wed Jan 26 2022 torbuntu <torbuntu@fedoraproject.org> - 0.15.0-2
- Remove unused patch

* Wed Jan 26 2022 torbuntu <torbuntu@fedoraproject.org> - 0.15.0-1
- Update to 0.15.0

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Mon Dec 13 2021 torbuntu <torbuntu@fedoraproject.org> - 0.14.1-1
- Update to phosh 0.14.1

* Thu Oct 28 2021 torbuntu <sorensentor@tuta.io> - 0.14.0-1
- Update to 0.14.0

* Tue Aug 31 2021 torbuntu <sorensentor@tuta.io> - 0.13.1-1
- Update to 0.13.1

* Thu Aug 26 2021 torbuntu <sorensentor@tuta.io> - 0.13.0-4
- Adding requires phosh-osk-stub

* Thu Aug 26 2021 torbuntu <sorensentor@tuta.io> - 0.13.0-3
- Adding requires phosh-osk-stub

* Thu Aug 26 2021 torbuntu <sorensentor@tuta.io> - 0.13.0-2
- Moving osk-stub to subpackage

* Tue Aug 10 2021 torbuntu <sorensentor@tuta.io> - 0.13.0-1
- Update to 0.13.0

* Fri Jul 23 2021 torbuntu <sorensentor@tuta.io> - 0.12.1-2
- RPMAUTOSPEC: unresolvable merge