diff --git a/.gitignore b/.gitignore index bd90cd8..1f5c4c5 100644 --- a/.gitignore +++ b/.gitignore @@ -57,10 +57,3 @@ /libpinyin-2.8.0.tar.gz /libpinyin-2.8.1.tar.gz /libpinyin-2.9.91.tar.gz -/libpinyin-2.9.92.tar.gz -/libpinyin-2.9.93.tar.gz -/libpinyin-2.10.0.tar.gz -/libpinyin-2.10.1.tar.gz -/libpinyin-2.10.2.tar.gz -/libpinyin-2.10.3.tar.gz -/libpinyin-2.11.91.tar.gz diff --git a/libpinyin-2.10.x-head.patch b/libpinyin-2.8.x-head.patch similarity index 100% rename from libpinyin-2.10.x-head.patch rename to libpinyin-2.8.x-head.patch diff --git a/libpinyin.spec b/libpinyin.spec index 5c6ad5e..8652511 100644 --- a/libpinyin.spec +++ b/libpinyin.spec @@ -1,11 +1,16 @@ +%global snapshot 0 + Name: libpinyin -Version: 2.11.91 +Version: 2.9.91 Release: 1%{?dist} Summary: Library to deal with pinyin License: GPL-3.0-or-later URL: https://github.com/libpinyin/libpinyin Source0: http://downloads.sourceforge.net/libpinyin/libpinyin/%{name}-%{version}.tar.gz +%if %snapshot +Patch0: libpinyin-2.8.x-head.patch +%endif BuildRequires: gcc-c++ BuildRequires: kyotocabinet-devel, glib2-devel @@ -54,6 +59,10 @@ The libzhuyin package contains libzhuyin compatibility library. %prep %setup -q +%if %snapshot +%patch -P0 -p1 -b .head +%endif + %build %configure --disable-static \ --with-dbm=KyotoCabinet \ @@ -68,6 +77,9 @@ make check find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' +%ldconfig_scriptlets + + %files %doc AUTHORS COPYING README %{_libdir}/libpinyin*.so.* @@ -96,46 +108,6 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %{_libdir}/libzhuyin*.so.* %changelog -* Sun Jan 04 2026 Peng Wu - 2.11.91-1 -- Update to 2.11.91 -- support "sua" and "zua" pinyin input - -* Thu Sep 18 2025 Peng Wu - 2.10.3-1 -- Update to 2.10.3 -- bug fixes - -* Thu Jul 24 2025 Fedora Release Engineering - 2.10.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Fri May 16 2025 Peng Wu - 2.10.2-1 -- Update to 2.10.2 -- fix memory leaks - -* Mon Mar 24 2025 Peng Wu - 2.10.1-1 -- Update to 2.10.1 -- bug fixes - -* Fri Mar 21 2025 Peng Wu - 2.10.0-2 -- bug fixes - -* Sat Feb 8 2025 Peng Wu - 2.10.0-1 -- Update to 2.10.0 -- bug fixes - -* Mon Jan 20 2025 Fedora Release Engineering - 2.9.93-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jan 17 2025 Fedora Release Engineering - 2.9.93-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Tue Dec 17 2024 Peng Wu - 2.9.93-1 -- Update to 2.9.93 -- bug fixes - -* Mon Oct 21 2024 Peng Wu - 2.9.92-1 -- Update to 2.9.92 -- support punctuation candidate - * Tue Aug 13 2024 Peng Wu - 2.9.91-1 - Update to 2.9.91 - auto clean user data when data corruption diff --git a/plans/basic.fmf b/plans/basic.fmf index c1627f9..d57536e 100644 --- a/plans/basic.fmf +++ b/plans/basic.fmf @@ -1,5 +1,6 @@ summary: Basic smoke test discover: how: fmf + dist-git-source: true execute: how: tmt diff --git a/sources b/sources index 78107a0..feacbef 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libpinyin-2.11.91.tar.gz) = cfcc5c92ab5e392119d4a78e6e2e77dc620fee65647c23c39443e20dabc0717c83c9387bf4dba3066d5ba17e904cb2ec09dc80b5fb11aef315853dff14ca5c1b +SHA512 (libpinyin-2.9.91.tar.gz) = bff5214fa9d0dd501d7a3b6421456928af17055ba2b1749ad1d6760010dd3bec94d9a2a10a05212093e248b9667a368d762ec310fd51a8eb31b4f823af736597 diff --git a/tests/main.fmf b/tests/main.fmf index db4c08e..3e1e10f 100644 --- a/tests/main.fmf +++ b/tests/main.fmf @@ -1,6 +1,6 @@ -test: ./runtest.sh +test: bash ./make_check.sh .. duration: 50m -framework: beakerlib +framework: shell require: - make - gcc-c++ @@ -10,6 +10,4 @@ require: - gettext-devel - glib2-devel - kyotocabinet-devel - - libpinyin - - gnome-common - rpm-build diff --git a/tests/make_check.sh b/tests/make_check.sh new file mode 100644 index 0000000..796af33 --- /dev/null +++ b/tests/make_check.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -x + +check_return_value () { + if [ $1 != 0 ] ; then + exit $1 + fi +} + +cd $1 + +VERSION=`rpmspec -q --srpm --qf "%{version}" libpinyin.spec 2>/dev/null` + +if test -d libpinyin-$VERSION-build; +then cd libpinyin-$VERSION-build; +fi + +cd libpinyin-$VERSION + +./configure --prefix=/usr --with-dbm=KyotoCabinet --enable-libzhuyin +check_return_value $? +make +check_return_value $? +make check +exit $? diff --git a/tests/runtest.sh b/tests/runtest.sh deleted file mode 100755 index 9a7a581..0000000 --- a/tests/runtest.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -rlJournalStart - rlPhaseStartSetup - rlShowPackageVersion libpinyin - rlRun -t -l "VERSION=$(rpm -q libpinyin --queryformat='%{version}')" 0 "Get VERSION" - FEDORA_VERSION=$(rlGetDistroRelease) - rlLog "FEDORA_VERSION=${DISTRO_RELEASE}" - rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" - rlRun "pushd $tmp" - rlFetchSrcForInstalled "libpinyin" - rlRun "rpm --define '_topdir $tmp' -i *src.rpm" - rlRun -t -l "mkdir BUILD" 0 "Creating BUILD directory" - rlRun -t -l "rpmbuild --noclean --nodeps --define '_topdir $tmp' -bp $tmp/SPECS/*spec" - if [ -d BUILD/libpinyin-${VERSION}-build ]; then - rlRun -t -l "pushd BUILD/libpinyin-${VERSION}-build/libpinyin-${VERSION}" - else - rlRun -t -l "pushd BUILD/libpinyin-${VERSION}" - fi - rlPhaseEnd - - rlPhaseStartTest - rlRun "set -o pipefail" - rlRun -t -l "NOCONFIGURE=1 gnome-autogen.sh" - rlRun -t -l "./configure --with-dbm=KyotoCabinet --enable-libzhuyin" - rlRun -t -l "make" - rlRun -t -l "make check" - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "popd; popd" - rlRun "rm -r $tmp" 0 "Remove tmp directory" - rlPhaseEnd -rlJournalEnd