nheko/nheko.spec
2018-03-14 15:49:18 +01:00

117 lines
3.8 KiB
RPMSpec

# Git revision of lmdbxx...
%global commit1 0b43ca87d8cfabba392dfe884eb1edb83874de02
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
# Git revision of matrix-structs...
%global commit2 850100c0ac2b5a04720b2a1f09270749bf99f7dd
%global shortcommit2 %(c=%{commit2}; echo ${c:0:7})
Summary: Desktop client for the Matrix protocol
Name: nheko
Version: 0.2.1
Release: 1%{?dist}
# Application and 3rd-party modules licensing:
# * S0 - GPLv3+ -- main source;
# * S1 (lmdbxx) - Public Domain -- build-time dependency (header-only);
# * S2 (matrix-structs) - Public Domain -- build-time dependency;
# * S3 (json) - MIT -- build-time dependency (header-only);
# * S3 (variant) - Boost 1.0 -- build-time dependency (header-only).
# Bundled resources licensing:
# * emojione-android fonts - CC by (v4.0) -- bundled resource;
# * OpenSans fonts - Apache (v2.0) -- bundled resource.
License: GPLv3+ and Public Domain and MIT and Boost and ASL 2.0 and CC-BY
URL: https://github.com/mujx/nheko
# Use ./gen_libs.sh script from repository to generate tarball with header-only libraries...
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://github.com/bendiken/lmdbxx/archive/%{commit1}.tar.gz#/lmdbxx-%{shortcommit1}.tar.gz
Source2: https://github.com/mujx/matrix-structs/archive/%{commit2}.tar.gz#/matrix-structs-%{shortcommit2}.tar.gz
Source3: header_only.tar.gz
Source4: gen_libs.sh
Patch0: %{name}-drop-flags.patch
Patch1: %{name}-drop-rpath.patch
BuildRequires: cmake(Qt5Widgets)
BuildRequires: cmake(Qt5Network)
BuildRequires: cmake(Qt5Multimedia)
BuildRequires: cmake(Qt5Concurrent)
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: ninja-build
BuildRequires: lmdb-devel
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: gcc
Requires: hicolor-icon-theme
%description
The motivation behind the project is to provide a native desktop app
for Matrix that feels more like a mainstream chat app.
%prep
# Unpacking main tarball with sources...
%autosetup -p1
mkdir {%{_target_platform},.third-party}
sed -i '/GIT_/d' cmake/*.cmake
# Unpacking third-party modules...
pushd ".third-party"
tar -xf %{SOURCE1}
mv lmdbxx-%{commit1} lmdbxx
tar -xf %{SOURCE2}
mv matrix-structs-%{commit2} matrix_structs
pushd matrix_structs
sed -i 's@add_library(${LIBRARY_NAME} ${SRC})@add_library(${LIBRARY_NAME} STATIC ${SRC})@g' CMakeLists.txt
tar -xf %{SOURCE3}
popd
popd
%build
pushd %{_target_platform}
%cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
popd
%ninja_build -C %{_target_platform}
%install
# Installing application...
%ninja_install -C %{_target_platform}
# Installing additional locales...
mkdir -p "%{buildroot}%{_datarootdir}/%{name}/translations"
find %{_target_platform} -maxdepth 1 -type f -name "*.qm" -exec install -m 0644 -p '{}' %{buildroot}%{_datarootdir}/%{name}/translations \;
%find_lang %{name} --with-qt
%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%files -f %{name}.lang
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/translations
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%changelog
* Wed Mar 14 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.2.1-1
- Updated to version 0.2.1.
* Mon Mar 05 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.2.0-1
- Updated to version 0.2.0.
* Thu Dec 28 2017 Vitaly Zaitsev <vitaly@easycoding.org> - 0.1.0-1
- Updated to version 0.1.0.
* Mon Sep 25 2017 Vitaly Zaitsev <vitaly@easycoding.org> - 0-1.20170924git9def76a
- Initial SPEC release.