[packages/libcfu] - updated to 0.03, finished packaging

qboosh qboosh at pld-linux.org
Sun Feb 11 14:11:54 CET 2024


commit dbcf4502cf201d74d654a407a9228cf13341465d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 11 13:22:44 2024 +0100

    - updated to 0.03, finished packaging

 libcfu-examples.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 libcfu-info.patch     | 14 ++++++++++++++
 libcfu-shared.patch   | 35 +++++++++++++++++++++++------------
 libcfu.spec           | 41 ++++++++++++++++++++++++-----------------
 4 files changed, 107 insertions(+), 29 deletions(-)
---
diff --git a/libcfu.spec b/libcfu.spec
index 840e0db..596a5c4 100644
--- a/libcfu.spec
+++ b/libcfu.spec
@@ -1,17 +1,20 @@
 Summary:	A library of useful tools when developing multi-threaded software
 Summary(pl.UTF-8):	Biblioteka nardzędzi przydatnych podczas tworzenia oprogramowania wielowątkowego
 Name:		libcfu
-Version:	0.02
-Release:	0.1
+Version:	0.03
+Release:	1
 License:	BSD
 Group:		Libraries
-Source0:	http://dl.sourceforge.net/libcfu/%{name}-%{version}.tar.bz2
-# Source0-md5:	5e9e1a474119c8340509323f81c4c527
+Source0:	https://downloads.sourceforge.net/libcfu/%{name}-%{version}.tar.bz2
+# Source0-md5:	7b73fcea701f73d30f4644a84d371481
 Patch0:		%{name}-shared.patch
-URL:		http://www.sourceforge.net/projects/libcfu/
-BuildRequires:	autoconf
+Patch1:		%{name}-examples.patch
+Patch2:		%{name}-info.patch
+URL:		https://libcfu.sourceforge.net/
+BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
 BuildRequires:	libtool
+BuildRequires:	texinfo
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -54,12 +57,13 @@ Statyczna biblioteka libcfu.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
-%{__autoheader}
 %{__automake}
 %configure
 %{__make}
