smani pushed to qhexedit2 (f22). "Build qt5 library"
notifications at fedoraproject.org
notifications at fedoraproject.org
Wed Apr 29 21:46:22 UTC 2015
>From 3d4c62ab4509bbf75518ddea64ba041ca34f3ae6 Mon Sep 17 00:00:00 2001
From: Sandro Mani <manisandro at gmail.com>
Date: Wed, 29 Apr 2015 23:44:45 +0200
Subject: Build qt5 library
diff --git a/qhexedit2.spec b/qhexedit2.spec
index 0e6e727..5636505 100644
--- a/qhexedit2.spec
+++ b/qhexedit2.spec
@@ -1,6 +1,6 @@
Name: qhexedit2
Version: 0.6.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Binary Editor for Qt
License: LGPLv2
@@ -12,13 +12,16 @@ Source1: qhexedit.desktop
Patch0: qhexedit2_build.patch
BuildRequires: qt4-devel
+BuildRequires: qt5-qtbase-devel
BuildRequires: sip
BuildRequires: python3-sip
BuildRequires: PyQt4-devel
+BuildRequires: python-qt5-devel
BuildRequires: python3-PyQt4-devel
+BuildRequires: python3-qt5-devel
BuildRequires: desktop-file-utils
-Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires: %{name}-qt5-libs%{?_isa} = %{version}-%{release}
%description
QHexEdit is a hex editor widget written in C++ for the Qt framework.
@@ -27,19 +30,35 @@ data.
%package libs
-Summary: %{name} library
+Summary: %{name} Qt4 library
%description libs
-%{name} library.
+%{name} Qt4 library.
%package devel
-Summary: Development files for %{name}
+Summary: Development files for %{name} Qt4
Requires: %{name}-libs%{?_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-libs
+Summary: %{name} Qt5 library
+
+%description qt5-libs
+%{name} Qt5 library.
+
+
+%package qt5-devel
+Summary: Development files for %{name} Qt5
+Requires: %{name}-qt5-libs%{?_isa} = %{version}-%{release}
+
+%description qt5-devel
+The %{name}-qt5-devel package contains libraries and header files for
+developing applications that use %{name} Qt5.
%package doc
@@ -52,7 +71,7 @@ The %{name}-doc package contains the documentation and examples for %{name}.
%package -n python-%{name}
-Summary: %{name} Python2 bindings
+Summary: %{name} Qt4 Python2 bindings
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python-%{name}
@@ -69,7 +88,7 @@ Development files for the %{name} Python2 bindings.
%package -n python3-%{name}
-Summary: %{name} Python3 bindings
+Summary: %{name} Qt4 Python3 bindings
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python3-%{name}
@@ -94,31 +113,38 @@ rm -f doc/html/installdox
%build
-# Build library
-mkdir build-lib
-pushd build-lib
+# Build library, qt4
+mkdir build-lib-qt4
+pushd build-lib-qt4
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt4 ../sip/qhexedit.pro
make %{?_smp_mflags}
popd
-# Build sip bindings, python2
-mkdir build-sip-py2
-pushd build-sip-py2
+# Build sip bindings, qt4, python2
+mkdir build-sip-qt4-py2
+pushd build-sip-qt4-py2
%{__python2} ../sip/configure.py
make %{?_smp_mflags}
popd
-# Build sip bindings, python2
-mkdir build-sip-py3
-pushd build-sip-py3
+# Build sip bindings, qt4, python3
+mkdir build-sip-qt4-py3
+pushd build-sip-qt4-py3
%{__python3} ../sip/configure.py
make %{?_smp_mflags}
popd
+# Build library, qt5
+mkdir build-lib-qt5
+pushd build-lib-qt5
+LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt5 ../sip/qhexedit.pro
+make %{?_smp_mflags}
+popd
+
# Build application
mkdir build-example
pushd build-example
-%qmake_qt4 ../example/qhexedit.pro
+%qmake_qt5 ../example/qhexedit.pro
make %{?_smp_mflags}
popd
@@ -128,11 +154,14 @@ popd
install -d %{buildroot}%{_includedir}/%{name}
cp -a src/*.h %{buildroot}%{_includedir}/%{name}
install -d %{buildroot}%{_libdir}
-chmod 0755 build-lib/*.so.*.*
-cp -a build-lib/*.so* %{buildroot}%{_libdir}
+chmod 0755 build-lib-qt4/*.so.*.*
+cp -a build-lib-qt4/*.so* %{buildroot}%{_libdir}
+chmod 0755 build-lib-qt5/*.so.*.*
+cp -a build-lib-qt5/*.so* %{buildroot}%{_libdir}
-# pkg-config file
+# pkg-config files
install -d %{buildroot}%{_libdir}/pkgconfig/
+
cat > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc <<EOF
libdir=%{_libdir}
includedir=%{_includedir}/%{name}
@@ -144,10 +173,21 @@ Cflags: -I\${includedir}
Libs: -L\${libdir} -lqhexedit
EOF
+cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc <<EOF
+libdir=%{_libdir}
+includedir=%{_includedir}/%{name}
+
+Name: %{name}-qt5
+Description: %{summary}
+Version: %{version}
+Cflags: -I\${includedir}
+Libs: -L\${libdir} -lqhexedit-qt5
+EOF
+
# Python bindings
-%make_install -C build-sip-py2
-%make_install -C build-sip-py3
+%make_install -C build-sip-qt4-py2
+%make_install -C build-sip-qt4-py3
# Application
install -Dpm 0755 build-example/qhexedit %{buildroot}%{_bindir}/qhexedit
@@ -165,20 +205,35 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{SOURCE1}
%postun libs -p /sbin/ldconfig
+%post qt5-libs -p /sbin/ldconfig
+
+%postun qt5-libs -p /sbin/ldconfig
+
%files
%{_bindir}/qhexedit
%{_datadir}/applications/qhexedit.desktop
%files libs
-%doc src/license.txt doc/release.txt
-%{_libdir}/*.so.*
+%doc doc/release.txt
+%license src/license.txt
+%{_libdir}/libqhexedit.so.1*
%files devel
%{_includedir}/%{name}/
-%{_libdir}/*.so
+%{_libdir}/libqhexedit.so
%{_libdir}/pkgconfig/%{name}.pc
+%files qt5-libs
+%doc doc/release.txt
+%license src/license.txt
+%{_libdir}/libqhexedit-qt5.so.1*
+
+%files qt5-devel
+%{_includedir}/%{name}/
+%{_libdir}/libqhexedit-qt5.so
+%{_libdir}/pkgconfig/%{name}-qt5.pc
+
%files doc
%license src/license.txt
%doc doc/html
@@ -196,6 +251,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{SOURCE1}
%{_datadir}/python3-sip/qhexedit/
%changelog
+* Wed Apr 29 2015 Sandro Mani <manisandro at gmail.com> - 0.6.5-2
+- Build Qt5 library
+
* Thu Apr 16 2015 Sandro Mani <manisandro at gmail.com> - 0.6.5-1
- Update to 0.6.5
diff --git a/qhexedit2_build.patch b/qhexedit2_build.patch
index ff8b185..5e0ac55 100644
--- a/qhexedit2_build.patch
+++ b/qhexedit2_build.patch
@@ -1,6 +1,6 @@
diff -rupN qhexedit2-0.6.5/example/qhexedit.pro qhexedit2-0.6.5-new/example/qhexedit.pro
--- qhexedit2-0.6.5/example/qhexedit.pro 2015-04-16 22:16:26.000000000 +0200
-+++ qhexedit2-0.6.5-new/example/qhexedit.pro 2015-04-16 23:20:57.621822247 +0200
++++ qhexedit2-0.6.5-new/example/qhexedit.pro 2015-04-29 19:21:30.000000000 +0200
@@ -3,10 +3,6 @@ greaterThan(QT_MAJOR_VERSION, 4): QT +=
HEADERS = \
mainwindow.h \
@@ -22,29 +22,38 @@ diff -rupN qhexedit2-0.6.5/example/qhexedit.pro qhexedit2-0.6.5-new/example/qhex
- ../src/commands.cpp \
searchdialog.cpp
-+LIBS = -L../build-lib -lqhexedit
++LIBS = -L../build-lib-qt5 -lqhexedit-qt5
+
RESOURCES = \
qhexedit.qrc
diff -rupN qhexedit2-0.6.5/sip/configure.py qhexedit2-0.6.5-new/sip/configure.py
--- qhexedit2-0.6.5/sip/configure.py 2015-04-16 22:16:26.000000000 +0200
-+++ qhexedit2-0.6.5-new/sip/configure.py 2015-04-16 23:20:57.622822266 +0200
++++ qhexedit2-0.6.5-new/sip/configure.py 2015-04-29 19:21:30.000000000 +0200
@@ -38,7 +38,7 @@ makefile = pyqtconfig.QtGuiModuleMakefil
# Add the library we are wrapping. The name doesn't include any platform
# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
# ".dll" extension on Windows).
-makefile.LFLAGS.append("-L../c++")
-+makefile.LFLAGS.append("-L../build-lib")
++makefile.LFLAGS.append("-L../build-lib-qt4")
makefile.extra_libs = ["qhexedit"]
# Generate the Makefile itself.
diff -rupN qhexedit2-0.6.5/sip/qhexedit.pro qhexedit2-0.6.5-new/sip/qhexedit.pro
--- qhexedit2-0.6.5/sip/qhexedit.pro 2015-04-16 22:16:26.000000000 +0200
-+++ qhexedit2-0.6.5-new/sip/qhexedit.pro 2015-04-16 23:20:57.623822285 +0200
-@@ -21,5 +21,3 @@ SOURCES = \
++++ qhexedit2-0.6.5-new/sip/qhexedit.pro 2015-04-29 19:23:31.189728931 +0200
+@@ -1,4 +1,5 @@
+ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
++equals(QT_MAJOR_VERSION, 5): QTSUFFIX = -qt5
- TARGET = qhexedit
+ TEMPLATE = lib
+
+@@ -19,7 +20,5 @@ SOURCES = \
+
+ # RESOURCES = hexedit.qrc
+
+-TARGET = qhexedit
++TARGET = qhexedit$$QTSUFFIX
-DESTDIR = /usr/lib
-
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/qhexedit2.git/commit/?h=f22&id=3d4c62ab4509bbf75518ddea64ba041ca34f3ae6
More information about the scm-commits
mailing list