Blob Blame Raw
# TODO, maybe later
# move test service into nuvola-app-test subpackage.
# package the engine.io.js separately

%global unique_name eu.tiliado.Nuvola

Name:           nuvolaruntime
Version:        4.5.0
Release:        5%{?dist}
# Nuvola itself is BSD licensed, but the bundled engineio-soup content is MIT.
License:        BSD and MIT
Summary:        Tight integration of web apps with your desktop
URL:            https://github.com/tiliado/nuvolaruntime/
Source:         https://github.com/tiliado/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         0001-Revert-Check-whether-VA-API-driver-is-installed.patch
Patch1:         0002-Revert-Check-whether-VDPAU-driver-is-installed.patch

# Build is broken on ppc64le 
#if 0%{?fedora} >= 26
#ExcludeArch:    ppc64le
#endif

BuildRequires:  gcc
BuildRequires:  desktop-file-utils
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(dioriteglib4) >= 4.5.0
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(libsoup-2.4)
BuildRequires:  pkgconfig(libsecret-1)
BuildRequires:  %{_bindir}/valac
BuildRequires:  %{_bindir}/waf-3
BuildRequires:  pkgconfig(uuid)
BuildRequires:  pkgconfig(webkit2gtk-4.0)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  libappstream-glib
BuildRequires:  libdrm-devel
BuildRequires:  python3-pyparsing
# For directory ownership
Requires:       dbus
Requires:       diorite >= 4.4.0
Provides:       bundled(engine.io) = 1.6.9
Recommends:     gstreamer1-plugin-mpg123

# obsoletion of nuvolaplayer
Obsoletes: nuvolaplayer <= 3.1.3-7

%description
Nuvola Apps is a runtime for semi-sandboxed web apps providing more native
user experience and tighter integration with Linux desktop environments than
usual web browsers can offer. It tries to feel and look like a native
application as much as possible. Nuvola mostly specializes on music
streaming web apps (e.g. Google Play Music, Spotify, Amazon Music, Deezer, and
more), but progress is being made to support generic web apps
(e.g. Google Calendar, Google Keep, etc.).

%package        devel
Summary:        Development package for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
This package contains development files for %{name}


%prep
%setup -q
%patch0 -p1
%patch1 -p1

rm ./waf
rm -rf ./.waf
rm branding/default.json

# libengineio.so is not a bundled library in the meaning as a copy of an
# independent library. It just hasn't been separated into and independent
# library yet. Engineio is used in some experimental features which are not
# built by default yet but that may change in the future.
# So we do not ship the library ATM.
# Ticket: https://github.com/tiliado/nuvolaplayer/issues/334

# web_apps/test is a test service to test various features of Nuvola
# (nuvola -D -a test).
# It may be helpful when you need provide your users with support.
# It might go to devel subpackage though.
# https://github.com/tiliado/nuvolaplayer/issues/334

# The mp3 file is used to check that gstreamer can play mp3 files.
# It is done on Nuvola's start-up automatically.
# The mp3 file is available, in the Format support dialog.
# The programm does not crash, if the mp3 file is not delivered with,
# but format support check does not work then.
# Ticket: https://github.com/tiliado/nuvolaplayer/issues/334

%build
waf configure --prefix=%{_prefix} \
              --libdir=%{_libdir}   \
              --noappindicator      \
              --nounity

waf build --prefix=%{_prefix} \
            --libdir=%{_libdir}

%install
waf install --prefix=%{_prefix} \
              --libdir=%{_libdir} \
              --destdir=%{buildroot}

# The unique name has been changed to `eu.tiliado.Nuvola` and \
# most of the resources (e.g. icons) use this name.
desktop-file-install                                    \
--add-category="AudioVideo"                             \
--delete-original                                       \
--dir=%{buildroot}%{_datadir}/applications              \
%{buildroot}%{_datadir}/applications/%{unique_name}.desktop

