diff --git a/base/libunibreak/libunibreak.spec b/base/libunibreak/libunibreak.spec new file mode 100644 index 0000000..7f6744d --- /dev/null +++ b/base/libunibreak/libunibreak.spec @@ -0,0 +1,185 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.1) +## 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/adah1972/libunibreak + +Name: libunibreak +Version: 6.1 +Release: %autorelease +Summary: A Unicode line-breaking library +# Upstream uses tags of the form `libunibreak_X_Y` +%global tag %{name}_%{lua: v = string.gsub(rpm.expand('%{version}'), '%.', '_'); print(v) } +%forgemeta +# SPDX identifier +License: Zlib +URL: %forgeurl +Source0: %forgesource +# test files from Unicode, see `download_sources_for_offline_build.sh` +# License: Unicode-3.0 +Source1: libunibreak-test-data.tar.gz + +# don't download test data +Patch0: offline_files.patch +# remove unused var and other build fixes +Patch1: remove_unused_var.patch + +# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: %{ix86} + +BuildRequires: gcc +BuildRequires: make +BuildRequires: automake, autoconf, libtool + +%description +Libunibreak is an implementation of the line breaking and word +breaking algorithms as described in Unicode Standard Annex 14 and +Unicode Standard Annex 29. It is designed to be used in a generic text +renderer. + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%forgeautosetup -p1 + +# Install test data files +tar xzf %{SOURCE1} + +# Fix shebang and permissions of Python scripts +sed -r -i 's|^(#!/usr/bin/)env (python)|\1\23|' src/*.py +chmod a+x src/*.py + + +%build +./autogen.sh +%configure --disable-static +%make_build + + +%install +%make_install +find %{buildroot} -name '*.la' -exec rm -f {} ';' + + +%check +%make_build check + +%ldconfig_scriptlets + + +%files +%doc AUTHORS NEWS README.md +%license LICENCE +%{_libdir}/*.so.* + +%files devel +%{_includedir}/* +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc + + +%changelog +## START: Generated by rpmautospec +* Sun Mar 03 2024 Sandro - 6.1-1 +- Update to 6.1 (RHBZ#2266204) +- Update script for downloading test data +- Store test data in side cache (instead of dist-git) +- Rebase patches and drop no longer required patch +- Use glob in .gitignore + +* Thu Jan 25 2024 Fedora Release Engineering - 5.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 5.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Nov 09 2023 Sandro - 5.1-7 +- Fix Release: + +* Wed Nov 01 2023 Sandro - 5.1-6 +- Stop building for i686 + +* Wed Nov 01 2023 Sandro - 5.1-5 +- Drop `liblinebreak` Provides: and Obsoletes: + +* Wed Nov 01 2023 Sandro - 5.1-4 +- Drop changes for regenerating src/*data.c + +* Tue Oct 31 2023 Sandro - 5.1-3 +- Migrate to SPDX license + +* Tue Oct 31 2023 Sandro - 5.1-2 +- Rename patches and stop enumeration +- Update patches as required +- Add script for updating external sources +- Add BRs for running `autogen.sh` + +* Mon Oct 30 2023 Sandro - 5.1-1 +- Update to 5.1 + +* Mon Oct 30 2023 Sandro - 4.0-17 +- Add missing dependencies for `autogen.sh` +- Update patch + +* Mon Oct 30 2023 Sandro - 4.0-16 +- Use forge macros +- Mangle the version (upstream uses lubunibreak_X_Y tags) + +* Thu Jul 20 2023 Fedora Release Engineering - 4.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 4.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 4.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 4.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sun Aug 15 2021 Andy Mender - 4.0-9 +- Switch URL to GitHub +- Add patch to remove unused var in tests.c + +* Thu Jul 22 2021 Fedora Release Engineering - 4.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 4.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 4.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 4.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 4.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Aug 28 2018 Michel Alexandre Salim - 4.0-2 +- Properly disable broken tests, run the rest + +* Thu Aug 23 2018 Michel Alexandre Salim - 4.0-1 +- Update to 4.0 + +* Sat Jun 4 2016 Michel Alexandre Salim - 3.0-1 +- Initial package + +## END: Generated by rpmautospec diff --git a/base/libunibreak/offline_files.patch b/base/libunibreak/offline_files.patch new file mode 100644 index 0000000..5f16391 --- /dev/null +++ b/base/libunibreak/offline_files.patch @@ -0,0 +1,66 @@ +diff --git a/src/Makefile.am b/src/Makefile.am +index 9a2b420..604180b 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -57,26 +57,7 @@ distclean-local: + rm -f LineBreak.txt WordBreakData.txt GraphemeBreakData.txt DerivedCoreProperties.txt EastAsianWidth.txt emoji-data.txt + + +-LineBreak.txt: +- wget http://unicode.org/Public/UNIDATA/LineBreak.txt +- +-WordBreakProperty.txt: +- wget http://www.unicode.org/Public/UNIDATA/auxiliary/WordBreakProperty.txt +- +-GraphemeBreakProperty.txt: +- wget http://www.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakProperty.txt +- +-DerivedCoreProperties.txt: +- wget https://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt +- +-EastAsianWidth.txt: +- wget https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt +- +-emoji-data.txt: +- wget https://www.unicode.org/Public/UNIDATA/emoji/emoji-data.txt +- +- +-linebreakdata: LineBreak.txt ++linebreakdata: + sed -E -n -f ${srcdir}/extract_data.sed LineBreak.txt | \ + sed -E -f ${srcdir}/expand_single.sed | \ + ${srcdir}/generate_linebreakdata.py > tmp.c +@@ -84,27 +65,23 @@ linebreakdata: LineBreak.txt + cat ${srcdir}/linebreakdata1.tmpl tmp.txt tmp.c > ${srcdir}/linebreakdata.c + rm tmp.txt tmp.c + +-wordbreakdata: WordBreakProperty.txt ++wordbreakdata: + ${srcdir}/generate_word_break.py > ${srcdir}/wordbreakdata.c + +-graphemebreakdata: GraphemeBreakProperty.txt ++graphemebreakdata: + ${srcdir}/generate_grapheme_break.py > ${srcdir}/graphemebreakdata.c + +-eastasianwidthdata: EastAsianWidth.txt ++eastasianwidthdata: + ${srcdir}/generate_east_asian_width.py > ${srcdir}/eastasianwidthdata.c + +-indicconjunctbreakdata: DerivedCoreProperties.txt ++indicconjunctbreakdata: + ${srcdir}/generate_indic_conjunct_break.py > ${srcdir}/indicconjunctbreakdata.c + +-emojidata: emoji-data.txt ++emojidata: + ${srcdir}/generate_extended_pictographic.py > ${srcdir}/emojidata.c + + update-test: +- rm -f WordBreakTest.txt GraphemeBreakTest.txt +- rm -f ${srcdir}/WordBreakTest.txt ${srcdir}/GraphemeBreakTest.txt +- wget http://www.unicode.org/Public/UNIDATA/auxiliary/WordBreakTest.txt +- wget http://www.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakTest.txt +- [ -f ${srcdir}/WordBreakTest.txt ] || mv -f WordBreakTest.txt GraphemeBreakTest.txt ${srcdir} ++ [ -f ${srcdir}/WordBreakTest.txt && -f ${srcdir}/GraphemeBreakTest.txt ] || exit 42 + + + # Tests diff --git a/base/libunibreak/remove_unused_var.patch b/base/libunibreak/remove_unused_var.patch new file mode 100644 index 0000000..b86b29f --- /dev/null +++ b/base/libunibreak/remove_unused_var.patch @@ -0,0 +1,37 @@ +diff --git a/src/tests.c b/src/tests.c +index 2135144..658c919 100644 +--- a/src/tests.c ++++ b/src/tests.c +@@ -57,7 +57,7 @@ int main(int argc, char *argv[]) + clock_t t1; + clock_t t2; + +- char noBreak, mustBreak, insideChar; ++ char noBreak, mustBreak; + const unsigned int *testSkips; /* Zero terminated array of line numbers to skip in the test. */ + + if (argc != 2) +@@ -72,7 +72,6 @@ int main(int argc, char *argv[]) + testType = TEST_TYPE_LINE; + noBreak = LINEBREAK_NOBREAK; + mustBreak = LINEBREAK_MUSTBREAK; +- insideChar = LINEBREAK_INSIDEACHAR; + testSkips = testSkipsLine; + break; + case 'w': +@@ -80,7 +79,6 @@ int main(int argc, char *argv[]) + testType = TEST_TYPE_WORD; + noBreak = WORDBREAK_NOBREAK; + mustBreak = WORDBREAK_BREAK; +- insideChar = WORDBREAK_INSIDEACHAR; + testSkips = testSkipsWord; + break; + case 'g': +@@ -88,7 +86,6 @@ int main(int argc, char *argv[]) + testType = TEST_TYPE_GRAPHEME; + noBreak = GRAPHEMEBREAK_NOBREAK; + mustBreak = GRAPHEMEBREAK_BREAK; +- insideChar = GRAPHEMEBREAK_INSIDEACHAR; + testSkips = testSkipsGrapheme; + break; + default: