]> git.pld-linux.org Git - packages/QtLockedFile.git/commitdiff
prepare qt5 build
authorElan Ruusamäe <glen@delfi.ee>
Sun, 22 Feb 2015 19:40:30 +0000 (21:40 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 22 Feb 2015 19:40:30 +0000 (21:40 +0200)
QtLockedFile.spec

index c0d8a39c2370a0a3096769b3875fbf4344eac915..a532d8349a2e2332ba6887fa57c2d681c5275e08 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without qt4             # build Qt4
+%bcond_with    qt5             # build Qt5
 
 # last commit to qtlockedfile subdir in
 # https://qt.gitorious.org/qt-solutions/qt-solutions/
@@ -17,12 +21,17 @@ Source1:    qtlockedfile.prf
 Patch0:                qtlockedfile-dont-build-example.patch
 Patch1:                qtlockedfile-use-current-version.patch
 URL:           http://doc.qt.digia.com/solutions/4/qtlockedfile/qtlockedfile.html
+%if %{with qt4}
 BuildRequires: QtCore-devel
 BuildRequires: libstdc++-devel
 BuildRequires: qt4-qmake
+%endif
+%if %{with qt5}
+%endif
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                _qt4_datadir    %{_datadir}/qt4
+%define                _qt5_datadir    %{_datadir}/qt5
 
 %description
 This class extends the QFile class with inter-process file locking
@@ -47,31 +56,53 @@ applications that use QtLockedFile.
 %patch0 -p1
 %patch1 -p0
 
+set -- *
+install -d build-qt{4,5}
+cp -al "$@" build-qt4
+cp -al "$@" build-qt5
+
 %build
-touch .licenseAccepted
+%if %{with qt4}
+cd build-qt4
 # Does not use GNU configure
 ./configure -library
 qmake-qt4
 %{__make}
+cd ..
+%endif
+
+%if %{with qt5}
+cd build-qt5
+./configure -library
+qmake-qt5
+%{__make}
+cd ..
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-# libraries
-install -d $RPM_BUILD_ROOT%{_libdir}
+%if %{with qt4}
+cd build-qt4
+install -d $RPM_BUILD_ROOT{%{_libdir},%{_qt4_datadir}/mkspecs/features}
 cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
-
 rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
-
-# headers
 install -d $RPM_BUILD_ROOT%{_includedir}/QtSolutions
-cp -p \
-    src/qtlockedfile.h \
-    src/QtLockedFile \
-    $RPM_BUILD_ROOT%{_includedir}/QtSolutions
-
-install -d $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/features
+cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/QtSolutions
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_qt4_datadir}/mkspecs/features
+cd ..
+%endif
+
+%if %{with qt5}
+cd build-qt5
+install -d $RPM_BUILD_ROOT{%{_libdir},%{_qt5_datadir}/mkspecs/features}
+cp -a lib/* $RPM_BUILD_ROOT%{_libdir}
+rm $RPM_BUILD_ROOT%{_libdir}/lib*-%{version}.so.1.0
+install -d $RPM_BUILD_ROOT%{_includedir}/QtSolutions
+cp -p src/qtlockedfile.h src/QtLockedFile $RPM_BUILD_ROOT%{_includedir}/QtSolutions
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_qt5_datadir}/mkspecs/features
+cd ..
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -79,6 +110,7 @@ rm -rf $RPM_BUILD_ROOT
 %post  -p /sbin/ldconfig
 %postun        -p /sbin/ldconfig
 
+%if %{with qt4}
 %files
 %defattr(644,root,root,755)
 %doc README.TXT
@@ -95,3 +127,22 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/QtSolutions/QtLockedFile
 %{_includedir}/QtSolutions/qtlockedfile.h
 %{_qt4_datadir}/mkspecs/features/qtlockedfile.prf
+%endif
+
+%if %{with qt5}
+%files
+%defattr(644,root,root,755)
+%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
+%{_qt5_datadir}/mkspecs/features/qtlockedfile.prf
+%endif
This page took 0.044477 seconds and 4 git commands to generate.