beanstalkd: add package

For now building from git using latest SHA (commits are relatively
infrequent).  Set priority to come up immediately after network
interfaces are brought up. Patches have been submitted upstream
(but not yet accepted) to fix:

* a somewhat cross-compile unfriendly makefile;
* a header inclusion issue which causes MUSL compilation warnings;
* using the somewhat arcane posix_fallocate() in favor of the
  more ubiquitous ftruncate() system call instead.

Hopefully the next release will include our submitted fixes and
we can transition to a numbered release.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
Philip Prindeville
2017-02-20 12:34:16 -07:00
parent ac5ddd96e5
commit 8043fdf755
5 changed files with 207 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=beanstalkd
PKG_VERSION:=1.9
PKG_RELEASE:=1
# for now, build from latest commit since releases are infrequent and
# useful fixes trickle in...
PKG_SOURCE_URL:=https://github.com/kr/beanstalkd.git
PKG_SOURCE_VERSION:=b7b4a6a14b7e8d096dc8cbc255b23be17a228cbb
PKG_SOURCE_PROTO:=git
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-v$(PKG_VERSION)
PKG_MAINTAINER:=Philip Prindeville <philipp@redfish-solutions.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/beanstalkd
SECTION:=net
CATEGORY:=Network
TITLE:=Beanstalk
endef
define Package/beanstalkd/description
Beanstalk is a simple, fast work queue.
endef
define Build/Configure
endef
define Build/Compile
cd $(PKG_BUILD_DIR) && make CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" PREFIX=/usr
endef
define Package/beanstalkd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/beanstalkd $(1)/usr/bin/beanstalkd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/beanstalkd.init $(1)/etc/init.d/beanstalkd
endef
$(eval $(call BuildPackage,beanstalkd))