# https://qt.gitorious.org/qt-solutions/qt-solutions/
%define commit 17b56547d6e0d9a06603231fe2384474f9144829
Summary: QFile extension with advisory locking functions
+Summary(pl.UTF-8): Rozszerzenie QFile z funkcjami do blokowania doradczego
Name: QtLockedFile
Version: 2.4
-Release: 2
+Release: 5
License: GPL v3 or LGPL v2 with exceptions
Group: Libraries
# git clone git@gitorious.org:qt-solutions/qt-solutions.git
Source1: qtlockedfile.prf
Patch0: qtlockedfile-dont-build-example.patch
Patch1: qtlockedfile-use-current-version.patch
+Patch2: qtlockedfile-install.patch
URL: http://doc.qt.digia.com/solutions/4/qtlockedfile/qtlockedfile.html
BuildRequires: libstdc++-devel
%if %{with qt4}
-BuildRequires: QtCore-devel
-BuildRequires: qt4-qmake
+BuildRequires: QtCore-devel >= 4
+BuildRequires: qt4-qmake >= 4
%endif
%if %{with qt5}
-BuildRequires: Qt5Core-devel
-BuildRequires: qt5-qmake
+BuildRequires: Qt5Core-devel >= 5.4
+BuildRequires: qt5-qmake >= 5.4
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
only one process at a time is writing to the file, and that no process
is writing to it while others are reading it.
+%description -l pl.UTF-8
+Ta klasa rozszerza klasę QFile o możliwość międzyprocesowego
+blokowania plików. Jeśli aplikacja wymaga, aby różne procesy miały
+dostęp do tego samego pliku, QtLockedFile może pomóc łatwo zapewnić,
+że tylko jeden proces naraz zapisuje do pliku i żaden proces nie
+zapisuje, kiedy inne go czytają.
+
%package devel
Summary: Development files for QtLockedFile library
+Summary(pl.UTF-8): Pliki programistyczne biblioteki QtLockedFile
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: qt4-build
-Requires: qt4-qmake
+Requires: QtCore-devel >= 4
%description devel
-This package contains libraries and header files for developing
-applications that use QtLockedFile.
+This package contains header files for developing applications that
+use QtLockedFile.
+
+%description devel -l pl.UTF-8
+Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
+wykorzystujących QtLockedFile.
%package -n Qt5LockedFile
Summary: QFile extension with advisory locking functions
+Summary(pl.UTF-8): Rozszerzenie QFile z funkcjami do blokowania doradczego
Group: Libraries
%description -n Qt5LockedFile
only one process at a time is writing to the file, and that no process
is writing to it while others are reading it.
+%description -n Qt5LockedFile -l pl.UTF-8
+Ta klasa rozszerza klasę QFile o możliwość międzyprocesowego
+blokowania plików. Jeśli aplikacja wymaga, aby różne procesy miały
+dostęp do tego samego pliku, QtLockedFile może pomóc łatwo zapewnić,
+że tylko jeden proces naraz zapisuje do pliku i żaden proces nie
+zapisuje, kiedy inne go czytają.
+
%package -n Qt5LockedFile-devel
Summary: Development files for Qt5LockedFile library
+Summary(pl.UTF-8): Pliki programistyczne biblioteki QtLockedFile
Group: Development/Libraries
+Requires: Qt5Core-devel >= 5
Requires: Qt5LockedFile = %{version}-%{release}
-Requires: qt5-build
-Requires: qt5-qmake
%description -n Qt5LockedFile-devel
This package contains libraries and header files for developing
applications that use Qt5LockedFile.
+%description -n Qt5LockedFile-devel -l pl.UTF-8
+Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
+wykorzystujących QtLockedFile.
+
%prep
%setup -qc
%patch0 -p1
%patch1 -p0
-
-set -- *
-install -d build-qt{4,5}
-cp -al "$@" build-qt4
-cp -al "$@" build-qt5
-
-%{__sed} -i -e 's/QtSolutions/Qt5Solutions/' build-qt5/common.pri
+%patch2 -p1
%build
-%if %{with qt4}
-cd build-qt4
# Does not use GNU configure
./configure -library
-qmake-qt4
+
+%if %{with qt4}
+install -d build-qt4
+cd build-qt4
+qmake-qt4 ../qtlockedfile.pro \
+ QMAKE_CXX="%{__cxx}" \
+ QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
+ QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \
+ INSTALL_LIBDIR=%{_libdir}
%{__make}
cd ..
%endif
%if %{with qt5}
+install -d build-qt5
cd build-qt5
-./configure -library
-qmake-qt5
+qmake-qt5 ../qtlockedfile.pro \
+ QMAKE_CXX="%{__cxx}" \
+ QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
+ QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \
+ INSTALL_LIBDIR=%{_libdir}
%{__make}
cd ..
%endif
rm -rf $RPM_BUILD_ROOT
%if %{with qt4}
-cd build-qt4
-install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
-cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
-rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
+%{__make} -C build-qt4 install \
+ INSTALL_ROOT=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT{%{_includedir}/qt4/QtSolutions,%{qt4dir}/mkspecs/features}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt4/QtSolutions
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{qt4dir}/mkspecs/features
-cd ..
%endif
%if %{with qt5}
-cd build-qt5
-install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
-cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
-rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
+%{__make} -C build-qt5 install \
+ INSTALL_ROOT=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT{%{_includedir}/qt5/QtSolutions,%{qt5dir}/mkspecs/features}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/qt5/QtSolutions
-cp -p %{SOURCE1} $RPM_BUILD_ROOT%{qt5dir}/mkspecs/features
-cd ..
+%{__sed} -e 's/-lQtSolutions/-lQt5Solutions/' \
+ -e 's/QMAKE_INCDIR_QT/QT_MODULE_INCLUDE_BASE/' %{SOURCE1} >$RPM_BUILD_ROOT%{qt5dir}/mkspecs/features/qtlockedfile.prf
%endif
%clean
%files devel
%defattr(644,root,root,755)
%doc doc example
-%{_libdir}/libQtSolutions_LockedFile-%{version}.so
+%attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so
# XXX shared dir
%dir %{_includedir}/qt4/QtSolutions
%{_includedir}/qt4/QtSolutions/QtLockedFile
%files -n Qt5LockedFile-devel
%defattr(644,root,root,755)
%doc doc example
-%{_libdir}/libQt5Solutions_LockedFile-%{version}.so
+%attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so
# XXX shared dir
%dir %{_includedir}/qt5/QtSolutions
%{_includedir}/qt5/QtSolutions/QtLockedFile