%bcond_without qt4 %bcond_with qt5 %global srcname libqtxdg Name: qtxdg Summary: Qt implementation of desktop specifications Version: 0.5.3 Release: 1%{?dist} Group: Applications/System License: LGPLv2+ URL: https://github.com/lxde/libqtxdg Source0: http://lxqt.org/downloads/libqtxdg/%{version}/libqtxdg-%{version}.tar.xz %if 0%{?rhel} == 6 BuildRequires: cmake28 %else BuildRequires: cmake >= 2.8.3 %endif BuildRequires: file-devel %if %with qt4 BuildRequires: pkgconfig(QtCore) BuildRequires: pkgconfig(QtGui) BuildRequires: pkgconfig(QtXml) %endif %if %with qt5 BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Xml) BuildRequires: qt5-linguist %endif %description Implementations of freedesktop.org XDG specifications from LXDE project for use with Qt library. %package qt4 Summary: Qt4 - implementation of desktop specifications %description qt4 Implementations of freedesktop.org XDG specifications from LXDE project for use with Qt4 library. %package qt4-devel Summary: Qt4 - development files for qtxdg Requires: cmake Requires: pkgconfig Requires: %{name}-qt4%{?_isa} = %{version}-%{release} %description qt4-devel Files used for developing and building software that uses qtxdg. %package qt5 Summary: Qt5 - implementation of desktop specifications %description qt5 Implementations of freedesktop.org XDG specifications from LXDE project for use with Qt4 library. %package qt5-devel Summary: Qt5 - development files for Qt5Xdg Requires: cmake Requires: pkgconfig Requires: %{name}-qt5%{?_isa} = %{version}-%{release} %description qt5-devel Files used for developing and building software that uses Qt5Xdg. %prep %setup -q -c -n %{srcname}-%{version} %build %if %with qt4 mkdir build-qt4 cd build-qt4 %if 0%{?rhel} == 6 %cmake28 .. %else %cmake .. %endif make %{?_smp_mflags} cd .. %endif %if %with qt5 mkdir build-qt5 cd build-qt5 %cmake -DUSE_QT5=Yes .. make %{?_smp_mflags} cd .. %endif %install %if %with qt4 make -C build-qt4 install DESTDIR=%{buildroot} %endif %if %with qt5 make -C build-qt5 install DESTDIR=%{buildroot} %endif %post qt4 -p /sbin/ldconfig %postun qt4 -p /sbin/ldconfig %post qt5 -p /sbin/ldconfig %postun qt5 -p /sbin/ldconfig %if %with qt4 %files qt4 %{_libdir}/libqtxdg.so.* %{_datadir}/libqtxdg %doc COPYING AUTHORS %files qt4-devel %{_libdir}/libqtxdg.so %{_libdir}/pkgconfig/qtxdg.pc %{_includedir}/qtxdg %{_datadir}/cmake/qtxdg %endif %if %with qt5 %files qt5 %{_libdir}/libQt5Xdg.so.* %{_datadir}/libqt5xdg %doc COPYING AUTHORS %files qt5-devel %{_libdir}/libQt5Xdg.so %{_libdir}/pkgconfig/Qt5Xdg.pc %{_includedir}/qt5xdg %{_datadir}/cmake/qt5xdg %endif %changelog * Fri Sep 26 2014 TI_Eugene 0.5.3-1 - Initial packaging (fork of libqtxdg)