[csw-devel] Fwd: SF.net SVN: gar:[16267] csw/mgar/pkg/libconfuse/trunk

Dagobert Michelsen dam at opencsw.org
Thu Nov 24 21:50:33 CET 2011


Hi Daniel,

I took the liberty of updating your package and comment it here.

Best regards

  -- Dago

Anfang der weitergeleiteten E-Mail:

> Von: dmichelsen at users.sourceforge.net
> Datum: 24. November 2011 21:34:01 MEZ
> An: devel at lists.opencsw.org
> Betreff: [csw-devel] SF.net SVN: gar:[16267] csw/mgar/pkg/libconfuse/trunk
> Antwort an: Broadcasts commit logs for build descriptions and GAR <devel at lists.opencsw.org>
> 
> Revision: 16267
>          http://gar.svn.sourceforge.net/gar/?rev=16267&view=rev
> Author:   dmichelsen
> Date:     2011-11-24 20:34:00 +0000 (Thu, 24 Nov 2011)
> Log Message:
> -----------
> libconfuse/trunk: Rework package split

  ^^^^^^^^^^^ Please always use name in pkg/ as prefix to ease reading commit logs.

> 
> Modified Paths:
> --------------
>    csw/mgar/pkg/libconfuse/trunk/Makefile
> 
> Removed Paths:
> -------------
>    csw/mgar/pkg/libconfuse/trunk/files/setopt.diff
> 
> Modified: csw/mgar/pkg/libconfuse/trunk/Makefile
> ===================================================================
> --- csw/mgar/pkg/libconfuse/trunk/Makefile	2011-11-24 18:02:22 UTC (rev 16266)
> +++ csw/mgar/pkg/libconfuse/trunk/Makefile	2011-11-24 20:34:00 UTC (rev 16267)
> @@ -2,18 +2,7 @@
> VERSION = 2.7
> CATEGORIES = lib
> 
> -PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386

I moved this down, there is a "natural" order of options most maintainers follow.

> -
> -# For libConfuse 2.7, the test suite doesn't compile cleanly on Solaris,
> -# so we skip it.  This should be re-assessed with each new release
> -# from upstream.  Proposed fixes for the test suite to be submitted
> -# upstream.
> -ifeq ($(VERSION),2.7)
> -#TEST_TARGET = check
> -TEST_SCRIPTS = 
> -endif

Same. As this is about testing it would go below build:
  extract -> configure -> build -> test -> install -> merge -> package
So the order in the Makefile is similar.

> -
> -DESCRIPTION = a configuration file parser library
> +DESCRIPTION = A configuration file parser library

Desc should start with uppercase to ease reading of pkginfo

> define BLURB
>   libConfuse is a configuration file parser library, licensed under
>   the terms of the ISC license, and written in C. It supports sections
> @@ -24,32 +13,34 @@
>   to a program using a simple API.
> endef
> 
> -#MASTER_SITES = http://bzero.se/confuse/
> MASTER_SITES = http://savannah.nongnu.org/download/confuse/
> -PATCHFILES = 

Strip empty stuff.

> -DISTFILES  = confuse-$(VERSION).tar.gz
> -DISTFILES += $(PATCHFILES)
> DISTNAME = confuse-$(VERSION)
> +DISTFILES += $(DISTNAME).tar.gz

It is best practice to set DISTNAME and derive from that as it is also used
to calculate the WORKSRC location.

> -EXTRA_DOCS = $(PATCHFILES)

Do not add patches to the distribution, soon we will have source packages for this
in addition to the Makefile and upstream stuff.

> +PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386

This is usually right before defining the packages, like
1. where to package
2. what to package

> -PACKAGES += CSWlibconfuse0-1
> -SPKG_DESC_CSWlibconfuse0-1 = a configuration file parser library
> +LICENSE = AUTHORS

license is pretty much mandatory, although upstream doesn't include a decent one.

> -PACKAGES += CSWlibconfuse0-dev

The library is libconfuse.so.0, so the next version will probably be libconfuse.so.1.
The dev-package is usually just for the latest, so the variable soname part is skipped
here.

> -SPKG_DESC_CSWlibconfuse0-dev = Development files for libconfuse
> -RUNTIME_DEP_PKGS_CSWlibconfuse0-dev = CSWlibconfuse0-1

The name for libconfuse.so.1 is CSWlibconfuse1, probably my example "confused" you :-)

