Bug 656082 - Review Request: libcprops - C prototyping tools
Summary: Review Request: libcprops - C prototyping tools
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL: http://sourceforge.net/projects/cprops/
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-23 02:05 UTC by Philip Prindeville
Modified: 2012-06-02 19:29 UTC (History)
7 users (show)

Fixed In Version: libcprops-0.1.12-1.1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-17 00:54:58 UTC
Type: ---
Embargoed:
loganjerry: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)
Patch to support mysql builds (883 bytes, patch)
2011-12-14 18:44 UTC, Jerry James
no flags Details | Diff
Patch to support mysql builds (1.35 KB, patch)
2011-12-14 20:26 UTC, Jerry James
no flags Details | Diff
Patch to fix the link (1.08 KB, patch)
2011-12-14 20:34 UTC, Jerry James
no flags Details | Diff

Description Philip Prindeville 2010-11-23 02:05:55 UTC
Spec URL: http://fedoraproject.org/~philipp/libcprops.spec
SRPM URL: http://fedoraproject.org/~philipp/libcprops-0.1.8-0.1.fc13.src.rpm
Description: (from the README)

The c prototyping tools library consists of implementations for several widely 
used data structures and patterns, rudimentary tcp / httpd functionality and
a database abstraction layer. Object oriented development environments usually 
feature readymade implementations of such tools.

Coding in c often allows better performance and closer control over application
behavior, which can be crucial in real life situations. libcprops provides 
generic tools for application development in plain c covering basic data 
structure implementations, persistence, threading and tcp communication. 

        data structures
        ---------------
        o       linked list
        o       heap
        o       priority_list
        o       hashtable
        o       hashlist
        o       sorted hash
        o       AVL tree
        o       red-black tree
        o       splay tree
        o       N-ary tree
        o       PATRICIA tree - a character trie
        o       multimap - a data structure to support multiple indices
        
        application level
        -----------------
        o       cp_mempool, cp_shared_mempool - memory pool
        o       cp_thread - thread pool
        o       cp_client, cp_socket - tcp sockets
        o       cp_httpclient, cp_httpsocket - an HTTP socket api
        o       cp_dbms - a database abstraction layer


For your entertainment, the distribution comes with cpsvc, a web server based
on the cprops api and featuring support for CGI and cpsp, a c based page 
scripting environment. For more on cpsvc and cpsp see README under the svc/ 
directory.

Comment 1 Jason Tibbitts 2010-11-23 04:54:50 UTC
I see no SCM request here.  Why was the fedora-cvs flag set?

Comment 2 Thomas Spura 2010-11-23 10:12:57 UTC
Why do you package the static libraries?

Please have a look at [1], so you package them correctly, if you still want to ship them.

[1] https://fedoraproject.org/wiki/Packaging/Guidelines#Packaging_Static_Libraries

