rpms/mcs/F-11 libmcs-0.7.1-keyfile-change-string.patch, NONE, 1.1 libmcs-0.7.1-sysconfdir.patch, NONE, 1.1 libmcs-0.7.1-util.patch, NONE, 1.1 libmcs-0.7.1-walk.patch, NONE, 1.1 mcs.spec, 1.10, 1.11

Michael Schwendt mschwendt at fedoraproject.org
Wed Dec 30 12:12:59 UTC 2009


Author: mschwendt

Update of /cvs/pkgs/rpms/mcs/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28408

Modified Files:
	mcs.spec 
Added Files:
	libmcs-0.7.1-keyfile-change-string.patch 
	libmcs-0.7.1-sysconfdir.patch libmcs-0.7.1-util.patch 
	libmcs-0.7.1-walk.patch 
Log Message:
sync with Rawhide

libmcs-0.7.1-keyfile-change-string.patch:
 keyfile.c |    2 ++
 1 file changed, 2 insertions(+)

--- NEW FILE libmcs-0.7.1-keyfile-change-string.patch ---
diff -Nur libmcs-0.7.1-orig/src/backends/default/keyfile.c libmcs-0.7.1/src/backends/default/keyfile.c
--- libmcs-0.7.1-orig/src/backends/default/keyfile.c	2008-04-21 00:05:48.000000000 +0200
+++ libmcs-0.7.1/src/backends/default/keyfile.c	2009-12-29 20:54:48.213678077 +0100
@@ -316,6 +316,8 @@
 
 		if (value != NULL)
 			line->value = strdup(value);
+		else
+			line->value = NULL;
 	}
 	else
 		keyfile_create_line(sec, key, value);

libmcs-0.7.1-sysconfdir.patch:
 buildsys.mk.in |    1 +
 extra.mk.in    |    1 +
 2 files changed, 2 insertions(+)

--- NEW FILE libmcs-0.7.1-sysconfdir.patch ---
diff -Nur libmcs-0.7.1-orig/buildsys.mk.in libmcs-0.7.1/buildsys.mk.in
--- libmcs-0.7.1-orig/buildsys.mk.in	2008-04-21 00:05:48.000000000 +0200
+++ libmcs-0.7.1/buildsys.mk.in	2009-12-23 23:40:12.000000000 +0100
@@ -65,6 +65,7 @@
 includesubdir ?= ${PACKAGE}
 mandir = @mandir@
 mansubdir ?= man1
+sysconfdir = @sysconfdir@
 
 OBJS1 = ${SRCS:.c=.o}
 OBJS2 = ${OBJS1:.cc=.o}
diff -Nur libmcs-0.7.1-orig/extra.mk.in libmcs-0.7.1/extra.mk.in
--- libmcs-0.7.1-orig/extra.mk.in	2008-04-21 00:05:48.000000000 +0200
+++ libmcs-0.7.1/extra.mk.in	2009-12-23 23:40:26.000000000 +0100
@@ -7,3 +7,4 @@
 KCONFIG_FLAGS = @KCONFIG_FLAGS@
 KCONFIG_LIBS = @KCONFIG_LIBS@
 plugindir = ${libdir}/mcs
+MCS_SYSCONFDIR = ${sysconfdir}

libmcs-0.7.1-util.patch:
 mcs_util.c |   29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

--- NEW FILE libmcs-0.7.1-util.patch ---
diff -Nur libmcs-0.7.1-orig/src/libmcs/mcs_util.c libmcs-0.7.1/src/libmcs/mcs_util.c
--- libmcs-0.7.1-orig/src/libmcs/mcs_util.c	2008-04-21 00:05:48.000000000 +0200
+++ libmcs-0.7.1/src/libmcs/mcs_util.c	2009-12-24 18:26:15.000000000 +0100
@@ -56,7 +56,7 @@
  *
  * \param str The string to duplicate.
  * \param len The maximum allowed length of the string.
- * \return The length of the string or len, whichever is smaller.
+ * \return The pointer to a copy of the string. Free this with free().
  */
 char *
 mcs_strndup(const char *str, size_t len)
@@ -68,7 +68,7 @@
 		return NULL;
 
 	memcpy(out, str, nlen);