> +PACKAGES += CSWlibconfuse0
> +SPKG_DESC_CSWlibconfuse0 = A configuration file parser library, libconfuse.so.0
> +PKGFILES_CSWlibconfuse0 += $(call pkgfiles_lib,libconfuse.so.0)

You must also tell GAR which files belong to which package. Usually you do this for all
but one which gets the rest...

> +OBSOLETED_BY_CSWlibconfuse0 += CSWlibconfuse
> 
> -# We define upstream file regex so we can be notifed of new upstream software release
> -UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.gz

(no longer used)

> +PACKAGES += CSWlibconfuse-dev
> +SPKG_DESC_CSWlibconfuse-dev = Development files for libconfuse.so.0
> +# PKGFILES is catchall

...likt this package.

> +RUNTIME_DEP_PKGS_CSWlibconfuse-dev += CSWlibconfuse0
> 
> -# If the url used to check for software update is different of MASTER_SITES, then 
> -# uncomment the next line. Otherwise it is set by default to the value of MASTER_SITES
> -# UPSTREAM_MASTER_SITES = 
> -

Stripped boilerplate code.

> BUILD64 = 1
> 
> CONFIGURE_ARGS = $(DIRPATHS)
> CONFIGURE_ARGS += --enable-shared --disable-nls
> 
> +# For libConfuse 2.7, the test suite doesn't compile cleanly on Solaris,
> +# so we skip it.  This should be re-assessed with each new release
> +# from upstream.  Proposed fixes for the test suite to be submitted
> +# upstream.
> +SKIPTEST-2.7 = 1
> +SKIPTEST = $(SKIPTEST-$(VERSION))
> +

In general variables assignments are preferable over conditionals as they are easier to
read and the idiom is widely used in GAR and the Makefiles.

> include gar/category.mk
> 
> Deleted: csw/mgar/pkg/libconfuse/trunk/files/setopt.diff

Remove unused patches.

> ===================================================================
> --- csw/mgar/pkg/libconfuse/trunk/files/setopt.diff	2011-11-24 18:02:22 UTC (rev 16266)
> +++ csw/mgar/pkg/libconfuse/trunk/files/setopt.diff	2011-11-24 20:34:00 UTC (rev 16267)
> @@ -1,39 +0,0 @@
> ---- confuse-2.6/src/confuse.c	(revision x)
> -+++ confuse-2.6/src/confuse.c	(revision y)
> -@@ -65,7 +65,6 @@
> - 
> - static int cfg_parse_internal(cfg_t *cfg, int level,
> -                               int force_state, cfg_opt_t *force_opt);
> --static cfg_value_t *cfg_setopt(cfg_t *cfg, cfg_opt_t *opt, char *value);
> - 
> - #define STATE_CONTINUE 0
> - #define STATE_EOF -1
> -@@ -531,7 +530,7 @@
> -     }
> - }
> - 
> --static cfg_value_t *cfg_setopt(cfg_t *cfg, cfg_opt_t *opt, char *value)
> -+DLLIMPORT cfg_value_t *cfg_setopt(cfg_t *cfg, cfg_opt_t *opt, char *value)
> - {
> -     cfg_value_t *val = 0;
> -     int b;
> ---- confuse-2.6/src/confuse.h	(revision x)
> -+++ confuse-2.6/src/confuse.h	(revision y)
> -@@ -839,6 +839,16 @@
> -  */
> - DLLIMPORT int __export cfg_parse_boolean(const char *s);
> - 
> -+/** Set an option (create an instance of an option).
> -+ *
> -+ * @param cfg The configuration file context.
> -+ * @param opt The option definition.
> -+ * @param value The initial value for the option.
> -+ *
> -+ * @return Returns a pointer to the value object.
> -+ */
> -+DLLIMPORT cfg_value_t __export *cfg_setopt(cfg_t *cfg, cfg_opt_t *opt, char *value);
> -+
> - /** Return an option given it's name.
> -  *
> -  * @param cfg The configuration file context.
> -
> 
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
> 
> _______________________________________________
> devel mailing list
> devel at lists.opencsw.org
> https://lists.opencsw.org/mailman/listinfo/devel

-- 
"You don't become great by trying to be great, you become great by wanting to do something,
and then doing it so hard that you become great in the process." - xkcd #896



More information about the devel mailing list