File entropypianotuner.spec of Package entropypianotuner

Summary:        Entropy Piano Tuner
Name:           entropypianotuner
Version:        1.2.0
Release:        1%{?dist}
License:        GPL-3.0
Group:          Applications/Productivity

# Source from gitlab
# Change the hash according to the current master branch
# Workaround for source containing a '?' (commend at end)
%global BRANCH  v1.2.0
%global ARCHIVE archive.tar.gz?ref=%BRANCH
%global OWNER tp3
%global PROJECT Entropy-Piano-Tuner
Source: #/archive.tar.gz
%if 0%{?fedora}
BuildRequires:  fdupes, qt5-qtbase-devel, qt5-qtmultimedia-devel, qt5-qtmidi-devel, fftw3-devel, desktop-file-utils, alsa-lib-devel, libuv-devel
Requires:       qt5-qtbase, qt5-qtmultimedia, fftw3, alsa-lib, libuv
%if 0%{?fedora} >= 22
BuildRequires:  qwt-qt5-devel
Requires:       qwt-qt5
%if 0%{?fedora} < 22
BuildRequires:  qwt6-qt5-devel
Requires:       qwt6-qt5

%if 0%{?suse_version}
# qwt does not exist yet for qt5 on suse in stable repos
BuildRequires:  fdupes, libatomic1, libqt5-qtbase-devel, libqt5-qtmultimedia-devel, libQt5Midi-devel, qwt6-qt5-devel, fftw-devel, update-desktop-files, alsa-devel
Requires:       fftw3, alsa
%if 0%{?suse_version} > 1320
BuildRequires:  libuv-devel
%if 0%{?suse_version} == 1315
BuildRequires:  libuv-devel

This is a program for tuning your piano.

# standard setup, but rename the dir in the archive, because it contains its commit hash!
rm -rf %{PROJECT}
gzip -dc  $RPM_SOURCE_DIR/archive.tar.gz | tar -xf -
if [ $? -ne 0 ]; then
  exit $?

# remove commit number and move files to build dir
find . -depth -type d -name '%{PROJECT}-%{BRANCH}*' -exec mv {} %{PROJECT} \;
ls -A | xargs -I {} mv {} $RPM_BUILD_DIR/{}

chmod -Rf a+rX,u+w,g-w,o-w .

# create desktop entry file
%{__cat} <<EOF >%{name}.desktop
[Desktop Entry]
Name=Entropy Piano Tuner
Comment=Tune your piano
Exec=entropypianotuner %f

qmake-qt5 -r \
	"EPT_INSTALL_BIN_RDIR=%{_bindir}" \
   	"EPT_INSTALL_DATA_RDIR=%{_datadir}" \
make %{?_smp_mflags}


# install files declared in qmake
make INSTALL_ROOT=%{buildroot} install

# install desktop file
%{__install} -d -m0755 %{buildroot}%{_datadir}/applications/
desktop-file-install \
    --delete-original                          \
    --dir %{buildroot}%{_datadir}/applications \
# remove unused library files
%{__rm} %{buildroot}%{_libdir}/%{name}/

%if 0%{?suse_version} >= 1140

%if 0%{?suse_version} >= 1140

%{__rm} -rf %{buildroot}

%defattr(-, root, root, 0755)
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/128x128/mimetypes
%dir %{_libdir}/%{name}


%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/algorithms


* Fri Nov 11 2016 Christoph Wick <> - 1.1.7-0
- Updates

* Fri Jun 12 2015 Christoph Wick <> - 1.0.4-0
- Initial package.