diff --git a/qcustomplot.pro b/qcustomplot.pro index a652329..e0c1054 100644 --- a/qcustomplot.pro +++ b/qcustomplot.pro @@ -1,8 +1,14 @@ TEMPLATE = lib VERSION = $$SOVERSION -TARGET = qcustomplot -QT = core gui +TARGET = qcustomplot$$QTSUFFIX +QT = core gui widgets printsupport SOURCES = qcustomplot.cpp HEADERS = qcustomplot.h +target.path = $$LIBDIR +INSTALLS += target + +header.path = /usr/include +header.files = qcustomplot.h +INSTALLS += header \ No newline at end of file diff --git a/qcustomplot.spec b/qcustomplot.spec index eed9278..56e9337 100644 --- a/qcustomplot.spec +++ b/qcustomplot.spec @@ -5,7 +5,7 @@ Name: qcustomplot Version: 1.3.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Qt widget for plotting and data visualization License: GPLv3+ @@ -14,6 +14,8 @@ Source0: http://www.qcustomplot.com/release/%{version}/QCustomPlot.tar.gz Source1: %{name}.pro BuildRequires: qt4-devel +BuildRequires: qt5-qtbase-devel + %description QCustomPlot is a Qt C++ widget for plotting and data visualization. @@ -21,14 +23,38 @@ This plotting library focuses on making good looking, publication quality 2D plots, graphs and charts, as well as offering high performance for realtime visualization applications. +This package contains the Qt4 version. + %package devel -Summary: Development files for %{name} +Summary: Development files for %{name} (Qt4) Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for -developing applications that use %{name}. +developing applications that use %{name} (Qt4). + + +%package qt5 +Summary: Qt widget for plotting and data visualization +Requires: %{name}-qt5%{?_isa} = %{version}-%{release} + +%description qt5 +QCustomPlot is a Qt C++ widget for plotting and data visualization. +This plotting library focuses on making good looking, publication quality 2D +plots, graphs and charts, as well as offering high performance for realtime +visualization applications. + +This package contains the Qt5 version. + + +%package qt5-devel +Summary: Development files for %{name} (Qt5) +Requires: %{name}-qt5%{?_isa} = %{version}-%{release} + +%description qt5-devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name} (Qt5). %package doc @@ -46,16 +72,24 @@ cp -a %{SOURCE1} . %build -LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt4 SOVERSION=%{so_ver} . +mkdir qt4 +( +cd qt4 +LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt4 SOVERSION=%{so_ver} LIBDIR=%{_libdir} .. make %{?_smp_mflags} +) + +mkdir qt5 +( +cd qt5 +LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt5 SOVERSION=%{so_ver} QTSUFFIX=-qt5 LIBDIR=%{_libdir} .. +make %{?_smp_mflags} +) %install -# Install header and library -install -Dpm 0644 qcustomplot.h %{buildroot}%{_includedir}/qcustomplot.h -install -d %{buildroot}%{_libdir} -chmod 0755 libqcustomplot.so.%{so_ver} -cp -a libqcustomplot.so* %{buildroot}%{_libdir} +make -C qt4 INSTALL_ROOT=%{buildroot} install +make -C qt5 INSTALL_ROOT=%{buildroot} install # pkg-config file install -d %{buildroot}%{_libdir}/pkgconfig/ @@ -70,27 +104,56 @@ Cflags: -I\${includedir} Libs: -L\${libdir} -lqcustomplot EOF +install -d %{buildroot}%{_libdir}/pkgconfig/ +cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc < - 1.3.1-2 +- Also build a qt5 version + * Sat Apr 25 2015 Sandro Mani - 1.3.1-1 - Update to 1.3.1