-	out[len] = '\0';
+	out[nlen] = '\0';
 
 	return out;
 }
@@ -146,16 +146,22 @@
 {
 	size_t dsize = strlen(dest);
 	size_t len = strlen(src);
-	size_t res = dsize + len;
+	size_t res;
 
 	dest += dsize;
 	count -= dsize;
 
-	if (len >= count)
-		len = count - 1;
-
+	if (len >= count) {
+        if (count>0) {
+            len = count - 1;
+        }
+        else {
+            len = 0;
+        }
+    }
 	memcpy(dest, src, len);
 	dest[len] = 0;
+    res = dsize + len;
 
 	return res;
 }
@@ -172,15 +178,16 @@
  */
 size_t mcs_strlcpy(char *dest, const char *src, size_t size)
 {
-	size_t ret = strlen(src);
+	size_t srclen = strlen(src);
+    size_t retlen = 0;
 
 	if (size != 0)
 	{
-		size_t len = (ret >= size) ? size - 1 : ret;
-		memcpy(dest, src, len);
-		dest[len] = '\0';
+		retlen = (srclen >= size) ? size - 1 : srclen;
+		memcpy(dest, src, retlen);
+		dest[retlen] = '\0';
 	}
 
-	return ret;
+	return retlen;
 }
 

libmcs-0.7.1-walk.patch:
 mcs_walk_config.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- NEW FILE libmcs-0.7.1-walk.patch ---
diff -Nur libmcs-0.7.1-orig/src/tools/mcs-walk-config/mcs_walk_config.c libmcs-0.7.1/src/tools/mcs-walk-config/mcs_walk_config.c
--- libmcs-0.7.1-orig/src/tools/mcs-walk-config/mcs_walk_config.c	2008-04-21 00:05:48.000000000 +0200
+++ libmcs-0.7.1/src/tools/mcs-walk-config/mcs_walk_config.c	2009-12-24 00:10:01.000000000 +0100
@@ -37,7 +37,7 @@
 {
 	mcs_handle_t *h;
 	mowgli_queue_t *groups, *i;
-	int entries = 0, sections = 0;
+	int entries = 0, sections = 0, avgentries = 0;
 
 	if (argc < 2)
 	{
@@ -75,8 +75,9 @@
 	mowgli_queue_destroy(groups);
 	mcs_fini();
 
+    avgentries = sections ? (entries/sections) : 0;
 	printf("\n%d entries across %d groups, average %d entries per group\n",
-		entries, sections, entries / sections);
+		entries, sections, avgentries);
 
 	return 0;
 }


Index: mcs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mcs/F-11/mcs.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- mcs.spec	26 Feb 2009 00:02:04 -0000	1.10
+++ mcs.spec	30 Dec 2009 12:12:59 -0000	1.11
@@ -1,16 +1,30 @@
 Name:           mcs
 Version:        0.7.1
-Release:        2%{?dist}
-Summary:        A configuration file abstraction library
+Release:        9%{?dist}
+Summary:        Configuration file abstraction system
 
 Group:          Applications/System
 License:        BSD
-URL:            http://atheme.org/projects/mcs.shtml
+
+# 404 not found - http://atheme.org/projects/mcs.shtml
+URL:            http://atheme.org
+
 Source0:        http://distfiles.atheme.org/libmcs-%{version}.tgz
+# submitted upstream, build config fix
+Patch0: libmcs-0.7.1-sysconfdir.patch
+# submitted upstream, floating point exception fix
+Patch1: libmcs-0.7.1-walk.patch
+# submitted upstream, safety fixes in string utility functions
+Patch2: libmcs-0.7.1-util.patch
+# submitted upstream, safety fix for keyfile set_string function
+Patch3: libmcs-0.7.1-keyfile-change-string.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:  GConf2-devel
 BuildRequires:  libmowgli-devel >= 0.4.0
+BuildRequires:  GConf2-devel
+# would be needed for kconfig support
+#BuildRequires:  kdelibs-devel
 
 %description
 mcs is a library and set of userland tools which abstract the storage of
@@ -25,8 +39,12 @@ specific data storage requirement, nor i
 software suite.
 
 %package libs
