added my Recipes
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
From f3889e5870e9761ee6113fac7f38aa44cc43e46c Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 7 Sep 2022 00:30:52 -0700
|
||||
Subject: [PATCH] Define _GNU_SOURCE if HAVE_SIGSET is set
|
||||
|
||||
This enforces using sigset() API which needs _GNU_SOURCE macro to be
|
||||
defined
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/blueness/sthttpd/pull/16]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/libhttpd.c | 5 ++++-
|
||||
src/thttpd.c | 4 ++++
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libhttpd.c b/src/libhttpd.c
|
||||
index fa42c10..669be11 100644
|
||||
--- a/src/libhttpd.c
|
||||
+++ b/src/libhttpd.c
|
||||
@@ -25,9 +25,12 @@
|
||||
** SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
-
|
||||
#include <config.h>
|
||||
|
||||
+#ifdef HAVE_SIGSET
|
||||
+#define _GNU_SOURCE
|
||||
+#endif
|
||||
+
|
||||
//system headers
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
diff --git a/src/thttpd.c b/src/thttpd.c
|
||||
index ad97188..3c7a449 100644
|
||||
--- a/src/thttpd.c
|
||||
+++ b/src/thttpd.c
|
||||
@@ -28,6 +28,10 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
+#ifdef HAVE_SIGSET
|
||||
+#define _GNU_SOURCE
|
||||
+#endif
|
||||
+
|
||||
//system headers
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: thttpd
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Small http server
|
||||
# Description: thttpd is a simple, small, portable, fast, and secure HTTP server.
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
thttpd=/usr/sbin/thttpd
|
||||
test -x "$thttpd" || exit 0
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting thttpd"
|
||||
start-stop-daemon --start --quiet --exec $thttpd -- -C @@CONFFILE
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping thttpd"
|
||||
start-stop-daemon --stop --quiet --exec $thttpd
|
||||
echo "."
|
||||
;;
|
||||
reload|force-reload)
|
||||
start-stop-daemon --stop --quiet --signal 1 --exec $thttpd
|
||||
;;
|
||||
restart)
|
||||
echo -n "Stopping thttpd"
|
||||
start-stop-daemon --stop --quiet --exec $thttpd -- -C @@CONFFILE
|
||||
echo "."
|
||||
echo -n "Waiting for thttpd to die off"
|
||||
for i in 1 2 3 ;
|
||||
do
|
||||
sleep 1
|
||||
echo -n "."
|
||||
done
|
||||
echo ""
|
||||
echo -n "Starting thttpd"
|
||||
start-stop-daemon --start --quiet --exec $thttpd -- -C @@CONFFILE
|
||||
echo "."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/thttpd {start|stop|reload|restart|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1 @@
|
||||
dir=@@SRVDIR
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Tiny/Turbo/Throttling Web Server
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/sbin/thttpd -C @@CONFFILE -c cgi-bin/* -i /var/run/thttpd.pid
|
||||
PIDFile=/var/run/thttpd.pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,59 @@
|
||||
SUMMARY = "A simple, small, portable, fast, and secure HTTP server"
|
||||
DESCRIPTION = "A simple, small, portable, fast, and secure HTTP server (supported fork of thttpd)."
|
||||
HOMEPAGE = "http://opensource.dyc.edu/sthttpd"
|
||||
LICENSE = "BSD-2-Clause"
|
||||
LIC_FILES_CHKSUM = "file://src/thttpd.c;beginline=1;endline=26;md5=0c5762c2c34dcbe9eb18815516502872"
|
||||
|
||||
DEPENDS += "base-passwd virtual/crypt"
|
||||
|
||||
SRCREV = "2845bf5bff2b820d2336c8c8061cbfc5f271e720"
|
||||
SRC_URI = "git://github.com/blueness/${BPN};branch=master;protocol=https \
|
||||
file://0001-Define-_GNU_SOURCE-if-HAVE_SIGSET-is-set.patch \
|
||||
file://thttpd.service \
|
||||
file://thttpd.conf \
|
||||
file://init"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/blueness/sthttpd/releases/"
|
||||
UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+).tar.gz"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit autotools update-rc.d systemd update-alternatives
|
||||
|
||||
ALTERNATIVE_PRIORITY = "100"
|
||||
ALTERNATIVE:${PN}-doc = "htpasswd.1"
|
||||
ALTERNATIVE_LINK_NAME[htpasswd.1] = "${mandir}/man1/htpasswd.1"
|
||||
|
||||
SRV_DIR ?= "${servicedir}/www"
|
||||
|
||||
# Note that `${sbindir}/makeweb' is installed setgid to this group,
|
||||
# but ${SRV_DIR} is not installed chgrp'd to the group by default.
|
||||
WEBGROUP ?= "www-data"
|
||||
|
||||
do_configure:prepend () {
|
||||
export WEBDIR=${SRV_DIR}
|
||||
export WEBGROUP=${WEBGROUP}
|
||||
}
|
||||
|
||||
do_install:append () {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/thttpd
|
||||
install -c -m 755 ${WORKDIR}/thttpd.conf ${D}${sysconfdir}
|
||||
sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${sysconfdir}/init.d/thttpd
|
||||
sed -i -e 's,@@SRVDIR,${SRV_DIR},g' ${D}${sysconfdir}/thttpd.conf
|
||||
sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/thttpd
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
|
||||
sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
|
||||
sed -i 's!/var/!${localstatedir}/!g' ${D}${systemd_unitdir}/system/thttpd.service
|
||||
sed -i -e 's,@@CONFFILE,${sysconfdir}/thttpd.conf,g' ${D}${systemd_unitdir}/system/thttpd.service
|
||||
}
|
||||
|
||||
INITSCRIPT_NAME = "thttpd"
|
||||
INITSCRIPT_PARAMS = "defaults"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "thttpd.service"
|
||||
|
||||
FILES:${PN} += "${SRV_DIR}"
|
||||
FILES:${PN}-dbg += "${SRV_DIR}/cgi-bin/.debug"
|
||||
Reference in New Issue
Block a user