commit c8fb7217d1eeea64f33b89288ceb5bc09d48c7c3 Author: MSVSphere Packaging Team Date: Tue Nov 26 15:32:54 2024 +0300 import anthy-unicode-1.0.0.20240502-11.el10 diff --git a/.anthy-unicode.metadata b/.anthy-unicode.metadata new file mode 100644 index 0000000..4d76ba2 --- /dev/null +++ b/.anthy-unicode.metadata @@ -0,0 +1 @@ +18c885dc0821ec675bee95e138ac7acd88ff3a3a SOURCES/anthy-unicode-1.0.0.20240502.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d6f5bb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/anthy-unicode-1.0.0.20240502.tar.gz diff --git a/SOURCES/anthy-unicode-1.0.0.20240502.tar.gz.sum b/SOURCES/anthy-unicode-1.0.0.20240502.tar.gz.sum new file mode 100644 index 0000000..5cf1eac --- /dev/null +++ b/SOURCES/anthy-unicode-1.0.0.20240502.tar.gz.sum @@ -0,0 +1,4 @@ +cksum 2650323057 5196128 anthy-unicode-1.0.0.20240502.tar.gz +sha1sum 18c885dc0821ec675bee95e138ac7acd88ff3a3a anthy-unicode-1.0.0.20240502.tar.gz +sha256sum 43a13f24cc4749a1248bc6d0ce7796743b176ae68ee524cb4331bef64ac133b0 anthy-unicode-1.0.0.20240502.tar.gz +sha512sum 835f7cbd5c3afc3dcd7002b77c94a5c69e67f970584c223b47329ece011148cbc4e9f65332c00bbdbe2f407a2daa7f9e10067a182a27d07074e0f1406bb3bbc2 anthy-unicode-1.0.0.20240502.tar.gz diff --git a/SOURCES/anthy-unicode-HEAD.patch b/SOURCES/anthy-unicode-HEAD.patch new file mode 100644 index 0000000..216e20c --- /dev/null +++ b/SOURCES/anthy-unicode-HEAD.patch @@ -0,0 +1,108 @@ +From a4a42a3c933a2f40023e6c857e60e0bf08a1d913 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Mon, 15 Jul 2024 14:53:17 +0900 +Subject: [PATCH] Fix some compiler warnings + +- src-main/context.c: Fix warning[-Waddress] + &ce->str will always evaluate as 'true' +- mkworddic/mkdic.c: Fix warning[-Wformat-overflow=] + '%s' directive argument is null +--- + mkworddic/mkdic.c | 21 +++++++++------------ + src-main/context.c | 5 ++--- + 2 files changed, 11 insertions(+), 15 deletions(-) + +diff --git a/mkworddic/mkdic.c b/mkworddic/mkdic.c +index b0f9f4c..cb68520 100644 +--- a/mkworddic/mkdic.c ++++ b/mkworddic/mkdic.c +@@ -60,8 +60,6 @@ + + #define DEFAULT_FN "anthy.wdic" + +-static const char *progname; +- + /* writewords.cからアクセスするために、global変数 */ + FILE *yomi_entry_index_out, *yomi_entry_out; + FILE *page_out, *page_index_out; +@@ -127,8 +125,7 @@ open_output_files(void) + } + /**/ + if (!(*(fs->fpp))) { +- fprintf (stderr, "%s: cannot open temporary file: %s\n", +- progname, strerror (errno)); ++ fprintf (stderr, "cannot open temporary file: %s\n", strerror (errno)); + exit (2); + } + } +@@ -142,13 +139,13 @@ flush_output_files (void) + struct file_section *fs; + for (fs = file_array; fs->fpp; fs ++) { + if (ferror(*(fs->fpp))) { +- fprintf (stderr, "%s: write error\n", progname); ++ fprintf (stderr, "write error\n"); + exit (1); + } + } + for (fs = file_array; fs->fpp; fs ++) { + if (fflush(*(fs->fpp))) { +- fprintf (stderr, "%s: write error: %s\n", progname, strerror (errno)); ++ fprintf (stderr, "write error: %s\n", strerror (errno)); + exit (1); + } + } +@@ -793,8 +790,8 @@ copy_file(struct mkdic_stat *mds, FILE *in, FILE *out) + while ((nread = fread (buf, 1, sizeof buf, in)) > 0) { + if (fwrite (buf, 1, nread, out) < nread) { + /* Handle short write (maybe disk full). */ +- fprintf (stderr, "%s: %s: write error: %s\n", +- progname, mds->output_fn, strerror (errno)); ++ fprintf (stderr, "%s: write error: %s\n", ++ mds->output_fn, strerror (errno)); + exit (1); + } + } +@@ -839,8 +836,8 @@ link_dics(struct mkdic_stat *mds) + + fp = fopen (mds->output_fn, "w"); + if (!fp) { +- fprintf (stderr, "%s: %s: cannot create: %s\n", +- progname, mds->output_fn, strerror (errno)); ++ fprintf (stderr, "%s: cannot create: %s\n", ++ mds->output_fn, strerror (errno)); + exit (1); + } + +@@ -856,8 +853,8 @@ link_dics(struct mkdic_stat *mds) + } + + if (fclose (fp)) { +- fprintf (stderr, "%s: %s: write error: %s\n", +- progname, mds->output_fn, strerror (errno)); ++ fprintf (stderr, "%s: write error: %s\n", ++ mds->output_fn, strerror (errno)); + exit (1); + } + } +diff --git a/src-main/context.c b/src-main/context.c +index d84858c..f117f7d 100644 +--- a/src-main/context.c ++++ b/src-main/context.c +@@ -706,12 +706,11 @@ anthy_do_print_context(struct anthy_context *ac, int encoding) + void + anthy_release_cand_ent(struct cand_ent *ce) + { ++ assert (ce); + if (ce->elm) { + free(ce->elm); + } +- if (&ce->str) { +- anthy_free_xstr_str(&ce->str); +- } ++ anthy_free_xstr_str(&ce->str); + free(ce); + } + +-- +2.45.0 + diff --git a/SOURCES/anthy-unicode-init.el b/SOURCES/anthy-unicode-init.el new file mode 100644 index 0000000..b368ce5 --- /dev/null +++ b/SOURCES/anthy-unicode-init.el @@ -0,0 +1,10 @@ +;; anthy-unicode-init.el +;; +(if (featurep 'xemacs) + (setq load-path (cons "/usr/share/xemacs/xemacs-packages/lisp/anthy-unicode" load-path)) + (setq load-path (cons "/usr/share/emacs/site-lisp/anthy-unicode" load-path))) +(autoload 'anthy-unicode-leim-activate "anthy-unicode" nil t) +(register-input-method "japanese-anthy-unicode" "Japanese" + 'anthy-unicode-leim-activate "[anthy-unicode]" + "Anthy Unicode Kana Kanji conversion system") + diff --git a/SPECS/anthy-unicode.spec b/SPECS/anthy-unicode.spec new file mode 100644 index 0000000..193be3a --- /dev/null +++ b/SPECS/anthy-unicode.spec @@ -0,0 +1,197 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 11; + 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 pkg anthy-unicode +%bcond_without autoreconf + +%if (0%{?fedora} > 35 || 0%{?rhel} > 7) +%bcond_with xemacs +%else +%bcond_without xemacs +%endif + + +Name: anthy-unicode +Version: 1.0.0.20240502 +Release: %autorelease +# The entire source code is LGPLv2+ and dictionaries is GPLv2. the corpus data is under Public Domain. +License: LGPL-2.0-or-later AND GPL-2.0-or-later AND LicenseRef-Fedora-Public-Domain +URL: https://github.com/fujiwarat/anthy-unicode/wiki +BuildRequires: emacs +BuildRequires: gcc +BuildRequires: git +%if %{with xemacs} +BuildRequires: xemacs +# overlay.el is required by anthy-unicode.el and anthy-unicode-isearch.el +BuildRequires: xemacs-packages-extra +%endif +%if %{with autoreconf} +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: make +%endif + +Source0: https://github.com/fujiwarat/anthy-unicode/releases/download/%{version}/%{name}-%{version}.tar.gz +Source1: https://github.com/fujiwarat/anthy-unicode/releases/download/%{version}/%{name}-%{version}.tar.gz.sum +Source2: %{name}-init.el +# Upstreamed patches +#Patch0: %%{name}-HEAD.patch +Patch0: %{name}-HEAD.patch + +Summary: Japanese character set input library for Unicode + +%description +Anthy Unicode is another Anthy project and provides the library to input +Japanese on the applications, such as X applications and emacs. and the +user dictionaries and the users information which is used for the conversion, +is stored into their own home directory. So Anthy Unicode is secure than +other conversion server. + +%package -n emacs-%{pkg} +Summary: Emacs files for %{pkg} +Requires: %{name} = %{version}-%{release} +Requires: emacs-filesystem >= %{_emacs_version} +BuildArch: noarch + +%description -n emacs-%{pkg} +This package contains the byte compiled elips packages to run %{pkg} +with GNU Emacs. + +%if %{with xemacs} +%package -n xemacs-%{pkg} +Summary: XEmacs files for %{pkg} +Requires: %{name} = %{version}-%{release} +Requires: xemacs-filesystem >= %{_xemacs_version} +BuildArch: noarch + +%description -n xemacs-%{pkg} +This package contains the elips packages to run %{pkg} with GNU XEmacs. +%endif + +%package devel +Summary: Header files and library for developing programs which uses Anthy Unicode +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description devel +The anthy-devel package contains the development files which is needed to build +the programs which uses Anthy Unicode. + + +%prep +SAVED_SUM=$(grep sha512sum %SOURCE1 | awk '{print $2}') +MY_SUM=$(sha512sum %SOURCE0 | awk '{print $1}') +if test x"$SAVED_SUM" != x"$MY_SUM" ; then + abort +fi +%autosetup -S git + +%build +%if %{with autoreconf} +autoreconf -f -i -v +%endif +%configure --disable-static +make %{?_smp_mflags} + +%install +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" + +# remove unnecessary files +rm $RPM_BUILD_ROOT%{_libdir}/lib*.la + +pushd ./src-util +install -m 644 dic-tool-input $RPM_BUILD_ROOT%{_datadir}/%{pkg} +install -m 644 dic-tool-result $RPM_BUILD_ROOT%{_datadir}/%{pkg} +popd + +## for emacs-anthy +mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_emacs_sitestartdir} + +%if %{with xemacs} +## for xemacs-anthy +mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitestartdir} +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_xemacs_sitestartdir} +# FIXME lisp build +pushd ./src-util +make clean +#make EMACS=xemacs lispdir="%%{_xemacs_sitelispdir}/%%{pkg}" +# The latest /usr/share/automake-*/am/lisp.am calls -L option for +# $(EMACS) --batch but -L is not supported by xemacs. +# Copy elisp-comp script here from old automake +xemacs --batch --eval '(setq load-path (cons nil load-path))' -f batch-byte-compile *.el +make +make install-lispLISP DESTDIR=$RPM_BUILD_ROOT EMACS=xemacs lispdir="%{_xemacs_sitelispdir}/%{pkg}" INSTALL="install -p" +popd +%endif + +%check +sed -e "s|@datadir@|$PWD|" -e "s|@PACKAGE@|mkanthydic|" \ + anthy-unicode.conf.in > test.conf +_TEST_ENV="LD_LIBRARY_PATH=$PWD/src-main/.libs:$PWD/src-worddic/.libs" +_TEST_ENV="$_TEST_ENV CONFFILE=$PWD/test.conf" +cd test +env $_TEST_ENV ./anthy --all +env $_TEST_ENV ./checklib +cd ../src-util +env $_TEST_ENV ./anthy-dic-tool-unicode --load dic-tool-input +diff $HOME/.config/anthy/private_words_default dic-tool-result +env $_TEST_ENV ./anthy-dic-tool-unicode --dump +mkdir -p $HOME/.anthy +mv $HOME/.config/anthy/private_words_default $HOME/.anthy +env $_TEST_ENV ./anthy-dic-tool-unicode --migrate +diff $HOME/.config/anthy/private_words_default dic-tool-result +cd .. + + +%ldconfig_scriptlets + +%files +%doc AUTHORS ChangeLog DIARY NEWS README +%license COPYING +%{_bindir}/* +# If new keywords are added in conf files, "noreplace" flag needs to be deleted +%config(noreplace) %{_sysconfdir}/*.conf +%{_libdir}/lib*.so.* +%{_datadir}/%{pkg}/ + +%files -n emacs-%{pkg} +%doc doc/ELISP +%{_emacs_sitelispdir}/%{pkg}/*.el +%{_emacs_sitelispdir}/%{pkg}/*.elc +%{_emacs_sitestartdir}/*.el +%dir %{_emacs_sitelispdir}/%{pkg} + +%if %{with xemacs} +%files -n xemacs-%{pkg} +%doc doc/ELISP +%{_xemacs_sitelispdir}/%{pkg}/*.el +%if %{with xemacs} +%{_xemacs_sitelispdir}/%{pkg}/*.elc +%endif +%{_xemacs_sitestartdir}/*.el +%dir %{_xemacs_sitelispdir}/%{pkg} +%endif + +%files devel +%doc doc/DICLIB doc/DICUTIL doc/GLOSSARY doc/GRAMMAR doc/GUIDE.english doc/ILIB doc/LEARNING doc/LIB doc/MISC doc/POS doc/SPLITTER doc/TESTING doc/protocol.txt +%{_datadir}/%{pkg}/dic-tool-input +%{_datadir}/%{pkg}/dic-tool-result +%{_includedir}/* +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/*.pc + + +%changelog +## START: Generated by rpmautospec +* Sun Aug 18 2024 Takao Fujiwara - 1.0.0.20240502-11 +- RPMAUTOSPEC: unresolvable merge +## END: Generated by rpmautospec