## START: Set by rpmautospec ## (rpmautospec version 0.3.8) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global forgeurl https://github.com/seamustuohy/RTFDE Name: python-rtfde Version: 0.1.1 Release: %autorelease Summary: A library for extracting HTML content from RTF encapsulated HTML %global tag %{version} %forgemeta License: LGPL-3.0-only URL: %forgeurl Source: %forgesource BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-lxml %global _description %{expand: RTFDE: RTF De-Encapsulator A python3 library for extracting encapsulated HTML & plain text content from the RTF bodies of .msg files. De-encapsulation enables previously encapsulated HTML and plain text content to be extracted and rendered as HTML and plain text instead of the encapsulating RTF content. After de-encapsulation, the HTML and plain text should differ only minimally from the original HTML or plain text content. Features - De-encapsulate HTML from RTF encapsulated HTML - De-encapsulate plain text from RTF encapsulated text Known Issues - This library _fully_ unquotes text it de-encapsulates because it does not know which text was quoted in the RTF conversion process and which text was quoted in the original html/text. So, for instance escaped Quoted-Printable text will be returned un-escaped. - This library currently can't combine attachments from a .MSG Message object with the de-encapsulated HTML. This is mostly because I could not get a good set of examples of encapsulated HTML which had attachment objects that needed to be integrated back into the body of the HTML. Anti-Features (I don't intend to have this library do this.) - Extract plain text from RTF encapsulated HTML. If you want this, then you will have to parse the HTML using another library.} %description %_description %package -n python3-rtfde Summary: %{summary} %description -n python3-rtfde %_description %package doc Summary: Documentation for %{name} Requires: python3-rtfde = %{?epoch:%{epoch}:}%{version}-%{release} %description doc Markdown and HTML documentation for %{name}. %prep %forgeautosetup -p1 # Re-arrange docs for easy import in %%files pushd docs mkdir html mv RTFDE/*.html html/ mv RTFDE/*.md . popd # Loosen upper bound on lark # In F38- lark is provided by python-lark-parser as lark-parser %if %{?fedora} <= 38 sed -i -r 's/lark==1.[0-9].[0-9]/lark-parser>=0.9/' setup.py %else sed -i -r 's/lark==1.[0-9].[0-9]/lark>=1.1.7/' setup.py %endif %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files RTFDE %check %pytest %files -n python3-rtfde -f %{pyproject_files} %doc README.md CONTRIBUTING.md %files doc %doc docs/*.md docs/html %changelog ## START: Generated by rpmautospec * Sat Dec 09 2023 Sandro - 0.1.1-1 - Update to 0.1.1 - Fixes license preambles - Drop obsolete patches (merged upstream) - Improve regex for lark upper bound - Drop use of commit (upstream now provides tags and releases) * Tue Nov 21 2023 Sandro - 0.1.0-2 - Fix license tag based on upstream's feedback * Sat Nov 11 2023 Sandro - 0.1.0-1 - Changes brought up in package review - Use canonical project name for the package - Add GPL-3.0-only license for the time being ## END: Generated by rpmautospec