File _service:set_version:testmanager-ng.spec of Package testmanager-ng

#
# This file is part of Testmanager NG.
#
# Testmanager NG is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# Testmanager NG is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# Testmanager NG. If not, see <http://www.gnu.org/licenses/>.
#
# vim: tw=78 spelllang=en
#

Name: testmanager-ng
Version: 0.1.61.gc3d70a6
Release: 0

Summary: Testmanager NG
License: GPL-3.0+
Vendor: Ingenieurgemeinschaft IgH GmbH
Group: Productivity/Other
Url: http://etherlab.org/en/testmanager
Source0: %{name}-%{version}.tar.bz2

Requires: desktop-file-utils
Requires: shared-mime-info
Requires: python3

BuildRequires: QtPdWidgets
BuildRequires: QtPdWidgets-devel
BuildRequires: desktop-file-utils
BuildRequires: libpdcom1-devel
BuildRequires: libqt5-qttools-devel
BuildRequires: python3-devel
BuildRequires: shared-mime-info

%if 0%{?suse_version} == 1310
BuildRequires: libqt5-qtbase-devel
%else
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libQt5Core-devel
BuildRequires: libQt5Network-devel
BuildRequires: libQt5Widgets-devel
BuildRequires: libqt5-qtsvg-devel
BuildRequires: libQt5Test-devel
BuildRequires: libQt5Svg-devel
%endif

%description
Testmanager NG ist the sequel of the automation and visualisation tool by
Dr. Wilhelm Hagemeister.

%prep
%setup

%build
qmake-qt5 PREFIX=%{_prefix} VERSION=%{version}
make %{?_smp_mflags}

%install
make INSTALL_ROOT=${RPM_BUILD_ROOT} VERBOSE=1 install

# Rename binaries and share directory with suffix -ng
mv %{buildroot}%{_bindir}/testmanager %{buildroot}%{_bindir}/testmanager-ng
mv %{buildroot}%{_datadir}/testmanager %{buildroot}%{_datadir}/testmanager-ng

# Change references in desktop and mime files
sed -i s/Exec=testmanager/Exec=testmanager-ng/ testmanager.desktop
sed -i s/Icon=testmanager/Icon=testmanager-ng/ testmanager.desktop
sed -i s/Manager/Manager\ NG/ testmanager.desktop
sed -i s:application/testmanager:application/testmanager-ng: \
    testmanager.desktop testmanager-mime.xml

# Install desktop file
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/applications
cp -v testmanager.desktop \
    ${RPM_BUILD_ROOT}%{_datadir}/applications/testmanager-ng.desktop

# Install images
IMGDIR=${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/scalable/apps
mkdir -p $IMGDIR
cp images/testmanager.svg $IMGDIR/testmanager-ng.svg
cp images/testmanager-layout.svg $IMGDIR/testmanager-ng-layout.svg

# Install MIME file
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/mime/packages
cp testmanager-mime.xml \
    ${RPM_BUILD_ROOT}%{_datadir}/mime/packages/testmanager-ng-mime.xml

%post
%{_bindir}/update-mime-database %{_datadir}/mime
touch %{_datadir}/icons/hicolor
%{_bindir}/update-desktop-database

%postun
%{_bindir}/update-mime-database %{_datadir}/mime
touch %{_datadir}/icons/hicolor
%{_bindir}/update-desktop-database

%files
%defattr(-,root,root)
%{_bindir}/testmanager-ng
%{_datadir}/applications/testmanager-ng.desktop
%{_datadir}/icons/hicolor/scalable
%{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/testmanager-ng.svg
%{_datadir}/icons/hicolor/scalable/apps/testmanager-ng-layout.svg
%{_datadir}/mime/packages/testmanager-ng-mime.xml
%{_datadir}/testmanager-ng
%{_datadir}/testmanager-ng/example.tml

%changelog
* Fri Mar 17 2023 fp@igh.de
- Disabled syntax highlighting
* Fri Feb 23 2018 fp@igh.de
- Desktop files and icons
* Thu Feb 1 2018 fp@igh.de
- Initial revision
openSUSE Build Service is sponsored by