]> git.pld-linux.org Git - packages/QtLockedFile.git/blobdiff - QtLockedFile.spec
- adjusted qtlockedfile.prf for qt5 compatibility; release 5
[packages/QtLockedFile.git] / QtLockedFile.spec
index 2dcfdea75fa903112fd93f474a08a210f67311fb..3260ebdbfbfdf8ff0b79e4c72b5524618642a483 100644 (file)
@@ -1,22 +1,41 @@
+#
+# Conditional build:
+%bcond_without qt4             # build Qt4
+%bcond_without qt5             # build Qt5
+
+# last commit to qtlockedfile subdir in
+# 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:       1
+Release:       5
 License:       GPL v3 or LGPL v2 with exceptions
 Group:         Libraries
-URL:           http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtlockedfile
-Source0:       http://get.qt.nokia.com/qt/solutions/lgpl/qtlockedfile-%{version}_1-opensource.tar.gz
-# Source0-md5: ac8f848f59038a414f3ab4f4cc08e99c
+# git clone git@gitorious.org:qt-solutions/qt-solutions.git
+# git checkout %{commit}
+# tar -cjf QtLockedFile-%{version}.tar.bz2 -C qt-solutions/qtlockedfile .
+Source0:       %{name}-%{version}.tar.bz2
+# Source0-md5: 8d0525b7f3dc92ee1464c6a538832535
 Source1:       qtlockedfile.prf
 Patch0:                qtlockedfile-dont-build-example.patch
-# Remove unnecessary linkage to libQtGui
-Patch1:                qtlockedfile-dont-link-qtgui.patch
-BuildRequires: QtCore-devel
+Patch1:                qtlockedfile-use-current-version.patch
+Patch2:                qtlockedfile-install.patch
+URL:           http://doc.qt.digia.com/solutions/4/qtlockedfile/qtlockedfile.html
 BuildRequires: libstdc++-devel
-BuildRequires: qt4-qmake
+%if %{with qt4}
+BuildRequires: QtCore-devel >= 4
+BuildRequires: qt4-qmake >= 4
+%endif
+%if %{with qt5}
+BuildRequires: Qt5Core-devel >= 5.4
+BuildRequires: qt5-qmake >= 5.4
+%endif
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _qt4_datadir    %{_datadir}/qt4
+%define                qt4dir  %{_datadir}/qt4
+%define                qt5dir  %{_libdir}/qt5
 
 %description
 This class extends the QFile class with inter-process file locking
@@ -25,48 +44,119 @@ 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
+%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 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
+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.
 
-%description   devel
+%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}
+
+%description -n Qt5LockedFile-devel
 This package contains libraries and header files for developing
-applications that use QtLockedFile.
+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 -q -n qtlockedfile-%{version}_1-opensource
+%setup -qc
 %patch0 -p1
-%patch1 -p1
-
+%patch1 -p0
+%patch2 -p1
 
 %build
-touch .licenseAccepted
 # 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
+qmake-qt5 ../qtlockedfile.pro \
+       QMAKE_CXX="%{__cxx}" \
+       QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
+       QMAKE_LFLAGS_RELEASE="%{rpmldflags}" \
+       INSTALL_LIBDIR=%{_libdir}
+%{__make}
+cd ..
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-# libraries
-install -d $RPM_BUILD_ROOT%{_libdir}
-cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
+%if %{with qt4}
+%{__make} -C build-qt4 install \
+       INSTALL_ROOT=$RPM_BUILD_ROOT
 
-rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
+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
+%endif
 
-# headers
-install -d $RPM_BUILD_ROOT%{_includedir}/QtSolutions
-cp -a \
-    src/qtlockedfile.h \
-    src/QtLockedFile \
-    $RPM_BUILD_ROOT%{_includedir}/QtSolutions
+%if %{with qt5}
+%{__make} -C build-qt5 install \
+       INSTALL_ROOT=$RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/features
-cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/features
+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
+%{__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
 rm -rf $RPM_BUILD_ROOT
@@ -74,18 +164,41 @@ rm -rf $RPM_BUILD_ROOT
 %post  -p /sbin/ldconfig
 %postun        -p /sbin/ldconfig
 
+%post  -n Qt5LockedFile -p /sbin/ldconfig
+%postun        -n Qt5LockedFile -p /sbin/ldconfig
+
+%if %{with qt4}
 %files
 %defattr(644,root,root,755)
-%doc LGPL_EXCEPTION.txt LICENSE.* README.TXT
+%doc README.TXT
 %attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libQtSolutions_LockedFile-%{version}.so.1
 
 %files devel
 %defattr(644,root,root,755)
 %doc doc example
-%{_libdir}/libQtSolutions_LockedFile-%{version}.so
-# XXX shared dir with QtSingleApplication
-%dir %{_includedir}/QtSolutions
-%{_includedir}/QtSolutions/QtLockedFile
-%{_includedir}/QtSolutions/qtlockedfile.h
-%{_qt4_datadir}/mkspecs/features/qtlockedfile.prf
+%attr(755,root,root) %{_libdir}/libQtSolutions_LockedFile-%{version}.so
+# XXX shared dir
+%dir %{_includedir}/qt4/QtSolutions
+%{_includedir}/qt4/QtSolutions/QtLockedFile
+%{_includedir}/qt4/QtSolutions/qtlockedfile.h
+%{qt4dir}/mkspecs/features/qtlockedfile.prf
+%endif
+
+%if %{with qt5}
+%files -n Qt5LockedFile
+%defattr(644,root,root,755)
+%doc README.TXT
+%attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libQt5Solutions_LockedFile-%{version}.so.1
+
+%files -n Qt5LockedFile-devel
+%defattr(644,root,root,755)
+%doc doc example
+%attr(755,root,root) %{_libdir}/libQt5Solutions_LockedFile-%{version}.so
+# XXX shared dir
+%dir %{_includedir}/qt5/QtSolutions
+%{_includedir}/qt5/QtSolutions/QtLockedFile
+%{_includedir}/qt5/QtSolutions/qtlockedfile.h
+%{qt5dir}/mkspecs/features/qtlockedfile.prf
+%endif
This page took 0.088115 seconds and 4 git commands to generate.