From a7cfe9e9aa21e72c649a9aaa8168167c0c443155 Mon Sep 17 00:00:00 2001
From: Raphael Groner <raphgro(a)fedoraproject.org>
Date: Wed, 13 Jul 2016 11:35:03 +0200
Subject: execute tests for common
---
backintime.spec | 66 ++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 39 insertions(+), 27 deletions(-)
diff --git a/backintime.spec b/backintime.spec
index 7757306..b53c1fe 100644
--- a/backintime.spec
+++ b/backintime.spec
@@ -1,6 +1,6 @@
Name: backintime
Version: 1.1.12
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Simple backup tool inspired from the Flyback project and TimeVault
License: GPLv2+
URL:
http://backintime.le-web.org
@@ -8,7 +8,8 @@ Source0:
http://backintime.le-web.org/download/%{name}/%{name}-%{versio
BuildArch: noarch
BuildRequires: desktop-file-utils
BuildRequires: gettext
-BuildRequires: python3-devel
+BuildRequires: python3-pkgversion-macros
+BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: systemd
Requires: %{name}-common = %{version}-%{release}
Requires(post): systemd
@@ -17,6 +18,13 @@ Requires(postun): systemd
# we place additional icons
Requires: hicolor-icon-theme
+# execution of tests
+BuildRequires: python%{python3_pkgversion}-nose
+BuildRequires: python%{python3_pkgversion}-dbus
+BuildRequires: /usr/bin/ssh-agent
+BuildRequires: /usr/bin/ps
+BuildRequires: /usr/bin/rsync
+
%description
Back In Time is a simple backup system for Linux inspired from
“flyback project” and “TimeVault”. The backup is done by taking
@@ -26,11 +34,14 @@ snapshots of a specified set of directories.
Summary: Common files for the %{name}, a simple backup tool
Requires: cronie
Requires: openssh-clients
-Requires: python3-keyring
-Requires: python3-dbus
+Requires: python%{python3_pkgversion}-keyring
+Requires: python%{python3_pkgversion}-dbus
Requires: fuse-sshfs
Requires: fuse-encfs
Requires: bindfs
+Requires: /usr/bin/ssh-agent
+Requires: /usr/bin/ps
+Requires: /usr/bin/rsync
Provides: backintime-notify = %{version}-%{release}
Obsoletes: backintime-notify < 1.1.12-1
@@ -46,9 +57,9 @@ Summary: Qt4 frontend for %{name}
Requires: %{name}-common = %{version}-%{release}
Requires: libnotify
Requires: polkit
-Requires: python3-PyQt4
-Requires: python3-SecretStorage
-Requires: python3-keyring
+Requires: python%{python3_pkgversion}-PyQt4
+Requires: python%{python3_pkgversion}-SecretStorage
+Requires: python%{python3_pkgversion}-keyring
Requires: xorg-x11-utils
Provides: backintime-gnome = %{version}-%{release}
Obsoletes: backintime-gnome < 1.1.12-1
@@ -62,53 +73,47 @@ snapshots of a specified set of directories.
This package contains the Qt4 frontend of BackInTime.
+
%prep
%setup -q
-
-%build
# Fix documentation directories.
sed -i -e "s|'%{name}-common'|'%{name}'|g" common/config.py
sed -i -e "s|%{name}-common|%{name}|g" common/configure qt4/configure
-
# Fix icon name.
sed -i 's/Icon=document-save/Icon=backintime/g' qt4/backintime-qt4.desktop
sed -i 's/Icon=document-save/Icon=backintime/g' qt4/backintime-qt4-root.desktop
-#configure used, but fixed upstream to be able to use configure macro
+# enable more output for (failed) tests
+sed -i 's|>/dev/null 2>/dev/null||g' common/test/test.sh
+%build
+#configure used, but fixed upstream to be able to use configure macro
pushd common
./configure --no-fuse-group --python3
-make %{?_smp_mflags}
popd
-
pushd qt4
./configure --python3
-make %{?_smp_mflags}
popd
+%make_build -C common
+%make_build -C qt4
+
+
%install
#Force Python 3 to be used for byte compilation:
%global __python %{__python3}
-
-pushd common
-%make_install
-popd
-
-pushd qt4
-%make_install
-popd
+%make_install -C common
+%make_install -C qt4
%find_lang %{name}
desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/%{name}-qt4.desktop
-
desktop-file-install \
--dir=%{buildroot}%{_datadir}/applications/ \
--add-category="Settings;" \
%{buildroot}%{_datadir}/applications/%{name}-qt4-root.desktop
-
mkdir -p %{buildroot}%{_sbindir}
cp -p %{buildroot}%{_bindir}/%{name}-qt4 \
%{buildroot}%{_sbindir}/%{name}-qt4-root
@@ -117,7 +122,6 @@ ln -s consolehelper \
%{buildroot}%{_bindir}/%{name}-qt4-root
mkdir -p %{buildroot}%{_sysconfdir}/security/console.apps/
-
cat << EOF > %{buildroot}%{_sysconfdir}/security/console.apps/%{name}-qt4-root
USER=root
PROGRAM=%{_sbindir}/%{name}-qt4-root
@@ -125,7 +129,6 @@ SESSION=true
EOF
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
-
cat << EOF > %{buildroot}%{_sysconfdir}/pam.d/%{name}-qt4-root
#%PAM-1.0
auth include config-util
@@ -134,10 +137,14 @@ session include config-util
EOF
+%check
+pushd common/test
+nosetests-%{python3_version} -v
+./test.sh
+
%post common
%systemd_post %{name}.service
-
update-desktop-database &> /dev/null ||:
/bin/touch --no-create %{_datadir}/icons/hicolor
@@ -187,7 +194,12 @@ fi
%config(noreplace) %{_sysconfdir}/pam.d/%{name}-qt4-root
%config %{_sysconfdir}/security/console.apps/%{name}-qt4-root
+
%changelog
+* Wed Jul 13 2016 Raphael Groner <projects.rg(a)smart.ms> - 1.1.12-2
+- use make and python3 macros
+- execute tests for common
+
* Thu Mar 03 2016 Johannes Lips <hannes(a)fedoraproject.org> - 1.1.12-1
- update to version 1.1.12
- removal of desktop dependent sub-packages
--
cgit v1.1
https://src.fedoraproject.org/cgit/backintime.git/commit/?h=f24&id=a7...