diff --git a/Judy-1.0.4-fix-Judy1-mans.patch b/Judy-1.0.4-fix-Judy1-mans.patch new file mode 100644 index 0000000..06ab742 --- /dev/null +++ b/Judy-1.0.4-fix-Judy1-mans.patch @@ -0,0 +1,80 @@ +diff -up Judy-1.0.4/doc/Makefile.am.fix-Judy1-mans Judy-1.0.4/doc/Makefile.am +--- Judy-1.0.4/doc/Makefile.am.fix-Judy1-mans 2006-01-18 16:56:43.000000000 -0500 ++++ Judy-1.0.4/doc/Makefile.am 2008-11-27 14:08:53.000000000 -0500 +@@ -100,21 +100,21 @@ man/man3/Judy: + + man/man3/Judy1: + ../tool/jhton ext/Judy1_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1 +- cd man/man3; ln -s Judy J1T +- cd man/man3; ln -s Judy J1S +- cd man/man3; ln -s Judy J1U +- cd man/man3; ln -s Judy J1F +- cd man/man3; ln -s Judy J1N +- cd man/man3; ln -s Judy J1L +- cd man/man3; ln -s Judy J1P +- cd man/man3; ln -s Judy J1FE +- cd man/man3; ln -s Judy J1NE +- cd man/man3; ln -s Judy J1LE +- cd man/man3; ln -s Judy J1PE +- cd man/man3; ln -s Judy J1C +- cd man/man3; ln -s Judy J1BC +- cd man/man3; ln -s Judy J1FA +- cd man/man3; ln -s Judy J1MU ++ cd man/man3; ln -s Judy1 J1T ++ cd man/man3; ln -s Judy1 J1S ++ cd man/man3; ln -s Judy1 J1U ++ cd man/man3; ln -s Judy1 J1F ++ cd man/man3; ln -s Judy1 J1N ++ cd man/man3; ln -s Judy1 J1L ++ cd man/man3; ln -s Judy1 J1P ++ cd man/man3; ln -s Judy1 J1FE ++ cd man/man3; ln -s Judy1 J1NE ++ cd man/man3; ln -s Judy1 J1LE ++ cd man/man3; ln -s Judy1 J1PE ++ cd man/man3; ln -s Judy1 J1C ++ cd man/man3; ln -s Judy1 J1BC ++ cd man/man3; ln -s Judy1 J1FA ++ cd man/man3; ln -s Judy1 J1MU + + man/man3/Judy1_funcs: + ../tool/jhton ext/Judy1_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1_funcs +diff -up Judy-1.0.4/doc/Makefile.in.fix-Judy1-mans Judy-1.0.4/doc/Makefile.in +--- Judy-1.0.4/doc/Makefile.in.fix-Judy1-mans 2007-05-14 17:10:55.000000000 -0400 ++++ Judy-1.0.4/doc/Makefile.in 2008-12-13 12:55:14.000000000 -0500 +@@ -471,21 +479,21 @@ man/man3/Judy: + + man/man3/Judy1: + ../tool/jhton ext/Judy1_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1 +- cd man/man3; ln -s Judy J1T +- cd man/man3; ln -s Judy J1S +- cd man/man3; ln -s Judy J1U +- cd man/man3; ln -s Judy J1F +- cd man/man3; ln -s Judy J1N +- cd man/man3; ln -s Judy J1L +- cd man/man3; ln -s Judy J1P +- cd man/man3; ln -s Judy J1FE +- cd man/man3; ln -s Judy J1NE +- cd man/man3; ln -s Judy J1LE +- cd man/man3; ln -s Judy J1PE +- cd man/man3; ln -s Judy J1C +- cd man/man3; ln -s Judy J1BC +- cd man/man3; ln -s Judy J1FA +- cd man/man3; ln -s Judy J1MU ++ cd man/man3; ln -s Judy1 J1T ++ cd man/man3; ln -s Judy1 J1S ++ cd man/man3; ln -s Judy1 J1U ++ cd man/man3; ln -s Judy1 J1F ++ cd man/man3; ln -s Judy1 J1N ++ cd man/man3; ln -s Judy1 J1L ++ cd man/man3; ln -s Judy1 J1P ++ cd man/man3; ln -s Judy1 J1FE ++ cd man/man3; ln -s Judy1 J1NE ++ cd man/man3; ln -s Judy1 J1LE ++ cd man/man3; ln -s Judy1 J1PE ++ cd man/man3; ln -s Judy1 J1C ++ cd man/man3; ln -s Judy1 J1BC ++ cd man/man3; ln -s Judy1 J1FA ++ cd man/man3; ln -s Judy1 J1MU + + man/man3/Judy1_funcs: + ../tool/jhton ext/Judy1_funcs_3.htm | grep -v '^[ ]*$$' | sed -e 's/\.C//' > man/man3/Judy1_funcs diff --git a/Judy-1.0.4-test-shared.patch b/Judy-1.0.4-test-shared.patch new file mode 100644 index 0000000..28d8a59 --- /dev/null +++ b/Judy-1.0.4-test-shared.patch @@ -0,0 +1,14 @@ +diff -up Judy-1.0.4/test/Checkit.test-shared Judy-1.0.4/test/Checkit +--- Judy-1.0.4/test/Checkit.test-shared 2007-05-14 13:02:16.000000000 -0400 ++++ Judy-1.0.4/test/Checkit 2008-11-27 12:56:28.000000000 -0500 +@@ -4,8 +4,9 @@ CC=${CC:-cc} + echo + echo "=== +++++++++ This test runs in 15 seconds on a PIII 750Mhz +++++++" + +-LIBJUDY=`find ../ -name libJudy.a` ++LIBJUDY=`find ../ -name libJudy.so` + JUDY_H=`find ../ -name Judy.h` ++export LD_LIBRARY_PATH=`dirname $LIBJUDY` + + echo "$CC -O SLcompare.c -DHASHMETHOD -o SL_Hash" + $CC -O SLcompare.c -DHASHMETHOD -o SL_Hash diff --git a/Judy-1.0.5-undefined-behavior.patch b/Judy-1.0.5-undefined-behavior.patch new file mode 100644 index 0000000..e8741d0 --- /dev/null +++ b/Judy-1.0.5-undefined-behavior.patch @@ -0,0 +1,120 @@ +diff -crb judy-1.0.5-orig/src/JudyCommon/JudyByCount.c judy-1.0.5/src/JudyCommon/JudyByCount.c +*** judy-1.0.5-orig/src/JudyCommon/JudyByCount.c 2005-02-15 15:06:07.000000000 -0600 +--- judy-1.0.5/src/JudyCommon/JudyByCount.c 2014-02-18 13:45:35.225145230 -0600 +*************** +*** 817,823 **** + // Shorthand for where to find start of Index bytes array: + + #ifdef JUDY1 +! #define PJI (Pjp->jp_1Index) + #else + #define PJI (Pjp->jp_LIndex) + #endif +--- 817,823 ---- + // Shorthand for where to find start of Index bytes array: + + #ifdef JUDY1 +! #define PJI (Pjp->jp_2Index) + #else + #define PJI (Pjp->jp_LIndex) + #endif +diff -crb judy-1.0.5-orig/src/JudyCommon/JudyGet.c judy-1.0.5/src/JudyCommon/JudyGet.c +*** judy-1.0.5-orig/src/JudyCommon/JudyGet.c 2005-02-15 15:06:07.000000000 -0600 +--- judy-1.0.5/src/JudyCommon/JudyGet.c 2014-02-18 13:49:50.840632644 -0600 +*************** +*** 630,636 **** + #ifdef JUDY1 + + #define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ +! if (((LEAF_T *)((PJP)->jp_1Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ + return(1) + + #define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ +--- 630,636 ---- + #ifdef JUDY1 + + #define CHECKINDEXNATIVE(LEAF_T, PJP, IDX, INDEX) \ +! if (((LEAF_T *)((PJP)->jp_2Index))[(IDX) - 1] == (LEAF_T)(INDEX)) \ + return(1) + + #define CHECKLEAFNONNAT(LFBTS, PJP, INDEX, IDX, COPY) \ +diff -crb judy-1.0.5-orig/src/JudyCommon/JudyIns.c judy-1.0.5/src/JudyCommon/JudyIns.c +*** judy-1.0.5-orig/src/JudyCommon/JudyIns.c 2005-02-15 15:06:07.000000000 -0600 +--- judy-1.0.5/src/JudyCommon/JudyIns.c 2014-02-18 13:00:49.871850635 -0600 +*************** +*** 1503,1509 **** + JU_BITMAPSETL(Pjlb, Index); + + for (offset = 0; offset < 15; ++offset) +! JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]); + + // Set jp_DcdPopO including the current pop0; incremented later: + DcdP0 = (Index & cJU_DCDMASK(1)) + 15 - 1; +--- 1503,1510 ---- + JU_BITMAPSETL(Pjlb, Index); + + for (offset = 0; offset < 15; ++offset) +! // JU_BITMAPSETL(Pjlb, Pjp->jp_1Index[offset]); // elements 8..15 are optimized out by gcc, so need to do the following +! JU_BITMAPSETL(Pjlb, Pjp->jp_2Index[offset]); + + // Set jp_DcdPopO including the current pop0; incremented later: + DcdP0 = (Index & cJU_DCDMASK(1)) + 15 - 1; +diff -crb judy-1.0.5-orig/src/JudyCommon/JudyPrevNext.c judy-1.0.5/src/JudyCommon/JudyPrevNext.c +*** judy-1.0.5-orig/src/JudyCommon/JudyPrevNext.c 2005-02-15 15:06:07.000000000 -0600 +--- judy-1.0.5/src/JudyCommon/JudyPrevNext.c 2014-02-18 13:45:40.972875737 -0600 +*************** +*** 907,913 **** + // Shorthand for where to find start of Index bytes array: + + #ifdef JUDY1 +! #define PJI (Pjp->jp_1Index) + #else + #define PJI (Pjp->jp_LIndex) + #endif +--- 907,913 ---- + // Shorthand for where to find start of Index bytes array: + + #ifdef JUDY1 +! #define PJI (Pjp->jp_2Index) + #else + #define PJI (Pjp->jp_LIndex) + #endif +diff -crb judy-1.0.5-orig/src/JudyCommon/JudyPrivateBranch.h judy-1.0.5/src/JudyCommon/JudyPrivateBranch.h +*** judy-1.0.5-orig/src/JudyCommon/JudyPrivateBranch.h 2005-02-15 15:06:07.000000000 -0600 +--- judy-1.0.5/src/JudyCommon/JudyPrivateBranch.h 2014-02-18 13:00:39.510533765 -0600 +*************** +*** 86,91 **** +--- 86,98 ---- + } jpi_t; + + ++ typedef struct _JUDY_POINTER_IMMED2 // JPI2. ++ { ++ uint8_t j_pi_2Index[2 * sizeof(Word_t) - 1]; // see above. ++ uint8_t j_pi_Type; // JP type, 1 of cJ*_JPIMMED*. ++ } jpi2_t; ++ ++ + // UNION OF JP TYPES: + // + // A branch is an array of cJU_BRANCHUNUMJPS (256) of this object, or an +*************** +*** 97,102 **** +--- 104,110 ---- + { + jpo_t j_po; // other than immediate indexes. + jpi_t j_pi; // immediate indexes. ++ jpi2_t j_pi2; // immediate indexes using j_pi_LIndex as well + } jp_t, *Pjp_t; + + // For coding convenience: +*************** +*** 105,110 **** +--- 113,119 ---- + + #define jp_1Index j_pi.j_pi_1Index // for storing Indexes in first word. + #define jp_LIndex j_pi.j_pi_LIndex // for storing Indexes in second word. ++ #define jp_2Index j_pi2.j_pi_2Index // for storing Indexes spanning both words. + #define jp_Addr j_po.j_po_Addr + //#define jp_DcdPop0 j_po.jpo_u.j_po_DcdPop0 + #define jp_Type j_po.jpo_u.j_po_Bytes[sizeof(Word_t) - 1] diff --git a/Judy-1.0.5.tar.gz b/Judy-1.0.5.tar.gz new file mode 100644 index 0000000..2156e56 Binary files /dev/null and b/Judy-1.0.5.tar.gz differ diff --git a/Judy.spec b/Judy.spec new file mode 100644 index 0000000..3271cad --- /dev/null +++ b/Judy.spec @@ -0,0 +1,73 @@ +Name: Judy +Version: 1.0.5 +Release: 19 +Summary: C library array +License: LGPLv2+ +URL: http://sourceforge.net/projects/judy/ +Source0: http://downloads.sf.net/judy/Judy-%{version}.tar.gz + +Patch0000: Judy-1.0.4-test-shared.patch +Patch0001: Judy-1.0.4-fix-Judy1-mans.patch +Patch0002: Judy-1.0.5-undefined-behavior.patch + +BuildRequires: coreutils gawk make sed gcc >= 4.1 + +%description +The package provides the most advanced core technology, the main +advantages are scalability, high performance and memory efficiency. + +%package devel +Summary: Development libraries and headers for Judy +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains header files and development libraries. + +%package help +Summary: API documentation for Judy. + +%description help +The help for Judy to use. + +%prep +%autosetup -n judy-%{version} -p1 + +%build +export CFLAGS="%{optflags} -fno-strict-aliasing -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-copy-prop -fno-tree-vrp" +%configure --disable-static + +make + +%install +%make_install +rm -f %{buildroot}%{_libdir}/*.a +%delete_la +rm -rf doc/man doc/Makefile* doc/ext/{README_deliver,COPYRIGHT,LICENSE} + +%check +cd test +./Checkit +cd - + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + + +%files +%license COPYING +%{_libdir}/libJudy.so.* + +%files devel +%{_includedir}/Judy.h +%{_libdir}/libJudy.so + +%files help +%{_mandir}/man3/J*.3* +%doc README examples + +%changelog +* Thu Nov 14 2019 wangye - 1.0.5-19 +- Package init diff --git a/README.en.md b/README.en.md deleted file mode 100644 index cd27928..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# Judy - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index 5e9b315..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Judy - -#### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)