From 96b257a7052326d05a0c42901eb9592a50fc13aa Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Sun, 1 Nov 2015 13:18:15 +0100 Subject: [PATCH] fossil: add package Signed-off-by: Luka Perkov --- net/fossil/Makefile | 70 +++++++++++++++++++++++++++++++ net/fossil/files/fossil.config | 5 +++ net/fossil/files/fossil.init | 54 ++++++++++++++++++++++++ net/fossil/patches/no_https.patch | 22 ++++++++++ 4 files changed, 151 insertions(+) create mode 100644 net/fossil/Makefile create mode 100644 net/fossil/files/fossil.config create mode 100644 net/fossil/files/fossil.init create mode 100644 net/fossil/patches/no_https.patch diff --git a/net/fossil/Makefile b/net/fossil/Makefile new file mode 100644 index 000000000..656c83ccb --- /dev/null +++ b/net/fossil/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=fossil +PKG_VERSION:=1.33 +PKG_RELEASE:=1 + +PKG_LICENSE:=BSD-2-Clause +PKG_MAINTAINER:=Luka Perkov + +PKG_SOURCE:=$(PKG_NAME)-src-${PKG_VERSION}.tar.gz +PKG_SOURCE_URL:=http://www.fossil-scm.org/download/ +PKG_MD5SUM:=53f8145084a2065d6cb734980c172c7e + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-src-$(PKG_VERSION) + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/fossil + SECTION:=net + CATEGORY:=Network + SUBMENU:=Version Control Systems + TITLE:=Simple distributed software configuration management + URL:=http://www.fossil-scm.org + DEPENDS:=+zlib +endef + +define Package/fossil/description + Fossil is a distributed version control system, bug tracking system + and wiki software server for use in software development. +endef + +MAKE_FLAGS := \ + TCC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -DFOSSIL_ENABLE_JSON" \ + LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath=$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \ + +undefine Build/Configure + +define Build/Compile + $(call Build/Compile/Default, \ + -f Makefile.classic $(MAKE_FLAGS) all \ + ) +endef + +undefine Build/Install + +define Package/fossil/conffiles +/etc/config/fossil +endef + +define Package/fossil/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/fossil.init $(1)/etc/init.d/fossil + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/fossil.config $(1)/etc/config/fossil +endef + +$(eval $(call BuildPackage,fossil)) diff --git a/net/fossil/files/fossil.config b/net/fossil/files/fossil.config new file mode 100644 index 000000000..f35876c68 --- /dev/null +++ b/net/fossil/files/fossil.config @@ -0,0 +1,5 @@ +config server 'dummy' + option repository '/tmp/fossil/dummy' + option port 8008 + option localhost 0 + option create 1 diff --git a/net/fossil/files/fossil.init b/net/fossil/files/fossil.init new file mode 100644 index 000000000..f5a17b985 --- /dev/null +++ b/net/fossil/files/fossil.init @@ -0,0 +1,54 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2015 OpenWrt.org + +START=90 +USE_PROCD=1 + +start_instance() { + local cfg="$1" + + config_get repository "$cfg" repository + if [ -z "$repository" ]; then + echo "repository is not defined in $1, skipping" + return + fi + + config_get_bool create "$cfg" create 0 + + if [ "$create" -eq 0 -a ! -f "$repository" ]; then + echo "in $1 create option is '$create' and repository '$repository' is not a regular file, skipping" + return + fi + + if [ "$create" -eq 1 -a ! -d `dirname $repository` ]; then + mkdir -p `dirname $repository` + if [ "$?" -ne 0 ]; then + echo "could not create directory, skipping" + return + fi + fi + + config_get port "$cfg" port "" + if [ -z "$port" ]; then + echo "port is not defined in $1, skipping" + return + fi + + config_get_bool debug "$cfg" debug 0 + config_get_bool localhost "$cfg" localhost 1 + config_get_bool scgi "$cfg" scgi 0 + + procd_open_instance + procd_set_param command /usr/bin/fossil server "$repository" --port $port + [ "$debug" -eq 1 ] && procd_append_param command --th-trace + [ "$create" -eq 1 ] && procd_append_param command --user root --create + [ "$localhost" -eq 1 ] && procd_append_param command --localhost + [ "$scgi" -eq 1 ] && procd_append_param command --scgi + procd_set_param respawn + procd_close_instance +} + +start_service() { + config_load 'fossil' + config_foreach start_instance 'server' +} diff --git a/net/fossil/patches/no_https.patch b/net/fossil/patches/no_https.patch new file mode 100644 index 000000000..411504f78 --- /dev/null +++ b/net/fossil/patches/no_https.patch @@ -0,0 +1,22 @@ +--- a/Makefile.classic ++++ b/Makefile.classic +@@ -41,9 +41,6 @@ TCC = gcc -g -Os -Wall + # FOSSIL_ENABLE_MINIZ = 1 + # TCC += -DFOSSIL_ENABLE_MINIZ + +-# To add support for HTTPS +-TCC += -DFOSSIL_ENABLE_SSL +- + #### Extra arguments for linking the finished binary. Fossil needs + # to link against the Z-Lib compression library unless the miniz + # library in the source tree is being used. There are no other +@@ -58,9 +55,6 @@ ZLIB_LIB. = $(ZLIB_LIB.0) + # If using zlib: + LIB = $(ZLIB_LIB.$(FOSSIL_ENABLE_MINIZ)) $(LDFLAGS) + +-# If using HTTPS: +-LIB += -lcrypto -lssl +- + #### Tcl shell for use in running the fossil testsuite. If you do not + # care about testing the end result, this can be blank. + #