From e273fef7a7ab30943d9fd7d3edbd41e764282e1e Mon Sep 17 00:00:00 2001 From: Thomas Heil Date: Mon, 23 Jun 2014 15:15:52 +0200 Subject: [PATCH] memcached: import from packages, add myself as the maintainer This adds the memcached package from the old svn package fee. I adopt the licensing information an will maintain the package in the future. This request also updates memcached to the last stable version 1.4.20. Building was testet with target x86_64, ar71xx and avr32 Signed-off-by: Thomas Heil --- net/memcached/Makefile | 68 +++++++++++++++++++++ net/memcached/files/memcached.config | 6 ++ net/memcached/files/memcached.init | 27 ++++++++ net/memcached/patches/100-fix_iov_max.patch | 23 +++++++ 4 files changed, 124 insertions(+) create mode 100644 net/memcached/Makefile create mode 100644 net/memcached/files/memcached.config create mode 100644 net/memcached/files/memcached.init create mode 100644 net/memcached/patches/100-fix_iov_max.patch diff --git a/net/memcached/Makefile b/net/memcached/Makefile new file mode 100644 index 0000000000..ce81c6eddb --- /dev/null +++ b/net/memcached/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# Copyright (C) 2009-2014 Thomas Heil +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=memcached +PKG_VERSION:=1.4.20 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://memcached.org/files +PKG_MD5SUM:=92f702bcb28d7bec8fdf9418360fc062 +PKG_INSTALL:=1 +PKG_MAINTAINER:=Thomas Heil +PKG_LICENSE:=permissive free software license + +include $(INCLUDE_DIR)/package.mk + +define Package/memcached + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libevent +libpthread + TITLE:=The high-performance, distributed memory object caching system + URL:=http://memcached.org/ +endef + +define Package/memcached/description + Free and open source, high-performance, distributed memory object caching system +endef + +define Package/memcached/conffiles +/etc/config/memcached +endef + +ifeq ($(CONFIG_BIG_ENDIAN),y) +CONFIGURE_VARS += ac_cv_c_endian=big +else +CONFIGURE_VARS += ac_cv_c_endian=little +endif + +CONFIGURE_ARGS += \ + --with-libevent=$(STAGING_DIR)/usr/include/libevent \ + --disable-docs \ + --disable-dtrace \ + --disable-coverage \ + --disable-sasl + +TARGET_CFLAGS += \ + -std=gnu99 + +TARGET_LDFLAGS = \ + -L$(STAGING_DIR)/usr/lib/libevent -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib + +define Package/memcached/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/memcached $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/memcached.config $(1)/etc/config/memcached + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/memcached.init $(1)/etc/init.d/memcached +endef + +$(eval $(call BuildPackage,memcached)) diff --git a/net/memcached/files/memcached.config b/net/memcached/files/memcached.config new file mode 100644 index 0000000000..4071116b73 --- /dev/null +++ b/net/memcached/files/memcached.config @@ -0,0 +1,6 @@ +config memcached + option user 'nobody' + option maxconn '1024' + option listen '0.0.0.0' + option port '11211' + option memory '64' diff --git a/net/memcached/files/memcached.init b/net/memcached/files/memcached.init new file mode 100644 index 0000000000..063bf64725 --- /dev/null +++ b/net/memcached/files/memcached.init @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=80 + +start_instance () { + local section="$1" + + config_get user "$section" user + config_get maxconn "$section" maxconn + config_get listen "$section" listen + config_get port "$section" port + config_get memory "$section" memory + + service_start /usr/bin/memcached -d -u ${user:-nobody} \ + -c ${maxconn:-1024} -l ${listen:-0.0.0.0} \ + -p ${port:-11211} -U ${port:-11211} -m ${memory:-64} +} + +start() { + config_load 'memcached' + config_foreach start_instance 'memcached' +} + +stop() { + service_stop /usr/bin/memcached +} diff --git a/net/memcached/patches/100-fix_iov_max.patch b/net/memcached/patches/100-fix_iov_max.patch new file mode 100644 index 0000000000..1a5da94b05 --- /dev/null +++ b/net/memcached/patches/100-fix_iov_max.patch @@ -0,0 +1,23 @@ +--- a/memcached.c ++++ b/memcached.c +@@ -13,6 +13,10 @@ + * Anatoly Vorobey + * Brad Fitzpatrick + */ ++#ifndef __need_IOV_MAX ++#define __need_IOV_MAX ++#endif ++ + #include "memcached.h" + #include + #include +@@ -29,9 +33,6 @@ + #define _P1003_1B_VISIBLE + #endif + /* need this to get IOV_MAX on some platforms. */ +-#ifndef __need_IOV_MAX +-#define __need_IOV_MAX +-#endif + #include + #include + #include -- 2.30.2