Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyu li committed Apr 28, 2015
1 parent 3739391 commit 4b45d1e
Show file tree
Hide file tree
Showing 25 changed files with 250 additions and 71 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ IF (RPMBUILD_FOUND)
SET (CPACK_RPM_PACKAGE_GROUP ${PROJECT_VENDOR})
SET (CPACK_RPM_PACKAGE_VENDOR ${PROJECT_VENDOR})
SET (CPACK_RPM_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
SET (CPACK_RPM_PACKAGE_DEPENDS "czmq >= 1.4.1, libpcap >= 1.4.0, libini_config, zlib, jansson, libuuid")
SET (CPACK_RPM_PACKAGE_DEPENDS
"czmq >= 2.2.0, zeromq4 >= 4.0.4, libpcap >= 1.4.0, libini_config, zlib, jansson, libuuid")
SET (CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_DEPENDS}")
SET (CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/scripts/pre_install.sh")
SET (CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/scripts/post_install.sh")
Expand Down
2 changes: 1 addition & 1 deletion cmake/Findczmq.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MESSAGE (STATUS "Using bundled find czmq")
FIND_PATH (
LIBCZMQ_INCLUDE_DIR
NAMES czmq.h
PATHS /usr/include /usr/local/include/)
PATHS /usr/include/czmq /usr/local/include/czmq)

FIND_LIBRARY (
LIBCZMQ_LIBRARY
Expand Down
Binary file removed libs/epel-release-6-8.noarch.rpm
Binary file not shown.
90 changes: 90 additions & 0 deletions libs/spec/czmq.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Summary: High-level C binding for 0MQ
Name: czmq
Version: 2.2.0
Release: 3
License: LGPL v3+
Group: Libraries
Source0: http://download.zeromq.org/%{name}-%{version}.tar.gz
URL: http://zeromq.org/
BuildRequires: asciidoc
BuildRequires: libsodium-devel
BuildRequires: xmlto
BuildRequires: zeromq4-devel
BuildRequires: libuuid-devel
Requires: zeromq4
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
High-level C binding for 0MQ.

%package devel
Summary: Header files for CZMQ library
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: zeromq4-devel

%description devel
Header files for CZMQ library.

%prep
%setup -q

%build
# use include subdir - file names could be too common (zfile.h etc.)
%configure \
--includedir=%{_includedir}/czmq \
--disable-static
%{__make}

%install
rm -rf $RPM_BUILD_ROOT

%{__make} install \
DESTDIR=$RPM_BUILD_ROOT

# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libczmq.la

# too common name
%{__mv} $RPM_BUILD_ROOT%{_bindir}/{makecert,czmq_makecert}

# this looks like a Makefile.am problem -jg
%{__rm} -f $RPM_BUILD_ROOT%{_bindir}/*.gsl

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig


%postun -p /sbin/ldconfig


%files
%defattr(644,root,root,755)
%doc AUTHORS NEWS
%attr(755,root,root) %{_bindir}/czmq_makecert
%attr(755,root,root) %{_bindir}/czmq_selftest
%attr(755,root,root) %{_libdir}/libczmq.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libczmq.so.1

%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libczmq.so
%{_includedir}/czmq
%{_libdir}/pkgconfig/libczmq.pc
%{_mandir}/man3/*.3*
%{_mandir}/man7/*.7*

%changelog
* Thu May 08 2014 Jim Garlick <[email protected]> - 2.2.0-3
- buildrequire libuuid-devel
- disable static subpackage
- drop Polish (pl) descriptions that I can't keep up to date

* Wed May 07 2014 Jim Garlick <[email protected]> - 2.2.0-2
- add ldconfig post/postun

* Wed May 07 2014 Jim Garlick <[email protected]> - 2.2.0-1
- drop unpackaged *.gsl files from bindir
- initial build for TOSS
113 changes: 113 additions & 0 deletions libs/spec/zeromq4.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Name: zeromq4
Version: 4.0.4
Release: 1%{?dist}
Summary: Software library for fast, message-based applications

Group: System Environment/Libraries
License: LGPLv3+ with exceptions
URL: http://www.zeromq.org/
Source0: http://download.zeromq.org/zeromq-%{version}.tar.gz
BuildRequires: glib2-devel
BuildRequires: libuuid-devel
BuildRequires: libsodium-devel
BuildRequires: openpgm-devel
BuildRequires: chrpath
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
The 0MQ lightweight messaging kernel is a library which extends the
standard socket interfaces with features traditionally provided by
specialized messaging middle-ware products. 0MQ sockets provide an
abstraction of asynchronous message queues, multiple messaging
patterns, message filtering (subscriptions), seamless access to
multiple transport protocols and more.

This package contains the ZeroMQ shared library for versions 4.x.


%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Conflicts: zeromq-devel%{?_isa}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name} 4.x.


%prep
%setup -qn zeromq-%{version}
chmod -x src/tcp.cpp
chmod -x src/dist.cpp

# fix ChangeLog enconding
/usr/bin/iconv -f iso8859-1 -t utf-8 ChangeLog > _ChangeLog && \
%{__mv} -f _ChangeLog ChangeLog

# remove all files in foreign except Makefiles
rm -v $(find foreign -type f | grep -v Makefile)

# Don't turn warnings into errors
sed -i "s/libzmq_werror=\"yes\"/libzmq_werror=\"no\"/g" \
configure


%build
%configure \
%if %{with pgm}
--with-system-pgm \
%endif
--disable-static \
--disable-silent-rules
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot} INSTALL="install -p"
chrpath --delete $RPM_BUILD_ROOT%{_bindir}/curve_keygen

# remove *.la
rm %{buildroot}%{_libdir}/libzmq.la


%check
make check


%post -p /sbin/ldconfig


%postun -p /sbin/ldconfig


%files
%doc AUTHORS ChangeLog COPYING COPYING.LESSER NEWS
%{_bindir}/curve_keygen
%{_libdir}/libzmq.so.*

%files devel
%{_libdir}/libzmq.so
%{_libdir}/pkgconfig/libzmq.pc
%{_includedir}/zmq*
%{_mandir}/man3/zmq*.3*
%{_mandir}/man7/zmq*.7*


%changelog
* Thu Apr 17 2014 Thomas Spura <[email protected]> - 4.0.4-1
- update to 4.0.4

* Tue Feb 25 2014 Thomas Spura <[email protected]> - 4.0.3-2
- fix spurious-executable-perm
- also provide/obsolete zeromq3-devel

* Tue Feb 4 2014 Thomas Spura <[email protected]> - 4.0.3-1
- disable silent rules in configure
- delete rpath with chrpath
- provide zeromq3 with the version from zeromq4

* Thu Dec 12 2013 Jose Pedro Oliveira <jpo at di.uminho.pt> - 4.0.3-0.1
- initial zeromq v4 package (based on zeromq3's specfile)

# vim:set ai ts=4 sw=4 sts=4 et:
2 changes: 1 addition & 1 deletion src/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <czmq.h>
#include <czmq/czmq.h>
#include <locale.h>
#include "config.h"
#include "util.h"
Expand Down
10 changes: 5 additions & 5 deletions src/analyzer/http/http_analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "log.h"
#include "http_analyzer.h"

#define HTTP_PROTO_NAME "HTTP"

/* Current timestamp */
static __thread timeValPtr currTime;
/* Current session state indicator */
Expand Down Expand Up @@ -1057,6 +1055,8 @@ httpSessionProcessFin (streamDirection direction, timeValPtr tm, void *sd,
}
}

protoAnalyzer httpAnalyzer;

static char *
httpSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
u_char *data, u_int dataLen) {
Expand Down Expand Up @@ -1132,22 +1132,22 @@ httpSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
data [i + 1] == '\n' &&
(memcmp ("HTTP/1.0", data + i - 8, 8) == 0 ||
memcmp ("HTTP/1.1", data + i - 8, 8) == 0)) {
return HTTP_PROTO_NAME;
return httpAnalyzer.proto;
}
}
}
} else {
if (dataLen >= 8 &&
(memcmp ("HTTP/1.0", data, 8) == 0 ||
memcmp ("HTTP/1.1", data, 8) == 0))
return HTTP_PROTO_NAME;
return httpAnalyzer.proto;
}

