Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %define app_name QOwnNotes
- %define app_exec qownnotes
- %define app_id org.qownnotes.QOwnNotes
- %define dir_appdata metainfo
- %if 0%{?rhel}%{?fedora}
- %if 0%{?rhel}
- %if 0%{?rhel} <= 7
- %define dir_appdata appdata
- %endif
- %endif
- %endif
- %if 0%{!?_metainfodir:1}
- %define _metainfodir %{_datadir}/%{dir_appdata}
- %endif
- %{!?_licensedir:%global license %doc}
- Name: qownnotes
- Version: 18.12.4
- Release: 1%{?dist}
- Group: Applications/Productivity
- License: GPLv2
- URL: https://www.qownnotes.org
- Summary: Note-taking app and todo list manager with ownCloud/Nextcloud integration
- Source0: https://download.tuxfamily.org/%{name}/src/%{name}-%{version}.tar.xz
- Source1: https://raw.githubusercontent.com/pbek/%{app_name}/4897d4c34885f22f326824033a1fca5adf72d8a6/build-systems/flatpak/%{app_id}.appdata.xml
- # Because of the cpuid.h
- ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- BuildRequires: gcc gcc-c++
- BuildRequires: desktop-file-utils
- BuildRequires: libappstream-glib
- BuildRequires: pkgconfig(Qt5Core)
- BuildRequires: pkgconfig(Qt5Gui)
- BuildRequires: pkgconfig(Qt5Network)
- BuildRequires: pkgconfig(Qt5PrintSupport)
- BuildRequires: pkgconfig(Qt5Qml)
- BuildRequires: pkgconfig(Qt5Svg)
- BuildRequires: pkgconfig(Qt5Sql)
- BuildRequires: pkgconfig(Qt5Widgets)
- BuildRequires: pkgconfig(Qt5Xml)
- BuildRequires: pkgconfig(Qt5XmlPatterns)
- Requires: git
- # gtk-update-icon-cache
- Requires(postun): gtk-update-icon-cache
- Requires(posttrans): gtk-update-icon-cache
- # update-desktop-database
- Requires(post): desktop-file-utils
- Requires(postun): desktop-file-utils
- %description
- QOwnNotes is the open source plain-text file markdown note taking application,
- that works together with the notes application of ownCloud or Nextcloud.
- %prep
- %{autosetup}
- desktop-file-edit --set-key="Icon" --set-value="%{app_id}" "PBE.%{app_name}.desktop"
- %build
- %{qmake_qt5} PREFIX="%{_prefix}"
- %{make_build}
- %install
- %{make_install} INSTALL_ROOT="%{buildroot}"
- %{__ln_s} "%{app_name}" "%{buildroot}%{_bindir}/%{app_exec}"
- for file in languages/%{app_name}_*.qm; do
- %{__install} -p -D -m 0644 "${file}" -t "%{buildroot}%{_datadir}/%{app_name}/languages/"
- done
- find images/icons/*/apps/ -xtype f \( -name "%{app_name}.png" -o -name "%{app_name}.svg" \) -print0 | sort -zuV | while IFS= read -rd '' file; do
- s="$( dirname -z "${file}" | xargs -0 dirname -z | xargs -0 basename -z )"
- %{__install} -p -D -m 0644 "${file}" "%{buildroot}%{_datadir}/icons/hicolor/${s}/apps/%{app_id}.${file##*.}"
- done
- %{__mv} "%{buildroot}%{_datadir}/applications/PBE.%{app_name}.desktop" "%{buildroot}%{_datadir}/applications/%{app_id}.desktop"
- %{__install} -p -D -m 0644 "%{SOURCE1}" "%{buildroot}%{_metainfodir}/%{app_id}.appdata.xml"
- %check
- /usr/bin/desktop-file-validate "%{buildroot}/%{_datadir}/applications/%{app_id}.desktop"
- /usr/bin/appstream-util validate-relax --nonet "%{buildroot}%{_metainfodir}/%{app_id}.appdata.xml"
- %post
- /bin/touch --no-create "%{_datadir}/icons/hicolor" &> /dev/null || :
- /usr/bin/update-desktop-database &> /dev/null || :
- %postun
- /usr/bin/update-desktop-database &> /dev/null || :
- 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 *.md
- %license LICENSE
- %{_bindir}/%{app_name}
- %{_bindir}/%{app_exec}
- %{_datadir}/%{app_name}/languages/%{app_name}_*.qm
- %{_datadir}/icons/hicolor/*/apps/%{app_name}.*
- %{_datadir}/icons/hicolor/*/apps/%{app_id}.*
- %{_datadir}/applications/%{app_id}.desktop
- %{_metainfodir}/%{app_id}.appdata.xml
- %changelog
- * Sat Dec 15 2018 Tomasz Tomasik <scx.mail@gmail.com> - 18.12.4-1
- - Initial package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement