From a60cf36ca68fc440918d1fa7fb7dfc335aa90ebe Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 24 Mar 2009 07:33:41 +0000 Subject: [PATCH] New upstream release. Serious spec file cleanup. --- .cvsignore | 2 +- corosync-1807.diff | 20 - corosync-bump-soname.diff | 178 --------- corosync-trunk.diff | 804 -------------------------------------- corosync.spec | 135 ++++--- sources | 2 +- 6 files changed, 85 insertions(+), 1056 deletions(-) delete mode 100644 corosync-1807.diff delete mode 100644 corosync-bump-soname.diff delete mode 100644 corosync-trunk.diff diff --git a/.cvsignore b/.cvsignore index daeebd7..3c4452c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-0.94.tar.gz +corosync-0.95.tar.gz diff --git a/corosync-1807.diff b/corosync-1807.diff deleted file mode 100644 index 1b6a643..0000000 --- a/corosync-1807.diff +++ /dev/null @@ -1,20 +0,0 @@ -diff -Naurd corosync-trunk.orig/exec/vsf_quorum.c corosync-trunk/exec/vsf_quorum.c ---- corosync-trunk.orig/exec/vsf_quorum.c 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/exec/vsf_quorum.c 2009-03-10 09:51:09.000000000 +0100 -@@ -116,8 +116,6 @@ - log_printf (LOG_LEVEL_NOTICE, "This node is within the non-primary component and will NOT provide any services.\n"); - } - -- memcpy(&quorum_ring_id, ring_id, sizeof (quorum_ring_id)); -- - quorum_view_list_entries = view_list_entries; - - /* Tell sync() only if there is a new ring_id (ie this is not a 'fake' quorum event) */ -@@ -125,6 +123,7 @@ - sync_primary_callback_fn(view_list, view_list_entries, - primary_designated, ring_id); - } -+ memcpy(&quorum_ring_id, ring_id, sizeof (quorum_ring_id)); - memcpy(quorum_view_list, view_list, sizeof(unsigned int)*view_list_entries); - - /* Tell internal listeners */ diff --git a/corosync-bump-soname.diff b/corosync-bump-soname.diff deleted file mode 100644 index c3788a7..0000000 --- a/corosync-bump-soname.diff +++ /dev/null @@ -1,178 +0,0 @@ -diff -Naurd corosync-0.94.orig/exec/Makefile corosync-0.94/exec/Makefile ---- corosync-0.94.orig/exec/Makefile 2009-02-19 03:23:58.000000000 +0100 -+++ corosync-0.94/exec/Makefile 2009-03-03 05:49:45.000000000 +0100 -@@ -73,7 +73,7 @@ - EXEC_OBJS = $(MAIN_OBJS) - override CFLAGS += -fPIC - --all:libtotem_pg.a libtotem_pg.so.2.0.0 liblogsys.a liblogsys.so.2.0.0 \ -+all:libtotem_pg.a libtotem_pg.so.3.0.0 liblogsys.a liblogsys.so.3.0.0 \ - ../lcr/lcr_ifact.o corosync_ \ - objdb.lcrso vsf_ykd.lcrso coroparse.lcrso vsf_quorum.lcrso - else -@@ -125,18 +125,18 @@ - - ifeq (${COROSYNC_COMPAT}, DARWIN) - --libtotem_pg.so.2.0.0: $(TOTEM_OBJS) -+libtotem_pg.so.3.0.0: $(TOTEM_OBJS) - $(CC) $(LDFLAGS) -bundle -bind_at_load $(TOTEM_OBJS) -o $@ - --liblogsys.so.2.0.0: $(LOGSYS_OBJS) -+liblogsys.so.3.0.0: $(LOGSYS_OBJS) - $(CC) $(LDFLAGS) -bundle -bind_at_load $(LOGSYS_OBJS) -o $@ - else - --libtotem_pg.so.2.0.0: $(TOTEM_OBJS) -- $(CC) $(LDFLAGS) -shared -Wl,-soname,libtotem_pg.so.2 $(TOTEM_OBJS) -o $@ -+libtotem_pg.so.3.0.0: $(TOTEM_OBJS) -+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libtotem_pg.so.3 $(TOTEM_OBJS) -o $@ - --liblogsys.so.2.0.0: $(LIBLOGSYS_OBJS) -- $(CC) -shared -Wl,-soname,liblogsys.so.2 $(LOGSYS_OBJS) -o $@ $(LDFLAGS) -+liblogsys.so.3.0.0: $(LIBLOGSYS_OBJS) -+ $(CC) -shared -Wl,-soname,liblogsys.so.3 $(LOGSYS_OBJS) -o $@ $(LDFLAGS) - - endif - -diff -Naurd corosync-0.94.orig/lib/Makefile corosync-0.94/lib/Makefile ---- corosync-0.94.orig/lib/Makefile 2009-02-19 03:23:58.000000000 +0100 -+++ corosync-0.94/lib/Makefile 2009-03-03 05:49:45.000000000 +0100 -@@ -37,14 +37,14 @@ - - override LDFLAGS += -L./ - --all: libcpg.a libcpg.so.2.0.0 \ -- libconfdb.a libconfdb.so.2.0.0 \ -- libevs.a libevs.so.2.0.0 \ -- libcfg.a libcfg.so.2.0.0 \ -- libquorum.a libquorum.so.2.0.0 \ -- libpload.a libpload.so.2.0.0 \ -- libcoroipc.a libcoroipc.so.2.0.0 \ -- libvotequorum.a libvotequorum.so.2.0.0 -+all: libcpg.a libcpg.so.3.0.0 \ -+ libconfdb.a libconfdb.so.3.0.0 \ -+ libevs.a libevs.so.3.0.0 \ -+ libcfg.a libcfg.so.3.0.0 \ -+ libquorum.a libquorum.so.3.0.0 \ -+ libpload.a libpload.so.3.0.0 \ -+ libcoroipc.a libcoroipc.so.3.0.0 \ -+ libvotequorum.a libvotequorum.so.3.0.0 - - libcoroipc.a: coroipc.o - $(AR) -rc libcoroipc.a coroipc.o -@@ -52,55 +52,55 @@ - ifeq (${COROSYNC_COMPAT}, DARWIN) - - DARWIN_OPTS=-dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0 --libcoroipc.so.2.0.0: coroipc.o -+libcoroipc.so.3.0.0: coroipc.o - $(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o -o $@ - --libevs.so.2.0.0: coroipc.o evs.o -+libevs.so.3.0.0: coroipc.o evs.o - $(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o evs.o -o $@ - --libcpg.so.2.0.0: coroipc.o cpg.o -+libcpg.so.3.0.0: coroipc.o cpg.o - $(CC) $(DARWIN_OPTS) coroipc.o cpg.o -o $@ - --libquorum.so.2.0.0: coroipc.o quorum.o -+libquorum.so.3.0.0: coroipc.o quorum.o - $(CC) $(DARWIN_OPTS) coroipc.o quorum.o -o $@ - --libvotequorum.so.2.0.0: coroipc.o votequorum.o -+libvotequorum.so.3.0.0: coroipc.o votequorum.o - $(CC) $(DARWIN_OPTS) coroipc.o votequorum.o -o $@ - --libconfdb.so.2.0.0: coroipc.o confdb.o sa-confdb.o -+libconfdb.so.3.0.0: coroipc.o confdb.o sa-confdb.o - $(CC) $(LDFLAGS) $(DARWIN_OPTS) coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@ - --libcfg.so.2.0.0: coroipc.o cfg.o -+libcfg.so.3.0.0: coroipc.o cfg.o - $(CC) $(DARWIN_OPTS) coroipc.o cfg.o -o $@ - --libpload.so.2.0.0: coroipc.o pload.o -+libpload.so.3.0.0: coroipc.o pload.o - $(CC) $(DARWIN_OPTS) coroipc.o pload.o -o $@ - - else - --libcoroipc.so.2.0.0: coroipc.o -- $(CC) $(LDFLAGS) -shared -Wl,-soname,libcoroipc.so.2,-version-script=$(srcdir)$(subdir)libcoroipc.versions coroipc.o -o $@ -+libcoroipc.so.3.0.0: coroipc.o -+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libcoroipc.so.3,-version-script=$(srcdir)$(subdir)libcoroipc.versions coroipc.o -o $@ - --libevs.so.2.0.0: coroipc.o evs.o -- $(CC) $(LDFLAGS) -shared -Wl,-soname,libevs.so.2,-version-script=$(srcdir)$(subdir)libevs.versions coroipc.o evs.o -o $@ -+libevs.so.3.0.0: coroipc.o evs.o -+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libevs.so.3,-version-script=$(srcdir)$(subdir)libevs.versions coroipc.o evs.o -o $@ - --libcpg.so.2.0.0: coroipc.o cpg.o -- $(CC) -shared -Wl,-soname,libcpg.so.2,-version-script=$(srcdir)$(subdir)libcpg.versions coroipc.o cpg.o -o $@ -+libcpg.so.3.0.0: coroipc.o cpg.o -+ $(CC) -shared -Wl,-soname,libcpg.so.3,-version-script=$(srcdir)$(subdir)libcpg.versions coroipc.o cpg.o -o $@ - --libquorum.so.2.0.0: coroipc.o quorum.o -- $(CC) -shared -Wl,-soname,libquorum.so.2,-version-script=$(srcdir)$(subdir)libquorum.versions coroipc.o quorum.o -o $@ -+libquorum.so.3.0.0: coroipc.o quorum.o -+ $(CC) -shared -Wl,-soname,libquorum.so.3,-version-script=$(srcdir)$(subdir)libquorum.versions coroipc.o quorum.o -o $@ - --libvotequorum.so.2.0.0: coroipc.o votequorum.o -- $(CC) -shared -Wl,-soname,libvotequorum.so.2,-version-script=$(srcdir)$(subdir)libvotequorum.versions coroipc.o votequorum.o -o $@ -+libvotequorum.so.3.0.0: coroipc.o votequorum.o -+ $(CC) -shared -Wl,-soname,libvotequorum.so.3,-version-script=$(srcdir)$(subdir)libvotequorum.versions coroipc.o votequorum.o -o $@ - --libconfdb.so.2.0.0: coroipc.o confdb.o sa-confdb.o -- $(CC) $(LDFLAGS) -shared -Wl,-soname,libconfdb.so.2,-version-script=$(srcdir)$(subdir)libconfdb.versions coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@ -+libconfdb.so.3.0.0: coroipc.o confdb.o sa-confdb.o -+ $(CC) $(LDFLAGS) -shared -Wl,-soname,libconfdb.so.3,-version-script=$(srcdir)$(subdir)libconfdb.versions coroipc.o confdb.o sa-confdb.o ../lcr/lcr_ifact.o -o $@ - --libcfg.so.2.0.0: coroipc.o cfg.o -- $(CC) -shared -Wl,-soname,libcfg.so.2,-version-script=$(srcdir)$(subdir)libcfg.versions coroipc.o cfg.o -o $@ -+libcfg.so.3.0.0: coroipc.o cfg.o -+ $(CC) -shared -Wl,-soname,libcfg.so.3,-version-script=$(srcdir)$(subdir)libcfg.versions coroipc.o cfg.o -o $@ - --libpload.so.2.0.0: coroipc.o pload.o -- $(CC) -shared -Wl,-soname,libpload.so.2,-version-script=$(srcdir)$(subdir)libpload.versions coroipc.o cfg.o -o $@ -+libpload.so.3.0.0: coroipc.o pload.o -+ $(CC) -shared -Wl,-soname,libpload.so.3,-version-script=$(srcdir)$(subdir)libpload.versions coroipc.o cfg.o -o $@ - - endif - -diff -Naurd corosync-0.94.orig/Makefile corosync-0.94/Makefile ---- corosync-0.94.orig/Makefile 2009-02-25 05:58:08.000000000 +0100 -+++ corosync-0.94/Makefile 2009-03-03 05:49:45.000000000 +0100 -@@ -133,11 +133,11 @@ - - for eLib in $(EXEC_LIBS); do \ - ( cd $(builddir) ; \ -- ln -sf lib$$eLib.so.2.0.0 exec/lib$$eLib.so; \ -- ln -sf lib$$eLib.so.2.0.0 exec/lib$$eLib.so.2; \ -+ ln -sf lib$$eLib.so.3.0.0 exec/lib$$eLib.so; \ -+ ln -sf lib$$eLib.so.3.0.0 exec/lib$$eLib.so.3; \ - $(CP) -a exec/lib$$eLib.so $(DESTDIR)$(LIBDIR); \ -- $(CP) -a exec/lib$$eLib.so.2 $(DESTDIR)$(LIBDIR); \ -- install -m 755 exec/lib$$eLib.so.2.* $(DESTDIR)$(LIBDIR); \ -+ $(CP) -a exec/lib$$eLib.so.3 $(DESTDIR)$(LIBDIR); \ -+ install -m 755 exec/lib$$eLib.so.3.* $(DESTDIR)$(LIBDIR); \ - if [ "xYES" = "x$(STATICLIBS)" ]; then \ - install -m 755 exec/lib$$eLib.a $(DESTDIR)$(LIBDIR); \ - if [ ${COROSYNC_COMPAT} = "DARWIN" ]; then \ -@@ -149,11 +149,11 @@ - - for aLib in $(COROSYNC_LIBS); do \ - ( cd $(builddir) ; \ -- ln -sf lib$$aLib.so.2.0.0 lib/lib$$aLib.so; \ -- ln -sf lib$$aLib.so.2.0.0 lib/lib$$aLib.so.2; \ -+ ln -sf lib$$aLib.so.3.0.0 lib/lib$$aLib.so; \ -+ ln -sf lib$$aLib.so.3.0.0 lib/lib$$aLib.so.3; \ - $(CP) -a lib/lib$$aLib.so $(DESTDIR)$(LIBDIR); \ -- $(CP) -a lib/lib$$aLib.so.2 $(DESTDIR)$(LIBDIR); \ -- install -m 755 lib/lib$$aLib.so.2.* $(DESTDIR)$(LIBDIR); \ -+ $(CP) -a lib/lib$$aLib.so.3 $(DESTDIR)$(LIBDIR); \ -+ install -m 755 lib/lib$$aLib.so.3.* $(DESTDIR)$(LIBDIR); \ - if [ "xYES" = "x$(STATICLIBS)" ]; then \ - install -m 755 lib/lib$$aLib.a $(DESTDIR)$(LIBDIR); \ - if [ ${COROSYNC_COMPAT} = "DARWIN" ]; then \ diff --git a/corosync-trunk.diff b/corosync-trunk.diff deleted file mode 100644 index 1829638..0000000 --- a/corosync-trunk.diff +++ /dev/null @@ -1,804 +0,0 @@ -diff -Naurd corosync-0.94.orig/exec/apidef.c corosync-trunk/exec/apidef.c ---- corosync-0.94.orig/exec/apidef.c 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/exec/apidef.c 2009-03-06 08:38:34.000000000 +0100 -@@ -86,7 +86,6 @@ - .totem_family_get = totempg_my_family_get, - .totem_ring_reenable = totempg_ring_reenable, - .totem_mcast = main_mcast, -- .totem_send_ok = main_send_ok, - .totem_ifaces_get = totempg_ifaces_get, - .totem_ifaces_print = totempg_ifaces_print, - .totem_ip_print = totemip_print, -@@ -96,9 +95,11 @@ - .tpg_join = (typedef_tpg_join)totempg_groups_join, - .tpg_leave = (typedef_tpg_leave)totempg_groups_leave, - .tpg_joined_mcast = totempg_groups_mcast_joined, -- .tpg_joined_send_ok = totempg_groups_send_ok_joined, -+ .tpg_joined_reserve = totempg_groups_joined_reserve, -+ .tpg_joined_release = totempg_groups_joined_release, - .tpg_groups_mcast = (typedef_tpg_groups_mcast)totempg_groups_mcast_groups, -- .tpg_groups_send_ok = (typedef_tpg_groups_send_ok)totempg_groups_send_ok_groups, -+ .tpg_groups_reserve = NULL, -+ .tpg_groups_release = NULL, - .sync_request = sync_request, - .quorum_is_quorate = corosync_quorum_is_quorate, - .quorum_register_callback = corosync_quorum_register_callback, -diff -Naurd corosync-0.94.orig/exec/ipc.c corosync-trunk/exec/ipc.c ---- corosync-0.94.orig/exec/ipc.c 2009-03-03 01:58:16.000000000 +0100 -+++ corosync-trunk/exec/ipc.c 2009-03-06 08:38:34.000000000 +0100 -@@ -270,7 +270,7 @@ - struct res_overlay res_overlay; - struct iovec send_ok_joined_iovec; - int send_ok = 0; -- int send_ok_joined = 0; -+ int reserved_msgs = 0; - - for (;;) { - sop.sem_num = 0; -@@ -296,14 +296,16 @@ - - send_ok_joined_iovec.iov_base = (char *)header; - send_ok_joined_iovec.iov_len = header->size; -- send_ok_joined = totempg_groups_send_ok_joined (corosync_group_handle, -+ -+ reserved_msgs = totempg_groups_joined_reserve ( -+ corosync_group_handle, - &send_ok_joined_iovec, 1); - - send_ok = - (corosync_quorum_is_quorate() == 1 || ais_service[conn_info->service]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) && ( - (ais_service[conn_info->service]->lib_engine[header->id].flow_control == CS_LIB_FLOW_CONTROL_NOT_REQUIRED) || - ((ais_service[conn_info->service]->lib_engine[header->id].flow_control == CS_LIB_FLOW_CONTROL_REQUIRED) && -- (send_ok_joined) && -+ (reserved_msgs) && - (sync_in_process() == 0))); - - if (send_ok) { -@@ -321,6 +323,7 @@ - res_overlay.header.size); - } - -+ totempg_groups_joined_release (reserved_msgs); - cs_conn_refcount_dec (conn); - } - pthread_exit (0); -diff -Naurd corosync-0.94.orig/exec/logsys.c corosync-trunk/exec/logsys.c ---- corosync-0.94.orig/exec/logsys.c 2009-01-23 15:25:30.000000000 +0100 -+++ corosync-trunk/exec/logsys.c 2009-03-10 09:03:50.000000000 +0100 -@@ -112,8 +112,6 @@ - - static int logsys_facility = LOG_DAEMON; - --static char *logsys_format = NULL; -- - /* - * operating global variables - */ -@@ -139,7 +137,7 @@ - - static int logsys_buffer_full = 0; - --static char *format_buffer="[%6s] %b"; -+static char *format_buffer=NULL; - - static int log_requests_pending = 0; - -@@ -875,11 +873,25 @@ - { - pthread_mutex_lock (&logsys_config_mutex); - -- logsys_format = format; -+ if (format_buffer) { -+ free(format_buffer); -+ format_buffer = NULL; -+ } -+ -+ if (format) { -+ format_buffer = strdup(format); -+ } else { -+ format_buffer = strdup("[%6s] %b"); -+ } - - pthread_mutex_unlock (&logsys_config_mutex); - } - -+char *logsys_format_get (void) -+{ -+ return format_buffer; -+} -+ - void logsys_config_facility_set (char *name, unsigned int facility) - { - pthread_mutex_lock (&logsys_config_mutex); -diff -Naurd corosync-0.94.orig/exec/main.c corosync-trunk/exec/main.c ---- corosync-0.94.orig/exec/main.c 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/exec/main.c 2009-03-09 13:59:40.000000000 +0100 -@@ -83,7 +83,7 @@ - LOG_MODE_OUTPUT_STDERR | LOG_MODE_THREADED | LOG_MODE_FORK, - NULL, - LOG_DAEMON, -- "[%6s] %b", -+ NULL, - 1000000); - - LOGSYS_DECLARE_SUBSYS ("MAIN", LOG_INFO); -@@ -448,13 +448,6 @@ - return (totempg_groups_mcast_joined (corosync_group_handle, iovec, iov_len, guarantee)); - } - --extern int main_send_ok ( -- struct iovec *iovec, -- int iov_len) --{ -- return (totempg_groups_send_ok_joined (corosync_group_handle, iovec, iov_len)); --} -- - int main (int argc, char **argv) - { - char *error_string; -diff -Naurd corosync-0.94.orig/exec/mainconfig.c corosync-trunk/exec/mainconfig.c ---- corosync-0.94.orig/exec/mainconfig.c 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/exec/mainconfig.c 2009-03-09 13:59:40.000000000 +0100 -@@ -158,16 +158,14 @@ - } - } - if (!objdb_get_string (objdb,object_service_handle, "timestamp", &value)) { --/* todo change format string - if (strcmp (value, "on") == 0) { -- main_config->logmode |= LOG_MODE_DISPLAY_TIMESTAMP; -+ logsys_format_set("%t [%6s] %b"); - } else - if (strcmp (value, "off") == 0) { -- main_config->logmode &= ~LOG_MODE_DISPLAY_TIMESTAMP; -+ logsys_format_set(NULL); - } else { - goto parse_error; - } --*/ - } - - /* free old string on reload */ -diff -Naurd corosync-0.94.orig/exec/main.h corosync-trunk/exec/main.h ---- corosync-0.94.orig/exec/main.h 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/exec/main.h 2009-03-06 08:38:34.000000000 +0100 -@@ -62,8 +62,4 @@ - int iov_len, - unsigned int guarantee); - --extern int main_send_ok ( -- struct iovec *iovec, -- int iov_len); -- - #endif /* MAIN_H_DEFINED */ -diff -Naurd corosync-0.94.orig/exec/totemip.c corosync-trunk/exec/totemip.c ---- corosync-0.94.orig/exec/totemip.c 2009-01-26 21:46:45.000000000 +0100 -+++ corosync-trunk/exec/totemip.c 2009-03-03 04:57:37.000000000 +0100 -@@ -406,6 +406,7 @@ - memset(&nladdr, 0, sizeof(nladdr)); - nladdr.nl_family = AF_NETLINK; - -+ memset(&req, 0, sizeof(req)); - req.nlh.nlmsg_len = sizeof(req); - req.nlh.nlmsg_type = RTM_GETADDR; - req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; -diff -Naurd corosync-0.94.orig/exec/totempg.c corosync-trunk/exec/totempg.c ---- corosync-0.94.orig/exec/totempg.c 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/exec/totempg.c 2009-03-06 08:38:34.000000000 +0100 -@@ -145,6 +145,8 @@ - - static int mcast_packed_msg_count = 0; - -+static int totempg_reserved = 0; -+ - /* - * Function and data used to log messages - */ -@@ -225,8 +227,6 @@ - .mutex = PTHREAD_MUTEX_INITIALIZER - }; - --static int send_ok (int msg_size); -- - static unsigned char next_fragment = 1; - - static pthread_mutex_t totempg_mutex = PTHREAD_MUTEX_INITIALIZER; -@@ -241,6 +241,10 @@ - __FILE__, __LINE__, level, format, ##args); \ - } while (0); - -+static int msg_count_send_ok (int msg_count); -+ -+static int byte_count_send_ok (int byte_count); -+ - static struct assembly *assembly_ref (unsigned int nodeid) - { - struct assembly *assembly; -@@ -765,7 +769,7 @@ - total_size += iovec[i].iov_len; - } - -- if (send_ok (total_size + sizeof(unsigned short) * -+ if (byte_count_send_ok (total_size + sizeof(unsigned short) * - (mcast_packed_msg_count+1)) == 0) { - - pthread_mutex_unlock (&mcast_msg_mutex); -@@ -888,23 +892,44 @@ - /* - * Determine if a message of msg_size could be queued - */ --#define FUZZY_AVAIL_SUBTRACT 5 --static int send_ok ( -- int msg_size) -+static int msg_count_send_ok ( -+ int msg_count) - { - int avail = 0; -- int total; - -- avail = totemmrp_avail () - FUZZY_AVAIL_SUBTRACT; -+ avail = totemmrp_avail () - totempg_reserved - 1; - -- /* -- * msg size less then totempg_totem_config->net_mtu - 25 will take up -- * a full message, so add +1 -- * totempg_totem_config->net_mtu - 25 is for the totempg_mcast header -- */ -- total = (msg_size / (totempg_totem_config->net_mtu - 25)) + 1; -+ return (avail > msg_count); -+} - -- return (avail >= total); -+static int byte_count_send_ok ( -+ int byte_count) -+{ -+ unsigned int msg_count = 0; -+ int avail = 0; -+ -+ avail = totemmrp_avail () - 1; -+ -+ msg_count = (byte_count / (totempg_totem_config->net_mtu - 25)) + 1; -+ -+ return (avail > msg_count); -+} -+ -+static int send_reserve ( -+ int msg_size) -+{ -+ unsigned int msg_count = 0; -+ -+ msg_count = (msg_size / (totempg_totem_config->net_mtu - 25)) + 1; -+ totempg_reserved += msg_count; -+ -+ return (msg_count); -+} -+ -+static void send_release ( -+ int msg_count) -+{ -+ totempg_reserved -= msg_count; - } - - int totempg_callback_token_create ( -@@ -1091,7 +1116,7 @@ - return (res); - } - --int totempg_groups_send_ok_joined ( -+int totempg_groups_joined_reserve ( - hdb_handle_t handle, - struct iovec *iovec, - int iov_len) -@@ -1100,6 +1125,7 @@ - unsigned int size = 0; - unsigned int i; - unsigned int res; -+ unsigned int reserved = 0; - - pthread_mutex_lock (&totempg_mutex); - pthread_mutex_lock (&mcast_msg_mutex); -@@ -1116,14 +1142,28 @@ - size += iovec[i].iov_len; - } - -- res = send_ok (size); -+ reserved = send_reserve (size); -+ if (msg_count_send_ok (reserved) == 0) { -+ send_release (reserved); -+ reserved = 0; -+ } - - hdb_handle_put (&totempg_groups_instance_database, handle); - - error_exit: - pthread_mutex_unlock (&mcast_msg_mutex); - pthread_mutex_unlock (&totempg_mutex); -- return (res); -+ return (reserved); -+} -+ -+ -+void totempg_groups_joined_release (int msg_count) -+{ -+ pthread_mutex_lock (&totempg_mutex); -+ pthread_mutex_lock (&mcast_msg_mutex); -+ send_release (msg_count); -+ pthread_mutex_unlock (&mcast_msg_mutex); -+ pthread_mutex_unlock (&totempg_mutex); - } - - int totempg_groups_mcast_groups ( -@@ -1201,7 +1241,7 @@ - size += iovec[i].iov_len; - } - -- res = send_ok (size); -+ res = msg_count_send_ok (size); - - hdb_handle_put (&totempg_groups_instance_database, handle); - error_exit: -diff -Naurd corosync-0.94.orig/include/corosync/engine/coroapi.h corosync-trunk/include/corosync/engine/coroapi.h ---- corosync-0.94.orig/include/corosync/engine/coroapi.h 2009-02-26 15:49:41.000000000 +0100 -+++ corosync-trunk/include/corosync/engine/coroapi.h 2009-03-06 08:38:34.000000000 +0100 -@@ -413,8 +413,6 @@ - - int (*totem_mcast) (struct iovec *iovec, int iov_len, unsigned int guarantee); - -- int (*totem_send_ok) (struct iovec *iovec, int iov_len); -- - int (*totem_ifaces_get) ( - unsigned int nodeid, - struct totem_ip_address *interfaces, -@@ -472,11 +470,14 @@ - int iov_len, - int guarantee); - -- int (*tpg_joined_send_ok) ( -+ int (*tpg_joined_reserve) ( - hdb_handle_t handle, - struct iovec *iovec, - int iov_len); - -+ int (*tpg_joined_release) ( -+ int reserved_msgs); -+ - int (*tpg_groups_mcast) ( - hdb_handle_t handle, - int guarantee, -@@ -485,13 +486,16 @@ - struct iovec *iovec, - int iov_len); - -- int (*tpg_groups_send_ok) ( -+ int (*tpg_groups_reserve) ( - hdb_handle_t handle, - struct corosync_tpg_group *groups, - int groups_cnt, - struct iovec *iovec, - int iov_len); - -+ int (*tpg_groups_release) ( -+ int reserved_msgs); -+ - int (*sync_request) ( - char *service_name); - -diff -Naurd corosync-0.94.orig/include/corosync/engine/logsys.h corosync-trunk/include/corosync/engine/logsys.h ---- corosync-0.94.orig/include/corosync/engine/logsys.h 2009-01-16 09:59:09.000000000 +0100 -+++ corosync-trunk/include/corosync/engine/logsys.h 2009-03-10 09:03:50.000000000 +0100 -@@ -97,6 +97,8 @@ - extern void logsys_format_set ( - char *format); - -+extern char *logsys_format_get (void); -+ - extern unsigned int logsys_config_subsys_set ( - const char *subsys, - unsigned int tags, -diff -Naurd corosync-0.94.orig/include/corosync/ipc_cfg.h corosync-trunk/include/corosync/ipc_cfg.h ---- corosync-0.94.orig/include/corosync/ipc_cfg.h 2009-02-19 03:23:58.000000000 +0100 -+++ corosync-trunk/include/corosync/ipc_cfg.h 2009-03-06 11:07:35.000000000 +0100 -@@ -69,7 +69,8 @@ - MESSAGE_RES_CFG_TRYSHUTDOWN = 9, - MESSAGE_RES_CFG_TESTSHUTDOWN = 10, - MESSAGE_RES_CFG_GET_NODE_ADDRS = 11, -- MESSAGE_RES_CFG_LOCAL_GET = 12 -+ MESSAGE_RES_CFG_LOCAL_GET = 12, -+ MESSAGE_RES_CFG_REPLYTOSHUTDOWN = 13 - }; - - struct req_lib_cfg_statetrack { -diff -Naurd corosync-0.94.orig/include/corosync/totem/totempg.h corosync-trunk/include/corosync/totem/totempg.h ---- corosync-0.94.orig/include/corosync/totem/totempg.h 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/include/corosync/totem/totempg.h 2009-03-06 08:38:34.000000000 +0100 -@@ -110,10 +110,13 @@ - int iov_len, - int guarantee); - --extern int totempg_groups_send_ok_joined ( -+extern int totempg_groups_joined_reserve ( - hdb_handle_t handle, - struct iovec *iovec, - int iov_len); -+ -+extern void totempg_groups_joined_release ( -+ int msg_count); - - extern int totempg_groups_mcast_groups ( - hdb_handle_t handle, -diff -Naurd corosync-0.94.orig/lib/cfg.c corosync-trunk/lib/cfg.c ---- corosync-0.94.orig/lib/cfg.c 2009-02-19 03:23:58.000000000 +0100 -+++ corosync-trunk/lib/cfg.c 2009-03-06 11:07:35.000000000 +0100 -@@ -295,8 +295,6 @@ - - pthread_mutex_destroy (&cfg_instance->dispatch_mutex); - -- cslib_service_disconnect (&cfg_instance->ipc_ctx); -- - (void)saHandleDestroy (&cfg_hdb, cfg_handle); - - (void)saHandleInstancePut (&cfg_hdb, cfg_handle); -diff -Naurd corosync-0.94.orig/services/cfg.c corosync-trunk/services/cfg.c ---- corosync-0.94.orig/services/cfg.c 2009-02-25 12:14:47.000000000 +0100 -+++ corosync-trunk/services/cfg.c 2009-03-06 11:07:35.000000000 +0100 -@@ -237,8 +237,8 @@ - }, - { /* 10 */ - .lib_handler_fn = message_handler_req_lib_cfg_replytoshutdown, -- .response_size = 0, -- .response_id = 0, -+ .response_size = sizeof (struct res_lib_cfg_replytoshutdown), -+ .response_id = MESSAGE_RES_CFG_REPLYTOSHUTDOWN, - .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED - }, - { /* 11 */ -@@ -385,7 +385,7 @@ - return 0; - } - --static void send_test_shutdown(void * conn, int status) -+static void send_test_shutdown(void *only_conn, void *exclude_conn, int status) - { - struct res_lib_cfg_testshutdown res_lib_cfg_testshutdown; - struct list_head *iter; -@@ -396,17 +396,19 @@ - res_lib_cfg_testshutdown.header.error = status; - res_lib_cfg_testshutdown.flags = shutdown_flags; - -- if (conn) { -- TRACE1("sending testshutdown to %p", conn); -- api->ipc_response_send(conn, &res_lib_cfg_testshutdown, -- sizeof(res_lib_cfg_testshutdown)); -+ if (only_conn) { -+ TRACE1("sending testshutdown to only %p", only_conn); -+ api->ipc_dispatch_send(only_conn, &res_lib_cfg_testshutdown, -+ sizeof(res_lib_cfg_testshutdown)); - } else { - for (iter = trackers_list.next; iter != &trackers_list; iter = iter->next) { - struct cfg_info *ci = list_entry(iter, struct cfg_info, list); - -- TRACE1("sending testshutdown to %p", ci->tracker_conn); -- api->ipc_dispatch_send(ci->tracker_conn, &res_lib_cfg_testshutdown, -- sizeof(res_lib_cfg_testshutdown)); -+ if (ci->conn != exclude_conn) { -+ TRACE1("sending testshutdown to %p", ci->tracker_conn); -+ api->ipc_dispatch_send(ci->tracker_conn, &res_lib_cfg_testshutdown, -+ sizeof(res_lib_cfg_testshutdown)); -+ } - } - } - LEAVE(); -@@ -436,11 +438,6 @@ - shutdown_flags == CFG_SHUTDOWN_FLAG_REGARDLESS) { - TRACE1("shutdown confirmed"); - -- /* -- * Tell other nodes we are going down -- */ -- send_shutdown(); -- - res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown); - res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN; - res_lib_cfg_tryshutdown.header.error = CS_OK; -@@ -451,6 +448,12 @@ - api->ipc_response_send(shutdown_con->conn, &res_lib_cfg_tryshutdown, - sizeof(res_lib_cfg_tryshutdown)); - shutdown_con = NULL; -+ -+ /* -+ * Tell other nodes we are going down -+ */ -+ send_shutdown(); -+ - } - else { - -@@ -486,7 +489,7 @@ - shutdown_no = shutdown_expected; - check_shutdown_status(); - -- send_test_shutdown(NULL, CS_ERR_TIMEOUT); -+ send_test_shutdown(NULL, NULL, CS_ERR_TIMEOUT); - LEAVE(); - } - -@@ -695,7 +698,6 @@ - void *msg) - { - struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn); --// struct req_lib_cfg_statetrack *req_lib_cfg_statetrack = (struct req_lib_cfg_statetrack *)message; - struct res_lib_cfg_statetrack res_lib_cfg_statetrack; - - ENTER(); -@@ -713,7 +715,7 @@ - */ - ci->shutdown_reply = SHUTDOWN_REPLY_UNKNOWN; - shutdown_expected++; -- send_test_shutdown(conn, CS_OK); -+ send_test_shutdown(conn, NULL, CS_OK); - } - } - -@@ -898,15 +900,32 @@ - shutdown_expected = 0; - - for (iter = trackers_list.next; iter != &trackers_list; iter = iter->next) { -- struct cfg_info *ci = list_entry(iter, struct cfg_info, list); -- ci->shutdown_reply = SHUTDOWN_REPLY_UNKNOWN; -- shutdown_expected++; -+ struct cfg_info *testci = list_entry(iter, struct cfg_info, list); -+ /* -+ * It is assumed that we will allow shutdown -+ */ -+ if (testci != ci) { -+ testci->shutdown_reply = SHUTDOWN_REPLY_UNKNOWN; -+ shutdown_expected++; -+ } - } - - /* - * If no-one is listening for events then we can just go down now - */ - if (shutdown_expected == 0) { -+ struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown; -+ -+ res_lib_cfg_tryshutdown.header.size = sizeof(struct res_lib_cfg_tryshutdown); -+ res_lib_cfg_tryshutdown.header.id = MESSAGE_RES_CFG_TRYSHUTDOWN; -+ res_lib_cfg_tryshutdown.header.error = CS_OK; -+ -+ /* -+ * Tell originator that shutdown was confirmed -+ */ -+ api->ipc_response_send(conn, &res_lib_cfg_tryshutdown, -+ sizeof(res_lib_cfg_tryshutdown)); -+ - send_shutdown(); - LEAVE(); - return; -@@ -944,7 +963,7 @@ - /* - * Tell the users we would like to shut down - */ -- send_test_shutdown(NULL, CS_OK); -+ send_test_shutdown(NULL, conn, CS_OK); - } - - /* -@@ -961,11 +980,13 @@ - { - struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn); - struct req_lib_cfg_replytoshutdown *req_lib_cfg_replytoshutdown = (struct req_lib_cfg_replytoshutdown *)msg; -+ struct res_lib_cfg_replytoshutdown res_lib_cfg_replytoshutdown; -+ int status = CS_OK; - - ENTER(); - if (!shutdown_con) { -- LEAVE(); -- return; -+ status = CS_ERR_ACCESS; -+ goto exit_fn; - } - - if (req_lib_cfg_replytoshutdown->response) { -@@ -977,6 +998,15 @@ - ci->shutdown_reply = SHUTDOWN_REPLY_NO; - } - check_shutdown_status(); -+ -+exit_fn: -+ res_lib_cfg_replytoshutdown.header.error = status; -+ res_lib_cfg_replytoshutdown.header.id = MESSAGE_RES_CFG_REPLYTOSHUTDOWN; -+ res_lib_cfg_replytoshutdown.header.size = sizeof(res_lib_cfg_replytoshutdown); -+ -+ api->ipc_response_send(conn, &res_lib_cfg_replytoshutdown, -+ sizeof(res_lib_cfg_replytoshutdown)); -+ - LEAVE(); - } - -diff -Naurd corosync-0.94.orig/services/cpg.c corosync-trunk/services/cpg.c ---- corosync-0.94.orig/services/cpg.c 2009-03-03 01:57:44.000000000 +0100 -+++ corosync-trunk/services/cpg.c 2009-03-06 03:42:48.000000000 +0100 -@@ -489,8 +489,8 @@ - notify_info.nodeid = api->totem_nodeid_get(); - notify_info.reason = CONFCHG_CPG_REASON_PROCDOWN; - cpg_node_joinleave_send(gi, pi, MESSAGE_REQ_EXEC_CPG_PROCLEAVE, CONFCHG_CPG_REASON_PROCDOWN); -- list_del(&pi->list); - } -+ list_del(&pi->list); - api->ipc_refcnt_dec (conn); - return (0); - } -diff -Naurd corosync-0.94.orig/services/evs.c corosync-trunk/services/evs.c ---- corosync-0.94.orig/services/evs.c 2009-02-19 03:23:58.000000000 +0100 -+++ corosync-trunk/services/evs.c 2009-03-06 08:38:34.000000000 +0100 -@@ -363,7 +363,6 @@ - struct res_lib_evs_mcast_joined res_lib_evs_mcast_joined; - struct iovec req_exec_evs_mcast_iovec[3]; - struct req_exec_evs_mcast req_exec_evs_mcast; -- int send_ok = 0; - int res; - struct evs_pd *evs_pd = (struct evs_pd *)api->ipc_private_data_get (conn); - -@@ -382,8 +381,6 @@ - req_exec_evs_mcast_iovec[1].iov_len = evs_pd->group_entries * sizeof (struct evs_group); - req_exec_evs_mcast_iovec[2].iov_base = (char *)&req_lib_evs_mcast_joined->msg; - req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_joined->msg_len; --// TODO this doesn't seem to work for some reason -- send_ok = api->totem_send_ok (req_exec_evs_mcast_iovec, 3); - - res = api->totem_mcast (req_exec_evs_mcast_iovec, 3, TOTEM_AGREED); - // TODO -@@ -407,7 +404,6 @@ - struct iovec req_exec_evs_mcast_iovec[3]; - struct req_exec_evs_mcast req_exec_evs_mcast; - char *msg_addr; -- int send_ok = 0; - int res; - - req_exec_evs_mcast.header.size = sizeof (struct req_exec_evs_mcast) + -@@ -430,8 +426,6 @@ - req_exec_evs_mcast_iovec[2].iov_base = msg_addr; - req_exec_evs_mcast_iovec[2].iov_len = req_lib_evs_mcast_groups->msg_len; - --// TODO this is wacky -- send_ok = api->totem_send_ok (req_exec_evs_mcast_iovec, 3); - res = api->totem_mcast (req_exec_evs_mcast_iovec, 3, TOTEM_AGREED); - if (res == 0) { - error = CS_OK; -diff -Naurd corosync-0.94.orig/test/logsysbench.c corosync-trunk/test/logsysbench.c ---- corosync-0.94.orig/test/logsysbench.c 2008-10-30 23:25:56.000000000 +0100 -+++ corosync-trunk/test/logsysbench.c 2009-03-09 13:59:40.000000000 +0100 -@@ -42,7 +42,7 @@ - LOG_MODE_OUTPUT_STDERR | LOG_MODE_THREADED, - NULL, - LOG_DAEMON, -- "[%6s] %b", -+ NULL, - 100000); - - LOGSYS_DECLARE_NOSUBSYS(LOG_LEVEL_INFO); -diff -Naurd corosync-0.94.orig/test/logsysrec.c corosync-trunk/test/logsysrec.c ---- corosync-0.94.orig/test/logsysrec.c 2008-10-30 23:25:56.000000000 +0100 -+++ corosync-trunk/test/logsysrec.c 2009-03-09 13:59:40.000000000 +0100 -@@ -39,7 +39,7 @@ - LOG_MODE_OUTPUT_STDERR | LOG_MODE_THREADED, - NULL, - LOG_DAEMON, -- "[%6s] %b", -+ NULL, - 100000); - - LOGSYS_DECLARE_NOSUBSYS(LOG_LEVEL_INFO); -diff -Naurd corosync-0.94.orig/test/logsys_t2.c corosync-trunk/test/logsys_t2.c ---- corosync-0.94.orig/test/logsys_t2.c 2008-10-30 23:25:56.000000000 +0100 -+++ corosync-trunk/test/logsys_t2.c 2009-03-09 13:59:40.000000000 +0100 -@@ -39,7 +39,7 @@ - LOG_MODE_OUTPUT_STDERR | LOG_MODE_THREADED, - NULL, - LOG_DAEMON, -- "[%6s] %b" -+ NULL, - 100000); - - LOGSYS_DECLARE_NOSUBSYS(LOG_LEVEL_INFO); -diff -Naurd corosync-0.94.orig/tools/corosync-cfgtool.c corosync-trunk/tools/corosync-cfgtool.c ---- corosync-0.94.orig/tools/corosync-cfgtool.c 2009-02-13 10:21:57.000000000 +0100 -+++ corosync-trunk/tools/corosync-cfgtool.c 2009-03-06 11:07:35.000000000 +0100 -@@ -147,36 +147,13 @@ - (void)corosync_cfg_finalize (handle); - } - --void shutdown_callback (corosync_cfg_handle_t cfg_handle, corosync_cfg_shutdown_flags_t flags) --{ -- printf("shutdown callback called, flags = %d\n",flags); -- -- (void)corosync_cfg_replyto_shutdown (cfg_handle, COROSYNC_CFG_SHUTDOWN_FLAG_YES); --} -- --void *shutdown_dispatch_thread(void *arg) --{ -- int res = CS_OK; -- corosync_cfg_handle_t *handle = arg; -- -- while (res == CS_OK) { -- res = corosync_cfg_dispatch(*handle, CS_DISPATCH_ALL); -- if (res != CS_OK) -- printf ("Could not dispatch cfg messages: %d\n", res); -- } -- return NULL; --} -- - void shutdown_do() - { - cs_error_t result; - corosync_cfg_handle_t handle; - corosync_cfg_callbacks_t callbacks; -- corosync_cfg_state_notification_t notification_buffer; -- pthread_t dispatch_thread; - -- printf ("Shutting down corosync\n"); -- callbacks.corosync_cfg_shutdown_callback = shutdown_callback; -+ callbacks.corosync_cfg_shutdown_callback = NULL; - - result = corosync_cfg_initialize (&handle, &callbacks); - if (result != CS_OK) { -@@ -184,16 +161,7 @@ - exit (1); - } - -- pthread_create(&dispatch_thread, NULL, shutdown_dispatch_thread, &handle); -- -- result = corosync_cfg_state_track (handle, -- 0, -- ¬ification_buffer); -- if (result != CS_OK) { -- printf ("Could not start corosync cfg tracking error %d\n", result); -- exit (1); -- } -- -+ printf ("Shutting down corosync\n"); - result = corosync_cfg_try_shutdown (handle, COROSYNC_CFG_SHUTDOWN_FLAG_REQUEST); - if (result != CS_OK) { - printf ("Could not shutdown (error = %d)\n", result); -@@ -262,7 +230,7 @@ - - void usage_do (void) - { -- printf ("corosync-cfgtool [-s] [-r] [-l] [-u] [service_name] [-v] [version] [-k] [nodeid] [-a] [nodeid]\n\n"); -+ printf ("corosync-cfgtool [-s] [-r] [-l] [-u] [-H] [service_name] [-v] [version] [-k] [nodeid] [-a] [nodeid]\n\n"); - printf ("A tool for displaying and configuring active parameters within corosync.\n"); - printf ("options:\n"); - printf ("\t-s\tDisplays the status of the current rings on this node.\n"); -@@ -272,11 +240,11 @@ - printf ("\t-u\tUnload a service identified by name.\n"); - printf ("\t-a\tDisplay the IP address(es) of a node\n"); - printf ("\t-k\tKill a node identified by node id.\n"); -- printf ("\t-h\tShutdown corosync cleanly on this node.\n"); -+ printf ("\t-H\tShutdown corosync cleanly on this node.\n"); - } - - int main (int argc, char *argv[]) { -- const char *options = "srl:u:v:k:a:h"; -+ const char *options = "srl:u:v:k:a:hH"; - int opt; - int service_load = 0; - unsigned int nodeid; -@@ -307,7 +275,7 @@ - nodeid = atoi (optarg); - killnode_do(nodeid); - break; -- case 'h': -+ case 'H': - shutdown_do(); - break; - case 'a': -@@ -316,6 +284,9 @@ - case 'v': - version = atoi (optarg); - break; -+ case 'h': -+ usage_do(); -+ break; - } - } - diff --git a/corosync.spec b/corosync.spec index 0b66fde..9adcd38 100644 --- a/corosync.spec +++ b/corosync.spec @@ -1,16 +1,13 @@ -%define alphatag svn1797 +## define alphatag svn1797 Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 0.94 -Release: 5%{?alphatag:.%{alphatag}}%{?dist} +Version: 0.95 +Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base URL: http://www.openais.org Source0: http://developer.osdl.org/dev/openais/downloads/corosync-%{version}/corosync-%{version}.tar.gz -Patch0: corosync-bump-soname.diff -Patch1: corosync-trunk.diff -Patch2: corosync-1807.diff # Runtime bits Requires: corosynclib = %{version}-%{release} @@ -22,33 +19,48 @@ Conflicts: openais <= 0.89, openais-devel <= 0.89 # Setup/build bits %define ais_user_uid 39 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +%define buildtrunk 0 +%{?_with_buildtrunk: %define buildtrunk 1} + +%if %{buildtrunk} +BuildRequires: autoconf automake +%endif + +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep %setup -q -n corosync-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 + +%if %{buildtrunk} +if [ ! -f configure ]; then + ./autogen.sh +fi +%endif + +%{_configure} CFLAGS="$(echo '%{optflags}')" \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libdir=%{_libdir} %build - -# -O3 required for performance reasons -# So we get proper debug output, for now we don't compile with O3 -#CFLAGS="$(echo '%{optflags}' | sed -e 's/-O[0-9]*//') -O3" -CFLAGS="$(echo '%{optflags}')" -make CFLAGS="$CFLAGS" +make %{_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT STATICLIBS=NO -mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} -mkdir -p $RPM_BUILD_ROOT%{_initddir} -install -m 644 LICENSE SECURITY README.devmap \ - $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ -install -m 755 init/redhat $RPM_BUILD_ROOT%{_initddir}/corosync +rm -rf %{buildroot} + +make install DESTDIR=%{buildroot} +install -d %{buildroot}%{_initddir} +install -m 755 init/redhat %{buildroot}%{_initddir}/corosync + +## tree fixup +# drop static libs +rm -f %{buildroot}%{_libdir}/*.a +# drop docs and html docs for now +rm -rf %{buildroot}%{_docdir}/* %clean -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %description This package contains the Corosync Cluster Engine Executive, several default @@ -73,9 +85,7 @@ fi %files %defattr(-,root,root,-) -%dir %{_docdir}/%{name}-%{version} -%doc %{_docdir}/%{name}-%{version}/LICENSE -%doc %{_docdir}/%{name}-%{version}/SECURITY +%doc LICENSE SECURITY %{_sbindir}/corosync %{_sbindir}/corosync-keygen %{_sbindir}/corosync-objctl @@ -92,10 +102,11 @@ fi %{_libexecdir}/lcrso/service_evs.lcrso %{_libexecdir}/lcrso/service_confdb.lcrso %{_libexecdir}/lcrso/service_pload.lcrso -%{_libexecdir}/lcrso/service_votequorum.lcrso -%{_libexecdir}/lcrso/testquorum.lcrso +%{_libexecdir}/lcrso/quorum_votequorum.lcrso +%{_libexecdir}/lcrso/quorum_testquorum.lcrso %{_libexecdir}/lcrso/vsf_quorum.lcrso %{_libexecdir}/lcrso/vsf_ykd.lcrso +%{_libexecdir}/lcrso/quorum.lcrso %{_mandir}/man8/corosync_overview.8* %{_mandir}/man8/corosync-objctl.8* %{_mandir}/man5/corosync.conf.5* @@ -110,17 +121,18 @@ This package contains corosync libraries. %files -n corosynclib %defattr(-,root,root,-) -%dir %{_libdir}/corosync -%config(noreplace) /etc/ld.so.conf.d/corosync-*.conf -%{_libdir}/corosync/libcfg.so.* -%{_libdir}/corosync/libcpg.so.* -%{_libdir}/corosync/libconfdb.so.* -%{_libdir}/corosync/libevs.so.* -%{_libdir}/corosync/libtotem_pg.so.* -%{_libdir}/corosync/liblogsys.so.* -%{_libdir}/corosync/libcoroipc.so.* -%{_libdir}/corosync/libquorum.so.* -%{_libdir}/corosync/libvotequorum.so.* +%doc LICENSE +%{_libdir}/libcfg.so.* +%{_libdir}/libcpg.so.* +%{_libdir}/libconfdb.so.* +%{_libdir}/libevs.so.* +%{_libdir}/libtotem_pg.so.* +%{_libdir}/liblogsys.so.* +%{_libdir}/libcoroipcc.so.* +%{_libdir}/libcoroipcs.so.* +%{_libdir}/libquorum.so.* +%{_libdir}/libvotequorum.so.* +%{_libdir}/libpload.so.* %post -n corosynclib -p /sbin/ldconfig @@ -140,10 +152,10 @@ The Corosync Cluster Engine APIs. %files -n corosynclib-devel %defattr(-,root,root,-) -%dir %{_docdir}/%{name}-%{version} -%doc %{_docdir}/%{name}-%{version}/README.devmap +%doc LICENSE README.devmap %dir %{_includedir}/corosync/ -%{_includedir}/corosync/coroipc.h +%{_includedir}/corosync/cs_config.h +%{_includedir}/corosync/coroipcc.h %{_includedir}/corosync/cfg.h %{_includedir}/corosync/confdb.h %{_includedir}/corosync/corotypes.h @@ -171,15 +183,17 @@ The Corosync Cluster Engine APIs. %{_includedir}/corosync/engine/logsys.h %{_includedir}/corosync/engine/objdb.h %{_includedir}/corosync/engine/quorum.h -%{_libdir}/corosync/libcfg.so -%{_libdir}/corosync/libcpg.so -%{_libdir}/corosync/libconfdb.so -%{_libdir}/corosync/libevs.so -%{_libdir}/corosync/libtotem_pg.so -%{_libdir}/corosync/liblogsys.so -%{_libdir}/corosync/libcoroipc.so -%{_libdir}/corosync/libquorum.so -%{_libdir}/corosync/libvotequorum.so +%{_libdir}/libcfg.so +%{_libdir}/libcpg.so +%{_libdir}/libconfdb.so +%{_libdir}/libevs.so +%{_libdir}/libtotem_pg.so +%{_libdir}/liblogsys.so +%{_libdir}/libcoroipcc.so +%{_libdir}/libcoroipcs.so +%{_libdir}/libquorum.so +%{_libdir}/libvotequorum.so +%{_libdir}/libpload.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/cpg_*3* %{_mandir}/man3/evs_*3* @@ -190,8 +204,25 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/confdb_overview.8* %{_mandir}/man8/logsys_overview.8* %{_mandir}/man8/votequorum_overview.8* +%{_mandir}/man8/coroipc_overview.8* %changelog +* Tue Mar 24 2009 Fabio M. Di Nitto - 0.95-1 +- New upstream release +- spec file updates: + * Drop alpha tag + * Drop local patches (no longer required) + * Allow to build from svn trunk by supporting rpmbuild --with buildtrunk + * BuildRequires autoconf automake if building from trunk + * Execute autogen.sh if building from trunk and if no configure is available + * Switch to use rpm configure macro and set standard install paths + * Build invokation now supports _smp_mflags + * Remove install section for docs and use proper doc macro instead + * Add tree fixup bits to drop static libs and html docs (only for now) + * Add LICENSE file to all subpackages + * libraries have moved to libdir. Drop ld.so.conf.d corosync file + * Update BuildRoot usage to preferred versions/names + * Tue Mar 10 2009 Fabio M. Di Nitto - 0.94-5.svn1797 - Update the corosync-trunk patch for real this time. diff --git a/sources b/sources index e921251..d4304e3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5839592fbb6982c6c897aa5020f0b629 corosync-0.94.tar.gz +24b268b66d95b09f7177c73bb226de74 corosync-0.95.tar.gz