return NULL;
}

protoAnalyzer httpAnalyzer = {
.proto = HTTP_PROTO_NAME,
.proto = "HTTP",
.initProtoAnalyzer = initHttpAnalyzer,
.destroyProtoAnalyzer = destroyHttpAnalyzer,
.newSessionDetail = newHttpSessionDetail,
Expand Down
10 changes: 5 additions & 5 deletions src/analyzer/mysql/mysql_analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include "log.h"
#include "mysql_analyzer.h"

#define MYSQL_PROTO_NAME "MYSQL"

/* Mysql indention for info display */
#define MYSQL_INFO_DISPLAY_INDENT1 " "
#define MYSQL_INFO_DISPLAY_INDENT2 " "
Expand Down Expand Up @@ -2895,6 +2893,8 @@ mysqlSessionProcessFin (streamDirection direction, timeValPtr tm, void *sd,
return;
}

protoAnalyzer mysqlAnalyzer;

static char *
mysqlSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
u_char *data, u_int dataLen) {
Expand All @@ -2916,7 +2916,7 @@ mysqlSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
if (data [i] != 0x00)
return NULL;
}
return MYSQL_PROTO_NAME;
return mysqlAnalyzer.proto;
} else if (direction == STREAM_FROM_SERVER &&
seqId == 0 &&
data [5] > 0x30 && /* Server version > 0 */
Expand All @@ -2925,7 +2925,7 @@ mysqlSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
/* Check initial server handshake */
for (i = 7; i + 13 <= dataLen; i++) {
if (data [i] == 0x00 && data [i + 13] == 0x00)
return MYSQL_PROTO_NAME;
return mysqlAnalyzer.proto;
}
}
}
Expand All @@ -2935,7 +2935,7 @@ mysqlSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
}

