File fet.spec of Package fet

#
# spec file for package fet
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           fet
Version:        5.34.3
Release:        0
Summary:        Open software for scheduling the timetable of a school
License:        AGPL-3.0
Group:          Productivity/Office/Organizers
URL:            http://www.lalescu.ro/liviu/fet/
Source0:        %{name}-%{version}.tar.bz2
#Source0: http://www.lalescu.ro/liviu/fet/download/
Source1:        README.SUSE
Source2:        fet-rpmlintrc
Source3:        fet.desktop
Source4:        fet.xpm
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  fontconfig-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
BuildRequires:  libQtWebKit-devel
BuildRequires:  libexpat-devel
BuildRequires:  libpng-devel
BuildRequires:  libqt4-devel
BuildRequires:  make
BuildRequires:  update-desktop-files
Recommends:     %{name}-samples
%if 0%{?suse_version} > 1100
BuildRequires:  glib2-devel
%endif

%description
FET is open source free software for automatically
scheduling the timetable of a school, high-school or university.
It uses a fast and efficient timetabling algorithm. It is licensed under GNU/GPL.

%package samples
Summary:        That Package provides FET samples files
Group:          Productivity/Office/Organizers
Requires:       %{name}

%description samples
FET is open source free software for automatically
scheduling the timetable of a school, high-school or university.
It uses a fast and efficient timetabling algorithm. It is licensed under GNU/GPL.
That Package provides FET samples files

%prep
%setup -q
# remove binary translations
rm -rf translations/*.qm

%build
cp %{SOURCE1} .
qmake
make %{?_smp_mflags}

# build translation files
pushd translations
lrelease *.ts
popd


%install
# manual installation, make file doesn't provide it
# creating dirs
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_datadir}/%{name}/translations
mkdir -p %{buildroot}%{_mandir}/man1
# installing documentation
cp -R doc %{buildroot}%{_datadir}/%{name}/
# removed unusefull stuffs
rm -rf '%{buildroot}%{_datadir}/%{name}/doc/installing, compiling, running/' '%{buildroot}%{_datadir}/%{name}/doc/how-to-add-new-translations'
# moved man file to /usr/share/man/man1/
mv man/fet* %{buildroot}%{_mandir}/man1/
# installing samples
cp -R examples %{buildroot}%{_datadir}/%{name}/
# installing translations
cp  translations/*.qm %{buildroot}%{_datadir}/%{name}/translations/
# installing binary.
cp fet %{buildroot}%{_bindir}/
# install desktop file
install -Dm644 %{SOURCE4} %{buildroot}%{_datadir}/pixmaps/fet.xpm
%if 0%{?suse_version}
install -Dm644 %{SOURCE3} %{buildroot}%{_datadir}/applications/fet.desktop
%suse_update_desktop_file -n fet
%endif
%if 0%{?fedora_version}
desktop-file-install --vendor="fedora" \
        --dir=%{buildroot}%{_datadir}/applications %{SOURCE3}
%endif

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog
%doc README REFERENCES THANKS TODO TRANSLATORS
%{_bindir}/fet
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/translations/
%dir %{_datadir}/%{name}/doc/
%{_datadir}/%{name}/translations/*.qm
%{_datadir}/%{name}/doc/*
%{_mandir}/man1/*
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/fet.xpm
%exclude %{_datadir}/%{name}/examples

%files samples
%defattr(-,root,root)
%doc README.SUSE
%dir %{_datadir}/%{name}/examples
%{_datadir}/%{name}/examples/*
%{_datadir}/%{name}/examples/*/*/*.fet
%{_datadir}/%{name}/examples/*/*.fet

%changelog
openSUSE Build Service is sponsored by