%define wx_version_major 2 %define wx_version_minor 8 %define wx_version %{wx_version_major}.%{wx_version_minor} %define force_wx_gtk2 %{nil} %define force_wx_gtk2 0 ################################################################################ %define wx_name_postfix %{nil} %if 0%{?wx_version_major} >= 3 %if 0%{?wx_version_minor} == 0 %define wx_name_postfix %{wx_version_major} %else %define wx_name_postfix %{wx_version_major}%{wx_version_minor} %endif %endif # Force toolkit # e.g. gtk2 instead of gtk3 %define wx_toolkit %{nil} %if 0%{?force_wx_gtk2} %if 0%{?wx_version_major} >= 3 %if 0%{?wx_version_minor} == 0 %define wx_toolkit gtk2 %endif %endif %endif %define _name wxHexEditor # Use system mhash library. %define system_mhash %{nil} %define system_mhash 1 %define doc_license %{nil} %define doc_license 1 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} < 7 %define doc_license 0 %endif %else %if 0%{?fedora} < 19 %define doc_license 0 %endif %endif %endif %define license_files docs/GPL.txt docs/LICENSE-udis86 %undefine update_mime_database_n %if 0%{?fedora}%{?rhel} %define update_mime_database_n 1 %endif %define python2_package python2 %if 0%{?rhel}%{?fedora} %if 0%{?rhel} %if 0%{?rhel} <= 7 %define python2_package python %endif %else %if 0%{?fedora} <= 25 %define python2_package python %endif %endif %endif %define python3_package python%{python3_pkgversion} Name: wxhexeditor Summary: A hex editor for view/edit huge files and devices Version: 0.23 Release: 20%{?dist} License: GPL Group: Editors #URL: http://wxhexeditor.sourceforge.net/ URL: https://github.com/EUA/wxHexEditor #Source0: http://sourceforge.net/projects/wxhexeditor/files/wxHexEditor/v%{version}%20Beta/%{_name}-v%{version}-src.tar.bz2 Source0: https://github.com/EUA/wxHexEditor/archive/v%{version}.tar.gz#/%{_name}-%{version}.tar.gz # http://wklej.org/hash/4de77031f7b/txt/ # checking build system type... ./config.guess: unable to guess system type # https://forums.fedoraforum.org/showpost.php?p=1587482&postcount=2 Source1: config.guess Source2: config.sub # Backport patches from openSUSE # PATCH-FIX-OPENSUSE wxhexeditor-0.23-mhash.patch lazy.kent@opensuse.org -- Use system mhash library. #Patch0: wxhexeditor-0.23-mhash.patch Patch0: wxhexeditor-0.23-system-mhash.patch # PATCH-FIX-OPENSUSE wxhexeditor-remove-debug.patch zaitor@opensuse.org -- Remove debug msg that include nonsense. #Patch1: wxhexeditor-remove-debug.patch Patch1: wxhexeditor-0.23-remove-debug.patch # PATCH-FIX-UPSTREAM wxhexeditor-fixdesktopfile.patch davejplater@gmail.com -- Fix desktop file #Patch2: wxhexeditor-fixdesktopfile.patch Patch2: wxhexeditor-0.23-desktopfile-keywords.patch BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: automake BuildRequires: autoconf BuildRequires: libtool BuildRequires: gettext # checking for python... no # configure: error: Python not found. Use --with-python to specify path to python binary # make: *** [Makefile:68: udis86/libudis86/.libs/libudis86.a] Error 1 BuildRequires: %{python2_package} BuildRequires: %{python3_package} %if 0%{?system_mhash} BuildRequires: mhash-devel %endif %if "%{?wx_toolkit}" != "" BuildRequires: compat-wxGTK%{?wx_name_postfix}-%{wx_toolkit}-devel %else BuildRequires: wxGTK%{?wx_name_postfix}-devel %endif %description wxHexEditor is another GUI hex editor for open HUGE files and devices in linux mainland. Designed for reverse engineering binary files. With wxHexEditor, you can edit huge files and devices like (hdd/sdd). This programs supports tagging parts of the file for taking notes and make it easier reverse engineer huge binary files. %prep #%setup -q -n "%{_name}" %setup -q -n "%{_name}"-%{version} %if 0%{?system_mhash} %patch0 -p1 %endif %patch1 -p1 %patch2 -p1 sed -i 's|-fopenmp|-fopenmp -fPIC|' Makefile sed -i 's|$CFLAGS -Wall|$CFLAGS -Wall -fPIC|' udis86/configure.ac sed -i 's|-Wall|-Wall -fPIC|' mhash/configure sed -i 's|abs(|fabs(|' src/HexEditorCtrl/HexEditorCtrl.h %{__cp} udis86/LICENSE docs/LICENSE-udis86 chmod -x docs/* # update config.guess and config.sub to support ppc64le find * -xtype f -name 'config.guess' | xargs -I{} %{__cp} '%{SOURCE1}' '{}' find * -xtype f -name 'config.sub' | xargs -I{} %{__cp} '%{SOURCE2}' '{}' find * -xtype f \( -name 'config.guess' -o -name 'config.sub' \) | xargs -I{} chmod +x '{}' %build CFLAGS="${RPM_OPT_FLAGS} -fPIC" export CFLAGS CXXFLAGS="${RPM_OPT_FLAGS} -fPIC" export CXXFLAGS %if 0%{wx_version_major} < 3 WXCONFIG="wx-config" %else WXCONFIG="wx-config-%{wx_version}" %endif export WXCONFIG %if "%{?wx_toolkit}" != "" if hash "${WXCONFIG}-%{?wx_toolkit}" >/dev/null 2>&1 ; then WXCONFIG="${WXCONFIG}-%{?wx_toolkit}" export WXCONFIG fi %endif sed -i -re "/^[[:blank:]]*WXCONFIG[[:blank:]]*=[[:blank:]]*/ {s|(^[[:blank:]]*WXCONFIG[[:blank:]]*=[[:blank:]]*).*$|\1${WXCONFIG}|;:a;n;ba}" Makefile %{__make} WXCONFIG="${WXCONFIG}" %{?_smp_mflags} %install #%{__install} -D -m 755 "%{_name}" "%{buildroot}%{_bindir}/%{_name}" #%{__install} -D -m 644 "resources/%{_name}.png" "%{buildroot}%{_datadir}/pixmaps/%{_name}.png" #%{__install} -D -m 644 "resources/%{_name}.desktop" "%{buildroot}%{_datadir}/applications/%{_name}.desktop" %{make_install} PREFIX=%{_prefix} # Localization %find_lang %{_name} %{__ln_s} "%{_name}" "%{buildroot}%{_bindir}/%{name}" %clean %{__rm} -rf "%{buildroot}" %post #/bin/touch --no-create "%{_datadir}/icons/hicolor" &>/dev/null || : /usr/bin/update-mime-database "%{_datadir}/mime" &> /dev/null || : update-desktop-database &> /dev/null || : /sbin/ldconfig %postun if [[ "${1}" -eq "0" ]] ; then # /bin/touch --no-create "%{_datadir}/icons/hicolor" &>/dev/null # /usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &>/dev/null || : /usr/bin/update-mime-database "%{_datadir}/mime" &> /dev/null || : fi update-desktop-database &> /dev/null || : /sbin/ldconfig %posttrans #/usr/bin/gtk-update-icon-cache "%{_datadir}/icons/hicolor" &>/dev/null || : /usr/bin/update-mime-database %{?update_mime_database_n:-n} %{_datadir}/mime &> /dev/null || : %files %defattr(-,root,root) %if 0%{?doc_license} %license %{license_files} %else %doc %{license_files} %endif %doc docs/Change.log %{_bindir}/%{_name} %{_bindir}/%{name} %{_datadir}/applications/%{_name}.desktop %{_datadir}/pixmaps/%{_name}.png %{_datadir}/locale/*/LC_MESSAGES/%{_name}.mo %changelog * Thu Nov 02 2017 Tomasz Tomasik - 0.23-20 - Return to wxGTK 2.8 - Update additional macros for wxGTK - Rebuilt for EL7 * Fri Oct 27 2017 Tomasz Tomasik - 0.23-19 - Backport patches from openSUSE: https://build.opensuse.org/package/show/home%3Arabin-io/wxhexeditor - Use system mhash library - Rebuilt for EL7 * Fri Oct 27 2017 Tomasz Tomasik - 0.23-18 - Rebuilt against wxGTK3 instead of wxGTK 2.8 - Update requirements: python2 and python3 - Rebuilt for EL7 * Fri Oct 27 2017 Tomasz Tomasik - 0.23-17 - Add a few changes to the SPEC file - Update URL and Source - Update requirements - Update prep, build, install and files sections - Add post, postun and posttrans sections - Update config.guess and config.sub to support ppc64le - Rebuilt for EL7 * Mon Oct 23 2017 Huaren Zhong - 0.23-16.1 - Rebuild for Fedora * Wed Feb 25 2015 Huaren Zhong - 0.23 - Rebuild for Fedora * Sat Mar 19 2011 Erdem U. Altinyurt - 0.10-0 - fixed OpenSUSE 11.4 compilation * Fri Apr 23 2010 Erdem U. Altinyurt - 0.09-0 - closing to final * Mon Feb 9 2009 Erdem U. Altinyurt - 0.08-0 - initial release of rpm