Commit 9b42ad3c authored by Peter Shkenev's avatar Peter Shkenev 🤔
Browse files

testing/trafficserver9: new aport

trafficserver.apache.org

Fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server
parent 83240e9b
Pipeline #125502 passed with stages
in 7 minutes and 3 seconds
--- trafficserver-9.1.2.orig/src/tscore/ts_file.cc
+++ trafficserver-9.1.2/src/tscore/ts_file.cc
@@ -22,6 +22,7 @@
#include <fcntl.h>
#include <sys/types.h>
#include <dirent.h>
+#include <limits.h>
namespace ts
{
--- trafficserver-9.1.2.orig/rc/trafficserver.in
+++ trafficserver-9.1.2/rc/trafficserver.in
@@ -62,6 +62,8 @@
DISTRIB_ID="debian" # also exists on Ubuntu
elif [ -e /etc/slackware-version ]; then
DISTRIB_ID="slackware"
+elif [ -e /etc/alpine-release ]; then
+ DISTRIB_ID="alpine"
elif [ "$UNAME_S" = "Darwin" ]; then
DISTRIB_ID="Darwin"
elif [ "$UNAME_S" = "FreeBSD" ]; then
@@ -311,7 +313,7 @@
test "$?" -ne 0 -a "$?" -ne 1 && retval=1
test "x$VERBOSE" != "xno" && log_end_msg "$retval"
exit "$retval"
- elif [ "$DISTRIB_ID" = "gentoo" ]; then
+ elif [ "$DISTRIB_ID" = "gentoo" -o "$DISTRIB_ID" = "alpine" ]; then
ebegin "Starting ${TS_PACKAGE_NAME}"
do_start
eend $?
@@ -348,7 +350,7 @@
elif [ "$DISTRIB_ID" = "fedora" -o "$DISTRIB_ID" = "redhat" ]; then
action "Stopping ${TM_NAME}:" killproc -p $TM_PIDFILE -d 35 $TM_DAEMON
action "Stopping ${TS_NAME}:" killproc -p $TS_PIDFILE -d 35 $TS_DAEMON
- elif [ "$DISTRIB_ID" = "gentoo" ]; then
+ elif [ "$DISTRIB_ID" = "gentoo" -o "$DISTRIB_ID" = "alpine" ]; then
ebegin "Starting ${TS_PACKAGE_NAME}"
do_stop
eend $?
@@ -396,7 +398,7 @@
exit "$retval"
elif [ "$DISTRIB_ID" = "fedora" -o "$DISTRIB_ID" = "redhat" ]; then
action "Reloading ${NAME}:" $TL_BINARY config reload
- elif [ "$DISTRIB_ID" = "gentoo" ]; then
+ elif [ "$DISTRIB_ID" = "gentoo" -o "$DISTRIB_ID" = "alpine" ]; then
ebegin "Reloading ${NAME}"
$TL_BINARY config reload
eend $?
@@ -460,7 +462,7 @@
status=$?
[ $status -eq 0 ] || /bin/echo -n "not "
echo "running."
- elif [ "$DISTRIB_ID" = "FreeBSD" -o "$DISTRIB_ID" = "gentoo" ]; then
+ elif [ "$DISTRIB_ID" = "FreeBSD" -o "$DISTRIB_ID" = "gentoo" -o "$DISTRIB_ID" = "alpine" ]; then
if pgrep $TM_NAME > /dev/null ; then
echo "$TM_NAME running as pid `cat $TM_PIDFILE`" ; else
echo "$TM_NAME not running"
@@ -492,7 +494,7 @@
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
elif [ "$DISTRIB_ID" = "fedora" -o "$DISTRIB_ID" = "redhat" ]; then
echo "Usage: $0 {start|stop|status|restart|condrestart}"
- elif [ "$DISTRIB_ID" = "gentoo" ]; then
+ elif [ "$DISTRIB_ID" = "gentoo" -o "$DISTRIB_ID" = "alpine" ]; then
echo "Usage: $0 {start|stop|reload|restart|status}"
elif [ "$DISTRIB_ID" = "suse" ]; then
echo "Usage: $0 {start|stop|restart|status}"
--- trafficserver-9.1.2.orig/lib/perl/Makefile.in
+++ trafficserver-9.1.2/lib/perl/Makefile.in
@@ -696,7 +696,7 @@
# copy them to the build directory if we are building out of tree.
Makefile-pl: Makefile.PL $(top_builddir)/config.status
test -f "$(top_builddir)/$(subdir)/Makefile.PL" || cp -rf "$(srcdir)/." "$(top_builddir)/$(subdir)/"
- $(PERL) Makefile.PL INSTALLDIRS=$(INSTALLDIRS) INSTALL_BASE=$(prefix) PREFIX=
+ $(PERL) Makefile.PL INSTALLDIRS=$(INSTALLDIRS) INSTALL_BASE= PREFIX=$(prefix)
clean-local:
-rm -f Makefile-pl
diff -Nurp trafficserver-9.1.2.orig/config.layout trafficserver-9.1.2/config.layout
--- trafficserver-9.1.2.orig/config.layout 2021-11-08 22:01:21.000000000 +0300
+++ trafficserver-9.1.2/config.layout 2022-06-12 01:45:35.469908177 +0300
@@ -277,3 +277,24 @@
logdir: /var/log+
cachedir: /var/lib+
</Layout>
+
+# Alpine Linux path layout.
+<Layout Alpine>
+ prefix: /usr/
+ exec_prefix: ${prefix}
+ bindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
+ libdir: ${exec_prefix}/lib
+ libexecdir: ${exec_prefix}/libexec+
+ infodir: ${prefix}/share/info
+ mandir: ${prefix}/share/man
+ sysconfdir: /etc+
+ datadir: ${prefix}/share+
+ docdir: ${prefix}/share/doc+
+ installbuilddir: ${datadir}/build
+ includedir: ${prefix}/include
+ localstatedir: /var/lib
+ runtimedir: ${localstatedir}+
+ logdir: /var/log+
+ cachedir: /var/cache+
+</Layout>
# Contributor: Peter Shkenev <santurysim@gmail.com>
# Maintainer: Peter Shkenev <santurysim@gmail.com>
pkgname=trafficserver9
_pkgreal=trafficserver
pkgver=9.1.2
pkgrel=0
provides=trafficserver
pkgdesc="Fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server"
url="trafficserver.apache.org"
arch="x86_64 aarch64 ppc64le" # other platforms are unsupported
license="Apache-2.0"
makedepends="
curl-dev
flex
hwloc-dev
libcap-dev
libexecinfo-dev
libtool
libunwind-dev
luajit-dev
ncurses-dev
openssl-dev
pcre-dev
perl
zlib-dev
"
options="!check" # test suite fails, reported to upstream
subpackages="
$pkgname-doc
$pkgname-dev
perl-$pkgname:perl_ts:noarch
$pkgname-openrc
$pkgname-utils
$pkgname-plugin-base:plugin_base
$pkgname-plugin-authproxy:plugin_authproxy
$pkgname-plugin-backgroundfetch:plugin_backgroundfetch
$pkgname-plugin-s3auth:plugin_s3auth
$pkgname-plugin-cachekey:plugin_cachekey
$pkgname-plugin-cachepromote:plugin_cachepromote
$pkgname-plugin-cacherangerequests:plugin_cacherangerequests
$pkgname-plugin-combohandler:plugin_combohandler
$pkgname-plugin-confremap:plugin_confremap
$pkgname-plugin-esi:plugin_esi
$pkgname-plugin-escalate:plugin_escalate
$pkgname-plugin-generator:plugin_generator
$pkgname-plugin-compress:plugin_compress
$pkgname-plugin-headerrewrite:plugin_headerrewrite
$pkgname-plugin-healthchecks:plugin_healthchecks
$pkgname-plugin-lua:plugin_lua
$pkgname-plugin-regexremap:plugin_regexremap
$pkgname-plugin-regexrevalidate:plugin_regexrevalidate
$pkgname-plugin-statsoverhttp:plugin_statsoverhttp
$pkgname-plugin-tcpinfo:plugin_tcpinfo
$pkgname-plugin-xdebug:plugin_xdebug
$pkgname-plugin-certifier:plugin_certifier
$pkgname-plugin-multiplexer:plugin_multiplexer
$pkgname-plugin-prefetch:plugin_prefetch
$pkgname-plugin-remappurge:plugin_remappurge
"
source="
https://dlcdn.apache.org/trafficserver/trafficserver-$pkgver.tar.bz2
10-fix-PATH_MAX-on-ppc64le.patch
20-adapt-trafficserver.patch
30-fix-perl-installation.patch
40-alpine-dir-layout.patch
trafficserver.initd
"
install="$pkgname.pre-install $pkgname.post-install"
builddir="$srcdir/$_pkgreal-$pkgver"
pkgusers="trafficserver"
pkggroups="trafficserver"
build() {
# Layout contains all dir variables
./configure \
--build=$CBUILD \
--host=$CHOST \
--enable-layout=Alpine \
--with-user=trafficserver \
--with-group=trafficserver
make
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" install
find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
install -Dm755 "$srcdir"/trafficserver.initd "$pkgdir"/etc/init.d/trafficserver
}
perl_ts() {
pkgdesc="Perl modules for managing Apache Traffic Server"
depends="perl $depends"
amove usr/lib/perl5
amove usr/share/perl5
}
plugin_base() {
pkgdesc="Apache Traffic Server plugin core libraries"
amove usr/lib/plugin*
amove usr/libexec/trafficserver/libloader.so
amove usr/libexec/trafficserver/server_push_preload.so
}
plugin_authproxy() {
pkgdesc="Apache Traffic Server AuthProxy plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/authproxy.so
}
plugin_backgroundfetch() {
pkgdesc="Apache Traffic Server Background Fetch plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/background_fetch.so
}
plugin_s3auth() {
pkgdesc="Apache Traffic Server AWS S3 Authentication plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/s3_auth.so
}
plugin_cachekey() {
pkgdesc="Apache Traffic Server Cache Key and Parent Selection URL Manipulation plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/cachekey.so
}
plugin_cachepromote() {
pkgdesc="Apache Traffic Server Cache Promotion Policies plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/cache_promote.so
}
plugin_cacherangerequests() {
pkgdesc="Apache Traffic Server Cache Range Requests plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/cache_range_requests.so
}
plugin_combohandler() {
pkgdesc="Apache Traffic Server Combo Handler plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/combo_handler.so
}
plugin_confremap() {
pkgdesc="Apache Traffic Server Configuration Remap plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/conf_remap.so
}
plugin_esi() {
pkgdesc="Apache Traffic Server ESI plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/esi.so
}
plugin_escalate() {
pkgdesc="Apache Traffic Server Escalate plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/escalate.so
}
plugin_generator() {
pkgdesc="Apache Traffic Server Generator plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/generator.so
}
plugin_compress() {
pkgdesc="Apache Traffic Server Compress plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/compress.so
}
plugin_headerrewrite() {
pkgdesc="Apache Traffic Server Header Rewrite plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/header_rewrite.so
}
plugin_healthchecks() {
pkgdesc="Apache Traffic Server Health Checks plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/healthchecks.so
}
plugin_lua() {
pkgdesc="Apache Traffic Server Lua plugin"
depends="$pkgname-plugin-base luajit $depends"
amove usr/libexec/trafficserver/tslua.so
}
plugin_regexremap() {
pkgdesc="Apache Traffic Server Regex Remap plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/regex_remap.so
}
plugin_regexrevalidate() {
pkgdesc="Apache Traffic Server Regex Revalidate plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/regex_revalidate.so
}
plugin_statsoverhttp() {
pkgdesc="Apache Traffic Server Stats over HTTP plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/stats_over_http.so
}
plugin_tcpinfo() {
pkgdesc="Apache Traffic Server TPCinfo plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/tcpinfo.so
}
plugin_xdebug() {
pkgdesc="Apache Traffic Server XDebug plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/xdebug.so
}
plugin_certifier() {
pkgdesc="Apache Traffic Server Certifier plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/certifier.so
}
plugin_multiplexer() {
pkgdesc="Apache Traffic Server Multiplexer plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/multiplexer.so
}
plugin_prefetch() {
pkgdesc="Apache Traffic Server Prefetch plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/prefetch.so
}
plugin_remappurge() {
pkgdesc="Apache Traffic Server Remap Purge plugin"
depends="$pkgname-plugin-base $depends"
amove usr/libexec/trafficserver/remap_purge.so
}
utils() {
pkgdesc="Apache Traffic Server auxiliary utils"
depends="curl $depends"
amove usr/bin/traffic_cache_tool
amove usr/bin/traffic_crashlog
amove usr/bin/traffic_layout
amove usr/bin/traffic_logcat
amove usr/bin/traffic_logstats
amove usr/bin/traffic_top
amove usr/bin/traffic_via
amove usr/bin/tspush
amove usr/bin/tsxs
}
sha512sums="
05ec110cd25f93861a1609608dd82030ed9b21cc561fb1a66c76c06317bc16235d79389a7ffc76218527d7b524585473897bee6e01529f1c8f4f1b844cde4359 trafficserver-9.1.2.tar.bz2
fbbe4fd4024b4656a3d4f67bdace7ae3a65892d40a92c67245e277520dfd53d5e9eb7934b2d213dfecc4de6895c63ec67cef0edee7b43ba28319cfaa3c75ddf3 10-fix-PATH_MAX-on-ppc64le.patch
f0641d9b6d263340c7b29e708cbf9cedcf74578ab77e425949bb7f9abc7a06f2a88cf2d4168d2936e8216a260c6bf3480f50390cd2cacc4afe69489b8bda4c64 20-adapt-trafficserver.patch
47d7d83be1e7798bb905c217efab9480aa6e6218eb09317c20c457f454895016a6104818d86223a051c8adc40f42c7436aa607f73e505c939bd2d5dd8e5efa45 30-fix-perl-installation.patch
791b5ea9620574b172587fb2fcde97da53ca4c4a64110f1e1e13b9e475ffa255753fd98933a2f0f1ef44a2bf7810f6828445147fc6dcc8a41869b62271a728ad 40-alpine-dir-layout.patch
a4d2e91d92579ba8b0c5361b0f4fd490d7a90e8a170552428f4781432eca89503a87a2c6f571a342eb77db5a43baa03d779a1fbe37ce1f4bba24fe89d5c97e7d trafficserver.initd
"
#!/sbin/openrc-run
name="Apache Traffic Server"
command="/usr/bin/traffic_manager"
command_background="yes"
pidfile="/run/traffic_manager.pid"
ts_pidfile=/var/lib/trafficserver/server.lock
tm_pidfile=/var/lib/trafficserver/manager.lock
tm_name="/usr/bin/traffic_manager"
ts_name="/usr/bin/traffic_server"
extra_started_commands="reload"
depend() {
need net
after firewall
}
stop() {
ebegin "Stopping Apache Traffic Server manager"
start-stop-daemon --stop --quiet --retry=QUIT/30/KILL/5 --pidfile "$pidfile" --name "$tm_name"
eend $?
ebegin "Stopping remaining Apache Traffic Server manager instances"
start-stop-daemon --stop --quiet --retry=0/30/KILL/5 --exec "$ts_name"
eend $?
# Stop traffic_server instance
ebegin "Stopping remaining Apache Traffic Server instances"
start-stop-daemon --stop --quiet --retry=QUIT/30/KILL/5 --pidfile "$ts_pidfile" --name "$ts_name"
eend $?
# Clean up pidfiles
rm -f "$ts_pidfile" "$tm_pidfile"
}
reload() {
ebegin "Reloading Apache Traffic Server configuration"
traffic_ctl config reload
eend $?
}
#!/bin/sh
echo "Using rc-service trafficserver <cmd> is recommended over trafficserver <cmd>."
#!/bin/sh
addgroup -S trafficserver 2>/dev/null
adduser -S -D -H -s /sbin/nologin -G trafficserver -g "Apache Traffic Server" trafficserver 2>/dev/null
exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment