File mylibrary.spec of Package mylibrary
#
# spec file for package mylibrary
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _name ru.mail.bobilev_yury.MyLibrary
%define sover 1
Name: mylibrary
Version: @SERVICE@
Release: 0
Summary: Home librarian
Summary(ru): Домашний библиотекарь
License: GPL-3.0-or-later
Group: Productivity/Office/Management
URL: https://github.com/ProfessorNavigator/mylibrary
Source0: %{name}-%{version}.tar.xz
#atch0: cmakelists_txt.patch
BuildRequires: cmake
#uildRequires: doxygen
BuildRequires: fdupes
%if 0%{?suse_version} >= 1600
BuildRequires: gcc-c++ >= 10.2.1
%else
BuildRequires: gcc10-c++
%endif
BuildRequires: pkgconfig
#uildRequires: texlive-epstopdf-bin
#uildRequires: texlive-latex-bin-bin
BuildRequires: update-desktop-files
BuildRequires: cmake(TBB)
BuildRequires: pkgconfig(Magick++)
BuildRequires: pkgconfig(ddjvuapi)
BuildRequires: pkgconfig(gpg-error)
BuildRequires: pkgconfig(gtkmm-4.0)
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: pkgconfig(icu-uc)
BuildRequires: pkgconfig(libarchive)
BuildRequires: pkgconfig(libgcrypt)
BuildRequires: pkgconfig(poppler-cpp)
Recommends: %{name}-lang
%description
MyLibrary is a simple program for managing .fb2, .epub, .pdf and .djvu
e-book file collections. It can also works with same formats packed in zip,
7z, jar, cpio, iso, tar, tar.gz, tar.bz2, tar.xz, rar (see notes) archives
itself or packed in same types of archives with .fbd files (epub, djvu and
pdf books). MyLibrary creates own database and does not change files
content, names or location.
%description -l ru
MyLibrary - это простая программа для создания и поддержания коллекций книг
в форматах .fb2, .epub, .pdf, .djvu и .fbd (для книг в форматах epub, djvu
и pdf). Возможна также работа с книгами, упакованными в различные типы
архивов. Поддерживаются архивы zip, 7z, jar, cpio, iso, tar, tar.gz,
tar.bz2, tar.xz, rar (см. замечания). В процессе формирования коллекции
создаётся собственная база данных, исходные файлы книг, их расположение и
названия при этом не изменяются.
%lang_package
%package -n libmlbookproc%{sover}
Summary: Library for %{name}
Group: Development/Libraries/C and C++
%description -n libmlbookproc%{sover}
Methods to work with collections, bookmarks and notes have been moved to
MLBookProc library.
%package -n libmlbookproc-devel
Summary: Development files for libmlbookproc
Group: Development/Libraries/C and C++
Requires: libmlbookproc%{sover} = %{version}
%description -n libmlbookproc-devel
Development files for libmlbookproc including headers and libraries.
%package -n libmlpluginifc%{sover}
Summary: Library for %{name}
Group: Development/Libraries/C and C++
%description -n libmlpluginifc%{sover}
MLPluginIfc library provides interfaces to create plugins for MyLibrary.
%package -n libmlpluginifc-devel
Summary: Development files for libmlpluginifc
Group: Development/Libraries/C and C++
Requires: libmlpluginifc%{sover} = %{version}
%description -n libmlpluginifc-devel
Development files for libmlpluginifc including headers and libraries.
%prep
%autosetup -p1
# ?invalid-desktopfile?, non-executable-script: #!/usr/bin/env xdg-open
# https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
sed -i '/Version/s/1.5/1.0/' %{_name}.desktop
# script-without-shebang: ru.mail.bobilev_yury.MyLibrary.desktop
find -type f -perm /111 -iname '*mylibrary*' -exec chmod 0644 {} +
%build
%cmake \
-DUSE_PLUGINS=ON \
%if 0%{?sle_version} >= 150500
-DCMAKE_CXX_COMPILER=%{_bindir}/g++-10
%endif
%{nil}
%cmake_build
%install
%cmake_install
rm -fv %{buildroot}%{_datadir}/MyLibrary/COPYING
%fdupes -s %{buildroot}%{_datadir}
%find_lang %{name} --all-name
%ldconfig_scriptlets -n libmlbookproc%{sover}
%ldconfig_scriptlets -n libmlpluginifc%{sover}
%files
%doc README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{_name}*.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%{_datadir}/MyLibrary
%license COPYING
%files -n libmlbookproc%{sover}
%{_libdir}/libmlbookproc.so.*
%{_datadir}/MLBookProc
%files -n libmlbookproc-devel
%{_includedir}/MLBookProc
%{_libdir}/libmlbookproc.so
%{_libdir}/cmake/MLBookProc
%files -n libmlpluginifc%{sover}
%{_libdir}/libmlpluginifc.so.*
%files -n libmlpluginifc-devel
%{_includedir}/MLPluginIfc
%{_libdir}/libmlpluginifc.so
%{_libdir}/cmake/MLPluginIfc
%files lang -f %{name}.lang
%changelog