7a13a94
Name:           qhexedit2
34b42e8
# Remember to also update version in qhexedit2_build.patch in the setup.py hunk
ad50617
Version:        0.8.3
fe5f79d
Release:        7%{?dist}
7a13a94
Summary:        Binary Editor for Qt
7a13a94
7a13a94
License:        LGPLv2
8abe31a
URL:            https://github.com/Simsys/qhexedit2
ac72ca1
Source0:        https://github.com/Simsys/qhexedit2/archive/v%{version}/%{name}-%{version}.tar.gz
7a13a94
Source1:        qhexedit.desktop
7a13a94
7a13a94
# Fix build issues
7a13a94
Patch0:         qhexedit2_build.patch
7a13a94
aff2daf
BuildRequires:  desktop-file-utils
aff2daf
BuildRequires:  gcc-c++
aff2daf
BuildRequires:  make
7a13a94
BuildRequires:  qt4-devel
3d4c62a
BuildRequires:  qt5-qtbase-devel
aff2daf
BuildRequires:  python2-sip
7a13a94
BuildRequires:  python3-sip
7a13a94
BuildRequires:  PyQt4-devel
7a13a94
BuildRequires:  python3-PyQt4-devel
df0f7e4
BuildRequires:  python-qt5-devel
df0f7e4
BuildRequires:  python3-qt5-devel
7a13a94
3d4c62a
Requires:       %{name}-qt5-libs%{?_isa} = %{version}-%{release}
7a13a94
7a13a94
%description
7a13a94
QHexEdit is a hex editor widget written in C++ for the Qt framework.
7a13a94
It is a simple editor for binary data, just like QPlainTextEdit is for text
7a13a94
data.
7a13a94
7a13a94
7a13a94
%package libs
3d4c62a
Summary:        %{name} Qt4 library
7a13a94
7a13a94
%description libs
3d4c62a
%{name} Qt4 library.
7a13a94
7a13a94
7a13a94
%package        devel
3d4c62a
Summary:        Development files for %{name} Qt4
7a13a94
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
7a13a94
7a13a94
%description    devel
7a13a94
The %{name}-devel package contains libraries and header files for
3d4c62a
developing applications that use %{name} Qt4.
3d4c62a
df0f7e4
###############################################################################
3d4c62a
3d4c62a
%package qt5-libs
3d4c62a
Summary:        %{name} Qt5 library
3d4c62a
3d4c62a
%description qt5-libs
3d4c62a
%{name} Qt5 library.
3d4c62a
3d4c62a
3d4c62a
%package        qt5-devel
3d4c62a
Summary:        Development files for %{name} Qt5
3d4c62a
Requires:       %{name}-qt5-libs%{?_isa} = %{version}-%{release}
3d4c62a
3d4c62a
%description    qt5-devel
3d4c62a
The %{name}-qt5-devel package contains libraries and header files for
3d4c62a
developing applications that use %{name} Qt5.
7a13a94
df0f7e4
###############################################################################
7a13a94
7a13a94
%package        doc
7a13a94
Summary:        Documentation and examples for %{name}
7a13a94
Provides:       bundled(jquery)
7a13a94
BuildArch:      noarch
7a13a94
7a13a94
%description    doc
7a13a94
The %{name}-doc package contains the documentation and examples for %{name}.
7a13a94
df0f7e4
###############################################################################
7a13a94
ac72ca1
%package -n python2-%{name}
3d4c62a
Summary:        %{name} Qt4 Python2 bindings
7a13a94
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
ac72ca1
%{?python_provide:%python_provide python2-%{name}}
7a13a94
ac72ca1
%description -n python2-%{name}
df0f7e4
%{name} Qt4 Python2 bindings.
7a13a94
7a13a94
ac72ca1
%package -n python2-%{name}-devel
df0f7e4
Summary:        Development files for the %{name} Qt4 Python2 bindings
ac72ca1
Requires:       python2-%{name}%{?_isa} = %{version}-%{release}
7a13a94
Requires:       sip-devel
ac72ca1
%{?python_provide:%python_provide python2-%{name}-devel}
7a13a94
ac72ca1
%description -n python2-%{name}-devel
df0f7e4
Development files for the %{name} Qt4 Python2 bindings.
7a13a94
df0f7e4
###############################################################################
7a13a94
7a13a94
%package -n python3-%{name}
3d4c62a
Summary:        %{name} Qt4 Python3 bindings
7a13a94
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
ac72ca1
%{?python_provide:%python_provide python3-%{name}}
7a13a94
7a13a94
%description -n python3-%{name}
df0f7e4
%{name} Qt4 Python3 bindings.
7a13a94
7a13a94
7a13a94
%package -n python3-%{name}-devel
df0f7e4
Summary:        Development files for the %{name} Qt4 Python3 bindings
7a13a94
Requires:       python3-%{name}%{?_isa} = %{version}-%{release}
7a13a94
Requires:       python3-sip-devel
ac72ca1
%{?python_provide:%python_provide python3-%{name}-devel}
7a13a94
7a13a94
%description -n python3-%{name}-devel
df0f7e4
Development files for the %{name} Qt4 Python3 bindings
df0f7e4
df0f7e4
###############################################################################
df0f7e4
ac72ca1
%package -n python2-%{name}-qt5
df0f7e4
Summary:        %{name} Qt5 Python2 bindings
df0f7e4
Requires:       %{name}-qt5-libs%{?_isa} = %{version}-%{release}
ac72ca1
%{?python_provide:%python_provide python2-%{name}-qt5}
df0f7e4
ac72ca1
%description -n python2-%{name}-qt5
df0f7e4
%{name} Qt5 Python2 bindings.
df0f7e4
df0f7e4
ac72ca1
%package -n python2-%{name}-qt5-devel
df0f7e4
Summary:        Development files for the %{name} Qt5 Python2 bindings
ac72ca1
Requires:       python2-%{name}-qt5%{?_isa} = %{version}-%{release}
df0f7e4
Requires:       sip-devel
ac72ca1
%{?python_provide:%python_provide python2-%{name}-qt5-devel}
df0f7e4
ac72ca1
%description -n python2-%{name}-qt5-devel
df0f7e4
Development files for the %{name} Qt5 Python2 bindings.
df0f7e4
df0f7e4
###############################################################################
df0f7e4
df0f7e4
%package -n python3-%{name}-qt5
df0f7e4
Summary:        %{name} Qt5 Python3 bindings
df0f7e4
Requires:       %{name}-qt5-libs%{?_isa} = %{version}-%{release}
ac72ca1
%{?python_provide:%python_provide python3-%{srcname}-qt5}
df0f7e4
df0f7e4
%description -n python3-%{name}-qt5
df0f7e4
%{name} Qt5 Python3 bindings.
df0f7e4
df0f7e4
df0f7e4
%package -n python3-%{name}-qt5-devel
df0f7e4
Summary:        Development files for the %{name} Qt5 Python3 bindings
df0f7e4
Requires:       python3-%{name}-qt5%{?_isa} = %{version}-%{release}
df0f7e4
Requires:       python3-sip-devel
ac72ca1
%{?python_provide:%python_provide python3-%{srcname}-qt5-devel}
df0f7e4
df0f7e4
%description -n python3-%{name}-qt5-devel
df0f7e4
Development files for the %{name} Qt5 Python3 bindings
7a13a94
7a13a94
7a13a94
%prep
eb051dd
%autosetup -p1 -n %{name}-%{version}
7a13a94
7a13a94
# Prevent rpmlint W: doc-file-dependency /usr/share/doc/qhexedit2-doc/html/installdox /usr/bin/perl
7a13a94
rm -f doc/html/installdox
7a13a94
7a13a94
7a13a94
%build
3d4c62a
# Build library, qt4
3d4c62a
mkdir build-lib-qt4
3d4c62a
pushd build-lib-qt4
df0f7e4
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt4 ../src/qhexedit.pro
eb051dd
%make_build
7a13a94
popd
7a13a94
3d4c62a
# Build sip bindings, qt4, python2
df0f7e4
CFLAGS="%{optflags}" %{__python2} setup.py build --build-base=build-python2-qt4
7a13a94
3d4c62a
# Build sip bindings, qt4, python3
df0f7e4
CFLAGS="%{optflags}" %{__python3} setup.py build --build-base=build-python3-qt4
7a13a94
3d4c62a
# Build library, qt5
3d4c62a
mkdir build-lib-qt5
3d4c62a
pushd build-lib-qt5
df0f7e4
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" %qmake_qt5 ../src/qhexedit.pro
eb051dd
%make_build
3d4c62a
popd
3d4c62a
df0f7e4
# Build sip bindings, qt5, python2
df0f7e4
USE_QT5=1 CFLAGS="%{optflags}" %{__python2} setup.py build --build-base=build-python2-qt5
df0f7e4
df0f7e4
# Build sip bindings, qt5, python3
df0f7e4
USE_QT5=1 CFLAGS="%{optflags}" %{__python3} setup.py build --build-base=build-python3-qt5
df0f7e4
7a13a94
# Build application
7a13a94
mkdir build-example
7a13a94
pushd build-example
3d4c62a
%qmake_qt5 ../example/qhexedit.pro
eb051dd
%make_build
7a13a94
popd
7a13a94
7a13a94
7a13a94
%install
7a13a94
# Library and headers
7a13a94
install -d %{buildroot}%{_includedir}/%{name}
7a13a94
cp -a src/*.h %{buildroot}%{_includedir}/%{name}
7a13a94
install -d %{buildroot}%{_libdir}
3d4c62a
chmod 0755 build-lib-qt4/*.so.*.*
3d4c62a
cp -a build-lib-qt4/*.so* %{buildroot}%{_libdir}
3d4c62a
chmod 0755 build-lib-qt5/*.so.*.*
3d4c62a
cp -a build-lib-qt5/*.so* %{buildroot}%{_libdir}
7a13a94
3d4c62a
# pkg-config files
7a13a94
install -d %{buildroot}%{_libdir}/pkgconfig/
3d4c62a
7a13a94
cat > %{buildroot}%{_libdir}/pkgconfig/%{name}.pc <
7a13a94
libdir=%{_libdir}
7a13a94
includedir=%{_includedir}/%{name}
7a13a94
7a13a94
Name: %{name}
7a13a94
Description: %{summary}
7a13a94
Version: %{version}
ad50617
Cflags: -I\${includedir}
7a13a94
Libs: -L\${libdir} -lqhexedit
7a13a94
EOF
7a13a94
3d4c62a
cat > %{buildroot}%{_libdir}/pkgconfig/%{name}-qt5.pc <
3d4c62a
libdir=%{_libdir}
3d4c62a
includedir=%{_includedir}/%{name}
3d4c62a
3d4c62a
Name: %{name}-qt5
3d4c62a
Description: %{summary}
3d4c62a
Version: %{version}
3d4c62a
Cflags: -I\${includedir}
3d4c62a
Libs: -L\${libdir} -lqhexedit-qt5
3d4c62a
EOF
3d4c62a
7a13a94
7a13a94
# Python bindings
df0f7e4
# Distutils does not support --build-base with install, you need to build also...
df0f7e4
CFLAGS="%{optflags}" %{__python2} setup.py build --build-base=build-python2-qt4 install --skip-build --root %{buildroot}
df0f7e4
CFLAGS="%{optflags}" %{__python3} setup.py build --build-base=build-python3-qt4 install --skip-build --root %{buildroot}
df0f7e4
USE_QT5=1 CFLAGS="%{optflags}" %{__python2} setup.py build --build-base=build-python2-qt5 install --skip-build --root %{buildroot}
df0f7e4
USE_QT5=1 CFLAGS="%{optflags}" %{__python3} setup.py build --build-base=build-python3-qt5 install --skip-build --root %{buildroot}
df0f7e4
install -Dpm 0644 src/qhexedit.sip %{buildroot}%{_datadir}/sip/qhexedit/qhexedit.sip
df0f7e4
install -Dpm 0644 src/qhexedit.sip %{buildroot}%{_datadir}/python3-sip/qhexedit/qhexedit.sip
7a13a94
7a13a94
# Application
7a13a94
install -Dpm 0755 build-example/qhexedit %{buildroot}%{_bindir}/qhexedit
7a13a94
desktop-file-install --dir=%{buildroot}%{_datadir}/applications/ %{SOURCE1}
7a13a94
7a13a94
7a13a94
%post
7a13a94
/usr/bin/update-desktop-database &> /dev/null || :
7a13a94
7a13a94
%postun
7a13a94
/usr/bin/update-desktop-database &> /dev/null || :
7a13a94
7a13a94
7a13a94
%post libs -p /sbin/ldconfig
7a13a94
7a13a94
%postun libs -p /sbin/ldconfig
7a13a94
3d4c62a
%post qt5-libs -p /sbin/ldconfig
3d4c62a
3d4c62a
%postun qt5-libs -p /sbin/ldconfig
3d4c62a
7a13a94
7a13a94
%files
7a13a94
%{_bindir}/qhexedit
7a13a94
%{_datadir}/applications/qhexedit.desktop
7a13a94
7a13a94
%files libs
3d4c62a
%doc doc/release.txt
3d4c62a
%license src/license.txt
ad50617
%{_libdir}/libqhexedit.so.4*
7a13a94
7a13a94
%files devel
7a13a94
%{_includedir}/%{name}/
3d4c62a
%{_libdir}/libqhexedit.so
7a13a94
%{_libdir}/pkgconfig/%{name}.pc
7a13a94
3d4c62a
%files qt5-libs
3d4c62a
%doc doc/release.txt
3d4c62a
%license src/license.txt
ad50617
%{_libdir}/libqhexedit-qt5.so.4*
3d4c62a
3d4c62a
%files qt5-devel
3d4c62a
%{_includedir}/%{name}/
3d4c62a
%{_libdir}/libqhexedit-qt5.so
3d4c62a
%{_libdir}/pkgconfig/%{name}-qt5.pc
3d4c62a
7a13a94
%files doc
8abe31a
%license src/license.txt
7a13a94
%doc doc/html
7a13a94
ac72ca1
%files -n python2-%{name}
df0f7e4
%{python2_sitearch}/qhexedit.so
df0f7e4
%{python2_sitearch}/QHexEdit-%{version}-*.egg-info
7a13a94
ac72ca1
%files -n python2-%{name}-devel
7a13a94
%{_datadir}/sip/qhexedit/
7a13a94
7a13a94
%files -n python3-%{name}
df0f7e4
%{python3_sitearch}/qhexedit.*.so
df0f7e4
%{python3_sitearch}/QHexEdit-%{version}-*.egg-info
7a13a94
7a13a94
%files -n python3-%{name}-devel
7a13a94
%{_datadir}/python3-sip/qhexedit/
7a13a94
ac72ca1
%files -n python2-%{name}-qt5
df0f7e4
%{python2_sitearch}/qhexedit-qt5.so
df0f7e4
%{python2_sitearch}/QHexEdit_qt5-%{version}-*.egg-info
df0f7e4
ac72ca1
%files -n python2-%{name}-qt5-devel
df0f7e4
%{_datadir}/sip/qhexedit/
df0f7e4
df0f7e4
%files -n python3-%{name}-qt5
df0f7e4
%{python3_sitearch}/qhexedit-qt5.*.so
df0f7e4
%{python3_sitearch}/QHexEdit_qt5-%{version}-*.egg-info
df0f7e4
df0f7e4
%files -n python3-%{name}-qt5-devel
df0f7e4
%{_datadir}/python3-sip/qhexedit/
df0f7e4
7a13a94
%changelog
fe5f79d
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 0.8.3-7
fe5f79d
- Rebuilt for Python 3.7
fe5f79d
aff2daf
* Wed Mar 07 2018 Sandro Mani <manisandro@gmail.com> - 0.8.3-6
aff2daf
- Add missing BR: gcc-c++, make
aff2daf
1991dad
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-5
1991dad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1991dad
49f3d52
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-4
49f3d52
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
49f3d52
794ce31
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-3
794ce31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
794ce31
9d05b68
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-2
9d05b68
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
9d05b68
ad50617
* Tue Jan 10 2017 Sandro Mani <manisandro@gmail.com> - 0.8.3-1
ad50617
- Update to 0.8.3
ad50617
8287be7
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.8.1-2
8287be7
- Rebuild for Python 3.6
8287be7
5b0a3cf
* Wed Nov 09 2016 Sandro Mani <manisandro@gmail.com> - 0.8.1-1
5b0a3cf
- Update to 0.8.1
5b0a3cf
eb051dd
* Wed Aug 03 2016 Sandro Mani <manisandro@gmail.com> - 0.7.8-1
eb051dd
- Update to 0.7.8
eb051dd
6c118bd
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.7-2
6c118bd
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
6c118bd
b65c63d
* Fri Apr 15 2016 Sandro Mani <manisandro@gmail.com> - 0.7.7-1
b65c63d
- Update to 0.7.7
b65c63d
ac72ca1
* Sat Apr 09 2016 Sandro Mani <manisandro@gmail.com> - 0.7.6-1
ac72ca1
- Update to 0.7.6
ac72ca1
41704be
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.4-3
41704be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
41704be
3d6ce09
* Thu Nov 12 2015 Kalev Lember <klember@redhat.com> - 0.7.4-2
3d6ce09
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
3d6ce09
34b42e8
* Fri Sep 18 2015 Sandro Mani <manisandro@gmail.com> - 0.7.4-1
34b42e8
- Update to 0.7.4
34b42e8
d612c1e
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.3-2
d612c1e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
d612c1e
df0f7e4
* Thu Jun 04 2015 Sandro Mani <manisandro@gmail.com> - 0.7.3-1
df0f7e4
- Update to 0.7.3
df0f7e4
4e161a0
* Wed May 20 2015 Sandro Mani <manisandro@gmail.com> - 0.7.2-1
4e161a0
- Update to 0.7.2
4e161a0
addbd64
* Fri May 01 2015 Sandro Mani <manisandro@gmail.com> - 0.6.6-1
addbd64
- Update to 0.6.6
addbd64
3d4c62a
* Wed Apr 29 2015 Sandro Mani <manisandro@gmail.com> - 0.6.5-2
3d4c62a
- Build Qt5 library
3d4c62a
8abe31a
* Thu Apr 16 2015 Sandro Mani <manisandro@gmail.com> - 0.6.5-1
8abe31a
- Update to 0.6.5
8abe31a
ecfd90a
* Tue Dec 16 2014 Sandro Mani <manisandro@gmail.com> - 0.6.3-3.20141212svnr41
ecfd90a
- Fix incorrect Requires
ecfd90a
7a13a94
* Fri Dec 12 2014 Sandro Mani <manisandro@gmail.com> - 0.6.3-2.20141212svnr41
7a13a94
- Update source file name to include svn revision
7a13a94
- Fix license LGPLv2+ -> LGPLv2
7a13a94
- Added -Wl,--as-needed to fix unused-direct-shlib-dependency
7a13a94
7a13a94
* Sun Aug 10 2014 Sandro Mani <manisandro@gmail.com> - 0.6.3-1
7a13a94
- Initial package