@@ -70,8 +74,8 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-cd $RPM_BUILD_ROOT%{_libdir}
-ln -sf libcfu.so.*.*.* $RPM_BUILD_ROOT%{_libdir}/libcfu.so
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -p examples/*.c $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -79,24 +83,27 @@ rm -rf $RPM_BUILD_ROOT
 %post	-p /sbin/ldconfig
 %postun	-p /sbin/ldconfig
 
-%post devel	-p	/sbin/postshell
+%post	devel -p /sbin/postshell
 -/usr/sbin/fix-info-dir -c %{_infodir}
 
-%postun devel	-p	/sbin/postshell
+%postun	devel -p /sbin/postshell
 -/usr/sbin/fix-info-dir -c %{_infodir}
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS ChangeLog NEWS README examples/
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
+%doc AUTHORS COPYING ChangeLog README src/TODO
+%attr(755,root,root) %{_libdir}/libcfu.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcfu.so.0
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so
-%{_libdir}/lib*.la
-%{_includedir}/*
+%attr(755,root,root) %{_bindir}/libcfu-config
+%attr(755,root,root) %{_libdir}/libcfu.so
+%{_libdir}/libcfu.la
+%{_includedir}/cfu*.h
 %{_infodir}/libcfu.info*
+%{_examplesdir}/%{name}-%{version}
 
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/lib*.a
+%{_libdir}/libcfu.a
diff --git a/libcfu-examples.patch b/libcfu-examples.patch
new file mode 100644
index 0000000..9bf3295
--- /dev/null
+++ b/libcfu-examples.patch
@@ -0,0 +1,46 @@
+--- libcfu-0.03/examples/large_hash.c.orig	2005-07-31 02:50:41.000000000 +0200
++++ libcfu-0.03/examples/large_hash.c	2024-02-11 13:11:25.380443396 +0100
+@@ -74,16 +74,26 @@ hash_func_tc(const void *key, size_t len
+     c += length;
+     switch(len){              /* all the case statements fall through */
+     case 11: c+=((ub4)k[10]<<24);
++	/* fallthrough */
+     case 10: c+=((ub4)k[9]<<16);
++	/* fallthrough */
+     case 9 : c+=((ub4)k[8]<<8);
++	/* fallthrough */
+ 	/* the first byte of c is reserved for the length */
+     case 8 : b+=((ub4)k[7]<<24);
++	/* fallthrough */
+     case 7 : b+=((ub4)k[6]<<16);
++	/* fallthrough */
+     case 6 : b+=((ub4)k[5]<<8);
++	/* fallthrough */
+     case 5 : b+=k[4];
++	/* fallthrough */
+     case 4 : a+=((ub4)k[3]<<24);
++	/* fallthrough */
+     case 3 : a+=((ub4)k[2]<<16);
++	/* fallthrough */
+     case 2 : a+=((ub4)k[1]<<8);
++	/* fallthrough */
+     case 1 : a+=k[0];
+ 	/* case 0: nothing left to add */
+     }
+@@ -98,7 +108,6 @@ hash_func_tc(const void *key, size_t len
+ static int
+ time_it(cfuhash_function_t hf, double *elapsed_time, u_int32_t num_tests) {
+ 	cfuhash_table_t *hash = cfuhash_new_with_initial_size(30);
+-	u_int32_t flags = 0;
+ 	char key[32];
+ 	char value[32];
+ 	size_t i;
+@@ -108,7 +117,7 @@ time_it(cfuhash_function_t hf, double *e
+ 	cfutime_t *time = cfutime_new();
+ 
+ 	/* freeze the hash so that it won't shrink while we put in all the data */
+-	flags = cfuhash_set_flag(hash, CFUHASH_FROZEN_UNTIL_GROWS);
++	cfuhash_set_flag(hash, CFUHASH_FROZEN_UNTIL_GROWS);
+ 	cfuhash_set_hash_function(hash, hf);
+ 
+ 	cfutime_begin(time);
diff --git a/libcfu-info.patch b/libcfu-info.patch
new file mode 100644
index 0000000..c3b771b
--- /dev/null
+++ b/libcfu-info.patch
@@ -0,0 +1,14 @@
+--- libcfu-0.03/doc/libcfu.texi.orig	2005-09-05 04:01:38.000000000 +0200
++++ libcfu-0.03/doc/libcfu.texi	2024-02-11 13:18:49.981368118 +0100
+@@ -45,9 +45,9 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ 
+ @ifinfo
+- at dircategory Libraries
++ at dircategory Libraries:
+ @direntry
+-     * Libcfu: (libcfu).                     The cfu library.
++* Libcfu: (libcfu).			The cfu library
+ @end direntry
+ @end ifinfo
+ 
diff --git a/libcfu-shared.patch b/libcfu-shared.patch
index 67af7d4..6ae90fa 100644
--- a/libcfu-shared.patch
+++ b/libcfu-shared.patch
@@ -10,20 +10,31 @@ diff -burN libcfu-0.02.orig/configure.ac libcfu-0.02/configure.ac
  
  dnl Check for pthread support
  SAVECFLAGS="$CFLAGS"
-diff -burN libcfu-0.02.orig/src/Makefile.am libcfu-0.02/src/Makefile.am
---- libcfu-0.02.orig/src/Makefile.am	2005-08-01 09:25:52.000000000 +0000
-+++ libcfu-0.02/src/Makefile.am	2005-08-01 09:27:08.000000000 +0000
+--- libcfu-0.03/src/Makefile.am.orig	2024-02-11 10:14:12.098048826 +0100
++++ libcfu-0.03/src/Makefile.am	2024-02-11 10:16:45.943882038 +0100
 @@ -1,5 +1,5 @@
 -lib_LIBRARIES = libcfu.a
--libcfu_a_SOURCES = cfuhash.c cfutime.c cfustring.c cfulist.c cfuconf.c cfuthread_queue.c cfu.c
+-libcfu_a_SOURCES = cfuhash.c cfutime.c cfustring.c cfulist.c cfuconf.c cfuthread_queue.c cfu.c cfuopt.c
 +lib_LTLIBRARIES = libcfu.la
-+libcfu_la_SOURCES = cfuhash.c cfutime.c cfustring.c cfulist.c cfuconf.c cfuthread_queue.c cfu.c
- if DEBUG
- AM_CFLAGS = -Wall -W -DCFU_DEBUG=1
- else
-@@ -12,4 +12,4 @@
- # libcfu_a_LDFLAGS = -lpthread
++libcfu_la_SOURCES = cfuhash.c cfutime.c cfustring.c cfulist.c cfuconf.c cfuthread_queue.c cfu.c cfuopt.c
+ bin_PROGRAMS = libcfu-config
+ 
+ CFU_CONFIG_DEFINES = -DCFU_LIBDIR="\"@libdir@\"" -DCFU_LIBS="\"@LIBS@\"" -DCFU_INCLUDEDIR="\"@includedir@\"" -DCFU_PREFIX="\"@prefix@\""  -DCFU_EXEC_PREFIX="\"@exec_prefix@\""
+@@ -16,13 +16,13 @@ include_HEADERS = $(top_srcdir)/include/
+     $(top_srcdir)/include/cfuthread_queue.h $(top_srcdir)/include/cfutypes.h \
+     $(top_srcdir)/include/cfuopt.h
+ 
+-# libcfu_a_LDFLAGS = -lpthread
++# libcfu_la_LDFLAGS = -lpthread
  INCLUDES = -I$(top_srcdir)/include
  
--default: libcfu.a
-+default: libcfu.la
+-default: libcfu.a libcfu-config
++default: libcfu.la libcfu-config
+ 
+ libcfu-config.o: libcfu-config.c
+ 
+-libcfu-config: libcfu.a libcfu-config.o
+-	$(CC) $(CFLAGS) -o libcfu-config libcfu-config.o libcfu.a -pthread
++libcfu-config: libcfu.la libcfu-config.lo
++	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o libcfu-config libcfu-config.o libcfu.la -pthread
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libcfu.git/commitdiff/dbcf4502cf201d74d654a407a9228cf13341465d



More information about the pld-cvs-commit mailing list