-Summary:        Library files for the mcs configuration system
+Summary:        Configuration file abstraction library
 Group:          System Environment/Libraries
+Provides:       libmcs = %{version}-%{release}
+%{?_isa:
+Provides:       libmcs%{?_isa} = %{version}-%{release}
+}
 
 %description libs
 mcs is a library and set of userland tools which abstract the storage of
@@ -45,6 +63,10 @@ This package contains the libraries nece
 %package devel
 Summary:        Development files for the mcs configuration system
 Group:          Development/Libraries
+Provides:       libmcs-devel = %{version}-%{release}
+%{?_isa:
+Provides:       libmcs-devel%{?_isa} = %{version}-%{release}
+}
 
 Requires:       mcs-libs = %{version}-%{release}
 Requires:       pkgconfig
@@ -66,9 +88,14 @@ This package contains the files necessar
 
 %prep
 %setup -q -n libmcs-%{version}
+%patch0 -p1 -b .sysconfdir
+%patch1 -p1 -b .walk
+%patch2 -p1 -b .util
+%patch3 -p1 -b .keyfile-change-string
 
 # Make the build system more verbose
-perl -pi -e 's/^\.SILENT:.*$//' buildsys.mk.in
+#perl -pi -e 's/^\.SILENT:.*$//' buildsys.mk.in
+sed -i '\,^.SILENT:,d' buildsys.mk.in
 
 # The build generates a wrong SONAME, fix it.
 perl -pi -e "s/-soname=.*'/-soname=\\\$\{LIB\}.\\\$\{LIB_MAJOR\}'/" configure
@@ -76,6 +103,7 @@ perl -pi -e "s/-soname=.*'/-soname=\\\$\
 %build
 %configure \
     --enable-gconf \
+    --disable-kconfig \
     --disable-dependency-tracking
 
 make %{?_smp_mflags}
@@ -83,12 +111,12 @@ make %{?_smp_mflags}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
-echo "gconf" > $RPM_BUILD_ROOT%{_sysconfdir}/mcs-backend
-chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/mcs-backend
+make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
 
+# Example for a default site-wide storage backend setting:
+#mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
+#echo "gconf" > $RPM_BUILD_ROOT%{_sysconfdir}/mcs-backend
+#chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/mcs-backend
 
 
 %clean
@@ -106,17 +134,42 @@ rm -rf $RPM_BUILD_ROOT
 %files libs
 %defattr(-,root,root,-)
 %doc AUTHORS COPYING README TODO
-%config(noreplace) %{_sysconfdir}/mcs-backend
+#%config(noreplace) %{_sysconfdir}/mcs-backend
 %{_libdir}/*.so.*
 %{_libdir}/mcs
 
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/*.so
-%{_includedir}/libmcs
+%{_includedir}/libmcs/
 %{_libdir}/pkgconfig/libmcs.pc
 
 %changelog
+* Tue Dec 29 2009 Michael Schwendt <mschwendt at fedoraproject.org> - 0.7.1-9
+- Apply safety fix to keyfile set_string function.
+
+* Thu Dec 24 2009 Michael Schwendt <mschwendt at fedoraproject.org> - 0.7.1-8
+- Apply safety fixes to string utility functions.
+
+* Thu Dec 24 2009 Michael Schwendt <mschwendt at fedoraproject.org> - 0.7.1-7
+- Fix floating point exception in mcs-walk-config tool.
+
+* Wed Dec 23 2009 Michael Schwendt <mschwendt at fedoraproject.org> - 0.7.1-6
+- Add --disable-kconfig to fix build requirements usage (#529696).
+  The kconfig backend has never been built or included before.
+- Fix MCS_SYSCONFDIR build config value, so /etc/mcs-backend file is found.
+  Don't provide a default site-wide config file anymore. Making it default
+  to "gconf" would switch backends for everyone from "default".
+
+* Sat Jul 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Fri Jun  5 2009 Michael Schwendt <mschwendt at fedoraproject.org> - 0.7.1-4
+- Rebuild for new libmowgli SONAME.
+
+* Thu Jun  4 2009 Michael Schwendt <mschwendt at fedoraproject.org> - 0.7.1-3
+- Add virtual Provides for libmcs/libmcs-devel.
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list