protoAnalyzer mysqlAnalyzer = {
.proto = MYSQL_PROTO_NAME,
.proto = "MYSQL",
.initProtoAnalyzer = initMysqlAnalyzer,
.destroyProtoAnalyzer = destroyMysqlAnalyzer,
.newSessionDetail = newMysqlSessionDetail,
Expand Down
8 changes: 4 additions & 4 deletions src/analyzer/template_analyzer/template_analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <ntrace/proto_analyzer.h>
#include "template_analyzer.h"

#define TEMPLATE_PROTO_NAME "TEMPLATE"

static int
initTemplateAnalyzer (void) {
LOGI ("Init template analyzer success.\n");
Expand Down Expand Up @@ -128,17 +126,19 @@ templateSessionProcessFin (streamDirection direction, timeValPtr tm, void *sd,
}
}

protoAnalyzer analyzer;

static char *
templateSessionProcessProtoDetect (streamDirection direction, timeValPtr tm,
u_char *data, u_int dataLen) {
if (dataLen > 65536)
return TEMPLATE_PROTO_NAME;
return analyzer.proto;
else
return NULL;
}

protoAnalyzer analyzer = {
.proto = TEMPLATE_PROTO_NAME,
.proto = "TEMPLATE",
.initProtoAnalyzer = initTemplateAnalyzer,
.destroyProtoAnalyzer = destroyTemplateAnalyzer,
.newSessionDetail = newTemplateSessionDetail,
Expand Down
2 changes: 1 addition & 1 deletion src/logger/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <czmq.h>
#include <czmq/czmq.h>
#include "util.h"
#include "zmq_hub.h"
#include "log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/logger/log_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <czmq.h>
#include <czmq/czmq.h>
#include <locale.h>
#include "util.h"
#include "list.h"
Expand Down
2 changes: 1 addition & 1 deletion src/logger/logview.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <czmq.h>
#include <czmq/czmq.h>
#include <string.h>
#include "util.h"
#include "log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/management/management_service.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __MANAGEMENT_SERVICE_H__
#define __MANAGEMENT_SERVICE_H__

#include <czmq.h>
#include <czmq/czmq.h>

/*=========================================================================*/

Expand Down
2 changes: 1 addition & 1 deletion src/ownership/ownership.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <czmq.h>
#include <czmq/czmq.h>
#include <jansson.h>
#include "list.h"
#include "log.h"
Expand Down
Loading

0 comments on commit 4b45d1e

Please sign in to comment.