Comment 3 Philip Prindeville 2010-11-23 18:31:36 UTC
(In reply to comment #2)
> Why do you package the static libraries?
> 
> Please have a look at [1], so you package them correctly, if you still want to
> ship them.
> 
> [1]
> https://fedoraproject.org/wiki/Packaging/Guidelines#Packaging_Static_Libraries

I was thinking that there might be times when a developer might need a static link (such as for easier debugging), but I can leave them out or add a -static subpackage.

For now, I've left them out.

Comment 4 Philip Prindeville 2010-11-23 20:48:40 UTC
$ rpmlint ../SRPMS/libcprops-0.1.8-0.1.fc13.src.rpm libcprops.spec 
libcprops.src: W: spelling-error %description -l en_US trie -> tire, true, tie
libcprops.src: W: spelling-error %description -l en_US tcp -> pct, cp, tsp
libcprops.src: W: spelling-error %description -l en_US http -> HTTP
libcprops.src: W: spelling-error %description -l en_US api -> ai, pi, ape
libcprops.src: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
1 packages and 1 specfiles checked; 0 errors, 5 warnings.
$ 

(Note: the "misspellings" are from the cut&paste of the description taken from the original README file. And "trie" is not a misspelling.)

Comment 6 Michael Schwendt 2010-12-23 18:31:35 UTC
Just a brief look at the spec file (no full review):


> Source0:	http://downloads.sourceforge.net/cprops/libcprops-0.1.8.tar.bz2

Nowadays when there are tools to parse a spec file in order to retrieve a download URL, it isn't beneficial anymore to hardcode the version number. It's more convenient and less error-prone to use %{version} instead.  Occasionally, a packager updates just the "Version:" tag to 0.1.9 and that works accidentally if the old tarball is still available.


> %if %with postgres
> BuildRequires:	postgresql-devel
> Requires:	postgresql
> %endif

https://fedoraproject.org/wiki/Packaging:Guidelines#Explicit_Requires


> %files devel
> %defattr(-,root,root,-)
> %doc %{_mandir}/man3/*

Files below %_mandir are %doc by default.

> %dir %{_includedir}/cprops/
> %{_includedir}/cprops/*

Since the '*' wildcard catches all files, you could replace the two lines with just

  %{_includedir}/cprops/

which includes the directory and its contents. The trailing slash is optional and just for increased readability. To make it more explicit that the entry is a directory tree and not a single file.

Comment 7 Philip Prindeville 2010-12-23 18:48:03 UTC
(In reply to comment #6)
 
> > %if %with postgres
> > BuildRequires:	postgresql-devel
> > Requires:	postgresql
> > %endif
> 
> https://fedoraproject.org/wiki/Packaging:Guidelines#Explicit_Requires

Not sure I get this part.

If I mock build, configure doesn't detect the library because it's not installed by default.

Comment 8 Paul Howarth 2010-12-24 10:45:08 UTC
The BuildRequires is OK but the explicit Require is redundant as there should be automatically-added dependencies on the postgresql library sonames in the built binary packages.

Moreover, those dependencies will be satisfied by the postgresql-libs package rather than the main postgresql package.

So unless there's some reason why the main postgresql package should be pulled in as a runtime dependency when built with postgres support, the explicit Require is wrong.

Comment 9 Philip Prindeville 2011-11-11 01:41:49 UTC
Updated to:

http://fedorapeople.org/~philipp/cprops.spec
http://fedorapeople.org/~philipp/cprops-svn36-0.1.fc15.src.rpm

and rpmlint results:

[philipp@builder SPECS]$ rpmlint ../SRPMS/cprops-svn36-0.1.fc15.src.rpm
cprops.src: W: spelling-error %description -l en_US trie -> tire, true, tie
cprops.src: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
cprops.src: W: spelling-error %description -l en_US http -> HTTP
cprops.src: W: spelling-error %description -l en_US api -> pi, ape, apt
cprops.src: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
cprops.src: W: invalid-url Source0: http://downloads.sourceforge.net/cprops/cprops-svn36.tar.gz HTTP Error 404: Not Found
1 packages and 0 specfiles checked; 0 errors, 6 warnings.
[philipp@builder SPECS]$ rpmlint ../RPMS/x86_64/cprops-svn36-0.1.fc15.x86_64.rpm
cprops.x86_64: W: spelling-error %description -l en_US trie -> tire, true, tie
cprops.x86_64: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
cprops.x86_64: W: spelling-error %description -l en_US http -> HTTP
cprops.x86_64: W: spelling-error %description -l en_US api -> pi, ape, apt
cprops.x86_64: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
cprops.x86_64: W: shared-lib-calls-exit /usr/lib64/libcprops.so.10.2.0 exit.5
cprops.x86_64: W: no-documentation
1 packages and 0 specfiles checked; 0 errors, 7 warnings.
[philipp@builder SPECS]$ rpmlint ../RPMS/x86_64/cprops-devel-svn36-0.1.fc15.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.
[philipp@builder SPECS]$

Comment 10 Philip Prindeville 2011-11-24 22:08:35 UTC
Updated to official release:

http://fedorapeople.org/~philipp/libcprops-0.1.9-0.1.fc16.src.rpm
http://fedorapeople.org/~philipp/libcprops.spec

[philipp@builder SPECS]$ rpmlint libcprops.spec 
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
[philipp@builder SPECS]$ rpmlint ../SRPMS/libcprops-0.1.9-0.1.fc16.src.rpm 
libcprops.src: W: spelling-error %description -l en_US trie -> tire, true, tie
libcprops.src: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
libcprops.src: W: spelling-error %description -l en_US http -> HTTP
libcprops.src: W: spelling-error %description -l en_US api -> pi, ape, apt
libcprops.src: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
1 packages and 0 specfiles checked; 0 errors, 5 warnings.
[philipp@builder SPECS]$

Comment 11 Philip Prindeville 2011-12-10 03:25:08 UTC
Updating again:

http://fedorapeople.org/~philipp/libcprops-0.1.10-0.1.fc16.src.rpm
http://fedorapeople.org/~philipp/libcprops.spec

[philipp@builder SPECS]$ rpmlint libcprops.spec 
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
[philipp@builder SPECS]$ rpmlint ../SRPMS/libcprops-0.1.10-0.1.fc16.src.rpm 
libcprops.src: W: spelling-error %description -l en_US trie -> tire, true, tie
libcprops.src: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
libcprops.src: W: spelling-error %description -l en_US http -> HTTP
libcprops.src: W: spelling-error %description -l en_US api -> pi, ape, apt
libcprops.src: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
1 packages and 0 specfiles checked; 0 errors, 5 warnings.
[philipp@builder SPECS]$

Comment 12 Jerry James 2011-12-14 17:32:06 UTC
I'll take this review.

Comment 13 Jerry James 2011-12-14 18:44:06 UTC
Created attachment 546853 [details]
Patch to support mysql builds

This isn't a requirement, just a suggestion.  If you add the attached patch as Patch0, add a %bcond_without for mysql, add this:

%if %with mysql
BuildRequires:	mysql-devel
%endif

add %patch0 to %prep, and add this to the configure invocation:

	%{?with_mysql:--with-mysql-includes=%{_includedir}/mysql} \
	%{?with_mysql:--with-mysql-libs=%{_libdir}/mysql}

then it is possible to build with mysql support, too.  It might also be worth poking upstream about using standard autoconf macros, like AC_CHECK_HEADERS and AC_CHECK_LIB so we don't have to patch their broken shell scripts. :-)

Sorry, I use mysql a lot at work, so I wondered why support wasn't included.  I'll stop being distracted now and get back to the review...

Comment 14 Jerry James 2011-12-14 20:26:32 UTC
Created attachment 546873 [details]
Patch to support mysql builds

It turns out the previous patch wasn't quite sufficient.  Upstream has a bug in their source code that results in unsatisfiable references to symbols in the shared library.  This new patch fixes that, too.  Upstream should apply the db_mysql.c portion of the patch, regardless of what they think of the rest.

OK, I'm really, really doing the rest of the review now.  Really.

Comment 15 Jerry James 2011-12-14 20:34:30 UTC
Created attachment 546876 [details]
Patch to fix the link

If you run rpmlint on the *installed* libcprops package, not the binary RPM, then you'll see lots of warnings like this:

$ rpmlint libcprops libcprops-devel
...
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcprops.so.10.4.0 SSL_free
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcprops.so.10.4.0 SSL_CTX_free
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcprops.so.10.4.0 X509_NAME_get_text_by_NID
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcprops.so.10.4.0 pthread_detach
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcprops.so.10.4.0 SSL_get_error
...
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcp_dbms_postgres.so.0.0.0 cp_string_destroy
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcp_dbms_postgres.so.0.0.0 cp_hash_int
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcp_dbms_postgres.so.0.0.0 intdup
libcprops.x86_64: W: undefined-non-weak-symbol /usr/lib64/libcp_dbms_postgres.so.0.0.0 cp_hash_compare_int
...
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcp_dbms_postgres.so.0.0.0 /lib64/libdl.so.2
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcp_dbms_postgres.so.0.0.0 /lib64/libpthread.so.0
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcp_dbms_postgres.so.0.0.0 /usr/lib64/libssl.so.10


These warnings indicate the the shared libraries are not being linked properly.  This patch fixes part of the problem.  To fix the rest, drop this into your spec file, in between the %configure invocation and the make invocation:

sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
    -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
    -e 's|func_apped|func_append|' \
    -e 's|CC -shared|CC -shared -Wl,--as-needed|' \
    -i libtool

The first two expressions are from https://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath.  You didn't have problems with rpath before, because libtool only sets the rpath if the object being created is linked against something.  The third expression fixes bug 759376.  Normally, you could fix the unused-direct-shlib-dependency warnings by adding "-Wl,--as-needed" to LDFLAGS, but that doesn't work when using libtool due to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=347650,  The fourth expression is a cheap and dirty workaround for that problem.

Comment 16 Jerry James 2011-12-14 21:09:59 UTC
Question 1: why is the release number 0.1, instead of 1?
Question 2: wouldn't http://cprops.sourceforge.net/ be a better value for URL?

If you don't intend to use this spec file for an EPEL package, then you can delete the following spec file elements, all of which are unnecessary in every current Fedora release: the BuildRoot tag, "rm -rf $RPM_BUILD_ROOT" at the top of %install, the entire %clean script, and %defattr in the %files sections.

Note that the rpmlint output below is from the installed packages, not the
binary RPMs, and was created with the changes in comment 15 applied.

+: OK
-: must be fixed
=: should be fixed (at your discretion)
N: not applicable

MUST:
[=] rpmlint output:
libcprops.x86_64: W: spelling-error %description -l en_US trie -> tire, true, tie
libcprops.x86_64: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
libcprops.x86_64: W: spelling-error %description -l en_US http -> HTTP
libcprops.x86_64: W: spelling-error %description -l en_US api -> pi, ape, apt
libcprops.x86_64: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcprops.so.10.4.0 linux-vdso.so.1
libcprops.x86_64: W: shared-lib-calls-exit /usr/lib64/libcprops.so.10.4.0 exit.5
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcp_dbms_postgres.so.0.0.0 linux-vdso.so.1
libcprops.x86_64: W: no-documentation
2 packages and 1 specfiles checked; 0 errors, 9 warnings.

Those are all innocuous, except for the shared-lib-calls-exit warning.  Please check with upstream about returning an error code instead of exiting.
[+] follows package naming guidelines
[+] spec file base name matches package name
[-] package meets the packaging guidelines: only one small problem, the devel package should require the main package like this, as documented at https://fedoraproject.org/wiki/Packaging:Guidelines#Requiring_Base_Package:

Requires: %{name}%{?_isa} = %{version}-%{release}

[+] package uses a Fedora approved license
[+] license field matches the actual license
[-] license file is included in %doc: please add it.  Consider adding README to %doc, too, and maybe even the example directory.
[+] spec file is in American English
[+] spec file is legible
[+] sources match upstream: md5sum is da30a8bdc34cee023372bdbb7352ee76 for both
[+] package builds on at least one primary arch (tried x86_64)
[N] appropriate use of ExcludeArch
[+] all build requirements in BuildRequires
[N] spec file handles locales properly
[+] ldconfig in %post and %postun
[+] no bundled copies of system libraries
[+] no relocatable packages
[-] package owns all directories that it creates: it does not own /usr/include/cprops.  Get rid of the "*" on the end of the %files entry, so that it reads:

%{_includedir}/cprops/

[+] no files listed twice in %files
[+] proper permissions on files
[+] consistent use of macros
[+] code or permissible content
[N] large documentation in -doc
[+] no runtime dependencies in %doc
[+] header files in -devel
[N] static libraries in -static
[+] .so in -devel
[+] -devel requires main package
[+] package contains no libtool archives
[N] package contains a desktop file, uses desktop-file-install
[+] package does not own files/dirs owned by other packages
[+] all filenames in UTF-8

SHOULD:
[N] query upstream for license text
[N] description and summary contain available translations
[+] package builds in mock: tried fedora-rawhide-i386
[+] package builds on all supported arches: tried i386 and x86_64
[+] package functions as described: light testing only
[+] sane scriptlets
[+] subpackages require the main package
[N] placement of pkgconfig files
[N] file dependencies versus package dependencies
[N] package contains man pages for binaries/scripts

Comment 17 Philip Prindeville 2012-01-09 18:42:22 UTC
(In reply to comment #16)
> If you don't intend to use this spec file for an EPEL package, then you can
> delete the following spec file elements, all of which are unnecessary in every
> current Fedora release: the BuildRoot tag, "rm -rf $RPM_BUILD_ROOT" at the top
> of %install, the entire %clean script, and %defattr in the %files sections.

Actually, I do intend to publish it on EPEL just as soon as it gets accepted on Fedora.

Comment 18 Philip Prindeville 2012-01-09 18:56:15 UTC
Applied patches in comment 14 and comment 15 upstream.

Comment 19 Philip Prindeville 2012-01-24 23:17:18 UTC
Updated:

http://fedorapeople.org/~philipp/libcprops-0.1.12-1.fc16.src.rpm
http://fedorapeople.org/~philipp/libcprops.spec

$ rpmlint libcprops.spec 
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
$ rpmlint libcprops-0.1.12-1.fc16.src.rpm 
libcprops.src: W: spelling-error %description -l en_US trie -> tire, true, tie
libcprops.src: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
libcprops.src: W: spelling-error %description -l en_US http -> HTTP
libcprops.src: W: spelling-error %description -l en_US api -> pi, ape, apt
libcprops.src: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
1 packages and 0 specfiles checked; 0 errors, 5 warnings.
$

Comment 20 Philip Prindeville 2012-01-24 23:39:31 UTC
And post-install:

$ rpmlint libcprops libcprops-devel                     libcprops.x86_64: W: spelling-error %description -l en_US trie -> tire, true, tie
libcprops.x86_64: W: spelling-error %description -l en_US tcp -> pct, tsp, tip
libcprops.x86_64: W: spelling-error %description -l en_US http -> HTTP
libcprops.x86_64: W: spelling-error %description -l en_US api -> pi, ape, apt
libcprops.x86_64: W: spelling-error %description -l en_US dbms -> DBMS, dims, dams
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcp_dbms_mysql.so.0.0.0 linux-vdso.so.1
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcprops.so.15.0.0 linux-vdso.so.1
libcprops.x86_64: W: unused-direct-shlib-dependency /usr/lib64/libcp_dbms_postgres.so.0.0.0 linux-vdso.so.1
2 packages and 0 specfiles checked; 0 errors, 8 warnings.
$ 

I'm told that the warnings for linux-vdso can be safely ignored as they're an artifact of the x86_64.

Comment 21 Jerry James 2012-01-26 19:50:42 UTC
Looks good.  All of the MUST items are now satisfied.  This package is APPROVED.

Comment 22 Thomas Spura 2012-01-27 01:43:28 UTC
Unsetting fedora-cvs+ as there is no SCM request anywhere.

See here, for how to ask for new branches:
http://fedoraproject.org/wiki/Package_SCM_admin_requests

Comment 23 Philip Prindeville 2012-01-27 01:56:21 UTC
New Package SCM Request
=======================
Package Name: libcprops
Short Description: C prototyping tools
Owners: philipp
Branches: f16 el6
InitialCC:

Comment 24 Gwyn Ciesla 2012-01-27 02:17:48 UTC
Summary name and SCM request name don't match, please correct.

Comment 25 Philip Prindeville 2012-01-27 06:06:37 UTC
New Package SCM Request
=======================
Package Name: libcprops
Short Description: C prototyping tools
Owners: philipp
Branches: f16 el6
InitialCC:

Comment 26 Gwyn Ciesla 2012-01-27 13:00:24 UTC
Still doesn't match.

Comment 27 Jerry James 2012-01-27 16:20:08 UTC
Philip, the bug summary should read "Review Request: libcprops - C prototyping tools".

Comment 28 Philip Prindeville 2012-01-27 17:38:18 UTC
New Package SCM Request
=======================
Package Name: libcprops
Short Description: Review Request: libcprops - C prototyping tools
Owners: philipp
Branches: f16 el6
InitialCC:

Comment 29 Philip Prindeville 2012-01-27 17:39:32 UTC
(In reply to comment #27)
> Philip, the bug summary should read "Review Request: libcprops - C prototyping
> tools".

Understand that now... Before I thought he meant the "Summary:" line from the RPM package itself, not the defect title.

Comment 30 Gwyn Ciesla 2012-01-27 17:47:48 UTC
Git done (by process-git-requests).

Comment 31 Fedora Update System 2012-02-05 03:06:56 UTC
libcprops-0.1.12-1.1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/libcprops-0.1.12-1.1.el6

Comment 32 Fedora Update System 2012-02-05 03:07:46 UTC
libcprops-0.1.12-1.1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/libcprops-0.1.12-1.1.fc16

Comment 33 Fedora Update System 2012-02-05 19:31:11 UTC
libcprops-0.1.12-1.1.el6 has been pushed to the Fedora EPEL 6 testing repository.

Comment 34 Fedora Update System 2012-02-17 00:54:58 UTC
libcprops-0.1.12-1.1.fc16 has been pushed to the Fedora 16 stable repository.

Comment 35 Fedora Update System 2012-02-20 19:03:24 UTC
libcprops-0.1.12-1.1.el6 has been pushed to the Fedora EPEL 6 stable repository.

Comment 36 Fedora Update System 2012-06-02 19:29:07 UTC
libcprops-0.1.12-1.1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/libcprops-0.1.12-1.1.fc17


Note You need to log in before you can comment on or make changes to this bug.