rm %{buildroot}%{_libdir}/libengineio.so
rm %{buildroot}%{_includedir}/%{name}-1.0/engineio.h
rm %{buildroot}%{_datadir}/vala/vapi/engineio.*

%check
# test suite
LD_LIBRARY_PATH=./build ./build/run-nuvolaruntime-tests
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml

%post
/sbin/ldconfig
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
/sbin/ldconfig
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files
%doc README.md
%license LICENSE
%{_bindir}/nuvola*
%{_datadir}/applications/%{unique_name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{unique_name}.*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/audio/
%{_datadir}/%{name}/js/
%{_datadir}/%{name}/welcome.xml
%{_datadir}/%{name}/www/
%dir %{_datadir}/metainfo
%{_datadir}/*/%{unique_name}.appdata.xml
%{_libdir}/lib%{name}-*.so
%{_libdir}/%{name}/
%dir %{_datadir}/dbus-1/services
%{_datadir}/dbus-1/services/eu.tiliado.NuvolaOse.service

%files devel
%dir %{_includedir}/%{name}-1.0
%{_includedir}/%{name}-1.0/*.h
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/%{name}-*
%{_datadir}/%{name}/web_apps/test/
%{_datadir}/%{name}/web_apps/testmse/
%dir %{_datadir}/%{name}/web_apps
%{_libdir}/pkgconfig/%{name}-*.pc


%changelog
* Mon Jul 31 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.5.0-5
- include ppc64le again

* Fri Jul 28 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.5.0-4
- exclude ppc64le due build problem

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon Jul 24 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.5.0-2
- include ppc64le again

* Thu Jul 20 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.5.0-1
- update to 4.5.0
- Add 0001-Revert-Check-whether-VA-API-driver-is-installed.patch
- Add 0002-Revert-Check-whether-VDPAU-driver-is-installed.patch
- dropped %%{name}-wscript.patch
- add if condition due ppc64le build problem

* Tue Jun 06 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.4.0-3
- delete space at EOL
- add configure option --noappindicator
- remove BR  pkgconfig(appindicator3-0.1)
- shorten description
- add test suite

* Mon Jun 05 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.4.0-2
- remove Trademarks in Description
- add Obsoletes: nuvolaplayer <= 3.1.3-7

* Fri Jun 02 2017 Martin Gansser <martinkg@fedoraproject.org> - 4.4.0-1
- update to 4.4.0
- add BR pkgconfig(appindicator3-0.1)
- rename package from nuvolaplayer to nuvolaruntime

* Mon May 15 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.3-6
- add version to bundled engine.io

* Fri May 12 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.3-5
- add clarifying comment above the license tag
- add Provides: bundled(engine.io)

* Thu May 11 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.3-4
- removed validation of .desktop file
- add validation of AppData
- add BR libappstream-glib
- remove BR xorg-x11-utils
- remove BR xorg-x11-server-Xvfb
- move the note about the test suite into the %%check section
- changed license field to BSD
- use %%setup -q
- remove %%{buildroot}%%{_libdir}/libengineio.so
- remove %%{buildroot}%%{_includedir}/%%{name}3-1.0/engineio.h
- remove %%{buildroot}%%{_datadir}/vala/vapi/engineio.*
- add Recommends: gstreamer1-plugin-mpg123

* Thu May 04 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.3-3
- remove unneeded build dependencies
- sqlite dependency is not conditional
- add BR gcc
- moved %%{_datadir}/vala/vapi/* to -devel subpackage
- fix directory ownership
- %%exclude %%{_libdir}/libengineio.so
- add MIT license

* Tue May 02 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.3-2
- add BR pkgconfig(sqlite3) for fedora > 26
- dropped BR pkgconfig(unity)
- add --nounity configure flag

* Mon May 01 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.3-1
- Update to 3.1.3-1
- Add BR pkgconfig(unity)
- Add RR %%{_bindir}/waf-3

* Fri Apr 21 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.2-2
- Use virtual provides for BR
- Add BR libuuid-devel
- Add BR %%{_bindir}/waf
- Add BR %%{_bindir}/valac
- Use system waf installation
- Add %%{name}-wscript.patch
- Add %%{name}-wscript-rawhide.patch

* Sun Apr 16 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.1.2-1
- Update to 3.1.2-1

* Tue Jan 17 2017 Martin Gansser <martinkg@fedoraproject.org> - 3.0.4-1
- Update to 3.0.4
- use commit revision in source url
- added BR diorite-devel
- added BR libarchive-devel
- added BR webkitgtk4-devel

* Wed Oct 15 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.3-3
- fixed 'if' conditions
- added configure flag '--debug-symbols' to build with debug infos

* Tue Oct 14 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.3-2
- added 'if' conditions to fix f22 build

* Sun Sep 07 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.3-1
- Update to 2.4.3
- reenabled lastfm build, because it's fixed in new release

* Thu Sep 04 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.2-5
- added ldconfig back again due of Packaging:Guidelines#Shared_Libraries

* Wed Sep 03 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.2-4
- added license files described in license tag
- removed ldconfig

* Sat Aug 30 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.2-3
- dropped BR unique
- disabled lastfm build

* Fri Aug 29 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.2-2
- added BR libsoup

* Fri Jul 18 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.2-1
- Update to 2.4.2

* Tue Jul 08 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.1-1
- Update to 2.4.1

* Sun Jun 01 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.4.0-1
- Update to 2.4.0

* Thu May 29 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.3-2
- replaced %%RPM_BUILD_ROOT by %%{buildroot}
- delete BR bzr
- added /sbin/ldconfig calls in %%post and %%postun

* Sun May 04 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.3-1
- Update to 2.3.3

* Tue Apr 15 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.2-2
- added  patch to build with valac 0.24
- changed to waf-1.7.16

* Wed Mar 26 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.2-1
- Update to 2.3.2

* Sat Mar 22 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.1-3
- added bzr requirement

* Sat Mar 22 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.1-2
- added vala-devel requirement

* Fri Mar 21 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.1-1
- Update to 2.3.1
- removed requirement vala-compat-devel

* Thu Feb 13 2014 Martin Gansser <martinkg@fedoraproject.org> - 2.3.0-1
- Update to 2.3.0
- Added patch to use revision 805
- changed waf version in %%prep section

* Sun Dec 15 2013 Martin Gansser <martinkg@fedoraproject.org> - 2.2.0-7
- add missing license type

* Sun Dec 15 2013 Martin Gansser <martinkg@fedoraproject.org> - 2.2.0-6
- change %%description
- remove google-music-frame because it's not provided.
- correct %%RPM_BUILD_ROOT path
- add Xvfb to build requirement
- remove skip-tests build option
- add build option xvfb-run -a to build option

* Wed Dec 11 2013 Martin Gansser <martinkg@fedoraproject.org> - 2.2.0-5
- cleanup build requires

* Sun Dec 08 2013 Martin Gansser <martinkg@fedoraproject.org> - 2.2.0-4
- remove java requirement
- add tsocks as a run-time requirement
- remove exclusion of libnuvolaplayerprivate.so

* Sun Dec 08 2013 Leigh Scott <leigh123linux@googlemail.com> - 2.2.0-3
- fix directory ownership
- add requires control-center-filesystem
- add requires java-1.7.0-openjdk
- fix dangling-relative-symlink

* Sat Dec 07 2013 Martin Gansser <martinkg@fedoraproject.org> - 2.2.0-2
- rebuild

* Sat Dec 07 2013 Leigh Scott <leigh123linux@googlemail.com> - 2.2.0-1
- fix vala build requires
- add waf build requires
- add gstreamer1 build requires
- use external waf to build
- add libdir to waf commands
- vailidate desktop file
- fix source tag
- remove groups tag
- remove build tag
- remove defattr from file section
- add missing scriptlets