python-pefile/python-pefile.spec

76 lines
2.3 KiB
RPMSpec
Raw Normal View History

2019-09-24 09:06:27 +00:00
Name: python-pefile
Version: 2024.8.26
Release: %autorelease
2019-09-24 09:06:27 +00:00
Summary: Python module for working with Portable Executable files
License: MIT
URL: https://github.com/erocarrera/pefile
%global srcname pefile
%global common_desc pefile is a multi-platform Python module to read and work with Portable\
Executable (aka PE) files. Most of the information in the PE Header is \
accessible, as well as all the sections, section's information and data.\
pefile requires some basic understanding of the layout of a PE file. Armed \
with it it's possible to explore nearly every single feature of the file.\
Some of the tasks that pefile makes possible are:\
* Modifying and writing back to the PE image\
* Header Inspection\
* Sections analysis\
* Retrieving data\
* Warnings for suspicious and malformed values\
* Packer detection with PEiDs signatures\
* PEiD signature generation\
2021-05-13 21:57:51 +00:00
#Source0: https://github.com/erocarrera/%%{srcname}/archive/v%%{version}/%%{srcname}-%%{version}.tar.gz
2019-09-24 09:06:27 +00:00
Source0: https://github.com/erocarrera/%{srcname}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz
Source1: pefile-tests.sh
2009-05-11 15:11:16 +00:00
BuildArch: noarch
2016-11-01 20:15:16 +00:00
2021-05-13 21:57:51 +00:00
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
2017-07-25 17:10:32 +00:00
2016-11-01 20:15:16 +00:00
# For the patch
# BuildRequires: git-core
2009-05-11 15:11:16 +00:00
%description
%{common_desc}
2013-08-08 01:20:25 +00:00
2021-05-13 21:57:51 +00:00
%package -n python%{python3_pkgversion}-%{srcname}
Summary: %{summary}
2021-05-13 21:57:51 +00:00
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
2009-05-11 15:11:16 +00:00
2021-05-13 21:57:51 +00:00
%description -n python%{python3_pkgversion}-%{srcname}
%{common_desc}
2009-05-11 15:11:16 +00:00
%prep
%autosetup -n %{srcname}-%{version}
2016-11-01 20:46:00 +00:00
sed -i -e '/^#!\//, 1d' pefile.py
2009-05-11 15:11:16 +00:00
%build
%py3_build
2009-05-11 15:11:16 +00:00
%install
%py3_install
mkdir -p %{buildroot}%{_datadir}/%{name}
cp %{SOURCE1} %{buildroot}%{_datadir}/%{name}
2009-05-11 15:11:16 +00:00
%check
%py3_check_import pefile peutils ordlookup
2019-09-24 09:06:27 +00:00
# regression tests in this package are based on binary blob of exe files - commercial and malware
# at this point (2019-09-20) not suitable to be in Fedora.
# More info on:
# https://github.com/erocarrera/pefile/issues/171
# https://github.com/erocarrera/pefile/issues/82#issuecomment-192018385
2021-05-13 21:57:51 +00:00
# %%{__python3} setup.py test
2021-05-13 21:57:51 +00:00
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%{python3_sitelib}/*
%{_datadir}/%{name}
2009-05-11 15:11:16 +00:00
%changelog
%autochangelog