File qtlockedfile.spec of Package qtlockedfile

# spec file for package qtlockedfile
# Copyright (c) 2013 SUSE LINUX Products 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

# norootforbuild

Name:    qtlockedfile
Version: 2.4.1git
Release: 0
Group:   Development/Libraries/C and C++
License: BSD-3-Clause
Summary: TQFile extension with advisory locking functions
Source0:   %{name}-%{version}.tar.xz
Source1:   %{name}.prf
Source10:  %{name}-rpmlintrc
# Don't build examples:
Patch0:    %{name}-dont-build-example.patch
# Remove unnecessary linkage to libQtGui
Patch1:    %{name}-dont-link-qtgui.patch
# use version num. for so lib
Patch2:    %{name}-libver.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libqt4-devel
# BuildRequires: fdupes
%if 0%{?suse_version} <= 1210
# Only needed for openSUSE <= 12.1; later it is pulled in by rpm-build.
BuildRequires: xz

This class extends the QFile class with inter-process file locking
capabilities. If an application requires that several processes
should access the same file, QtLockedFile can be used to easily
ensure that only one process at a time is writing to the file, and
that no process is writing to it while others are reading it.

%package devel
Group: Development/Libraries/C and C++
Summary: The QtLockedFile class extends QFile with advisory locking functions
Requires: %{name} = %{version}
Requires: libqt4-devel

%description devel
This package contains libraries and header files for developing applications
that use QtLockedFile.

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

./configure -library
qmake QMAKE_CFLAGS+="%optflags" QMAKE_CXXFLAGS+="%optflags"
%{__make} %{?_smp_mflags} VERBOSE=1

# libraries
mkdir -p $RPM_BUILD_ROOT%{_libdir}
cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
# headers
mkdir -p $RPM_BUILD_ROOT%{_includedir}/QtSolutions
cp -a \
    src/qtlockedfile.h \
    src/QtLockedFile \
# features
mkdir -p $RPM_BUILD_ROOT%{_datadir}/qt4/mkspecs/features
cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/qt4/mkspecs/features/

%__ln_s -f ../../images/qt-logo.png doc/html/images/


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files devel
%doc doc example