[app] Added openrepos variant

This commit is contained in:
Slava Monich 2018-04-27 00:33:26 +03:00
parent e96d3c28d0
commit 12eb3919dc
5 changed files with 83 additions and 4 deletions

View file

@ -54,12 +54,13 @@ OTHER_FILES += \
qml/*.qml \
qml/images/* \
settings/*.qml \
settings/*.json \
data/default/* \
data/zlibrary/core/encodings/* \
data/zlibrary/core/resources/* \
translations/*.ts
TARGET_DATA_DIR = /usr/share/harbour-books
TARGET_DATA_DIR = /usr/share/$$TARGET
TARGET_DEFAULT_DATA_DIR = $$TARGET_DATA_DIR/data
TARGET_ZLIBRARY_DATA_DIR = $$TARGET_DEFAULT_DATA_DIR
TARGET_ICON_ROOT = /usr/share/icons/hicolor

View file

@ -0,0 +1,14 @@
{
"translation_catalog" : "harbour-books",
"entries": [
{
"path": "applications/harbour-books.desktop",
"title": "Books",
"type": "page",
"icon": "harbour-books",
"params": {
"source": "/usr/share/harbour-books/settings/BooksSettings.qml"
}
}
]
}

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Copyright (C) 2015-2017 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Jolla Ltd.
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@ -91,7 +91,11 @@ Q_DECL_EXPORT int main(int argc, char **argv)
QLocale locale;
QTranslator* translator = new QTranslator(app);
#ifdef OPENREPOS
QString transDir("/usr/share/translations");
#else
QString transDir = SailfishApp::pathTo("translations").toLocalFile();
#endif
QString transFile(BOOKS_APP_NAME);
if (translator->load(locale, transFile, "-", transDir) ||
translator->load(transFile, transDir)) {

View file

@ -4,4 +4,4 @@ SUBDIRS = fribidi linebreak fbreader harbour-lib app
OTHER_FILES += \
README.md \
rpm/harbour-books.spec
rpm/*.spec

60
rpm/openrepos-books.spec Normal file
View file

@ -0,0 +1,60 @@
Name: openrepos-books
Summary: E-book reader
Version: 1.0.26
Release: 1
License: BSD
Vendor: slava
Group: Applications/File
URL: http://github.com/monich/harbour-books
Source0: %{name}-%{version}.tar.gz
Requires: sailfishsilica-qt5
Requires: qt5-qtsvg-plugin-imageformat-svg
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(sailfishapp)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(mlite5)
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(libudev)
BuildRequires: file-devel
BuildRequires: bzip2-devel
BuildRequires: desktop-file-utils
BuildRequires: qt5-qttools-linguist
%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
%description
FBReader-based e-book reader.
%prep
%setup -q -n %{name}-%{version}
%build
%qtc_qmake5 CONFIG+=openrepos CONFIG+=app_settings harbour-books.pro
%qtc_make %{?_smp_mflags}
%install
rm -rf %{buildroot}
cd app
%qmake5_install
desktop-file-install --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/*.desktop
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/translations/%{name}*.qm
%{_datadir}/jolla-settings/entries/%{name}.json
%check
make -C test test