From 09bb28ae943de32e1468ca80fe8beecbc38077d2 Mon Sep 17 00:00:00 2001 From: Nicolas Gaullier Date: Tue, 21 Oct 2025 16:11:55 +0200 Subject: [PATCH] Add debian packager --- README.md | 4 ++++ debian/control | 0 makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 debian/control diff --git a/README.md b/README.md index f71c07d..c5b0960 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,11 @@ https://github.com/selsta/hlsdl/blob/master/msvc/BUID_WINDOWS.txt Docker: `docker build -t hlsdl:latest .` +Build debian package: `make deb` Usage and Options ----------------- + `./hlsdl [options] url` ``` @@ -31,6 +33,7 @@ docker run -v ./data:/var/hlsdl/data --rm -it hlsdl:latest hlsdl [options] url ``` --------------------------- + ``` -b ... Automatically choose the best quality. @@ -85,6 +88,7 @@ docker run -v ./data:/var/hlsdl/data --rm -it hlsdl:latest hlsdl [options] url ToDo ----- + * support for Fragmented MPEG-4 playlist * support for EXT-X-MAP in the MPEG-2 Transport Streams playlist diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..e69de29 diff --git a/makefile b/makefile index 27d9e4b..d9423b5 100644 --- a/makefile +++ b/makefile @@ -59,3 +59,44 @@ clean: rm -f $(HLSDL) .PHONY: clean + +# Build debian package +APP_BIN=./hlsdl +PACKAGE_VERSION=$(patsubst v%,%,$(shell git describe --tags --long --dirty)) +PACKAGE_DEPS=$(patsubst shlibs:Depends=%,%,$(shell dpkg-shlibdeps ${APP_BIN} -O)) +PACKAGE_TYPE=deb +PACKAGE_ARCH=$(shell dpkg --print-architecture) +PACKAGE_NAME=hlsdl +PACKAGE_FILENAME=${PACKAGE_NAME}-${PACKAGE_VERSION}-${PACKAGE_ARCH}.${PACKAGE_TYPE} +PACKAGE_BINDIR=/usr/local/bin +LINTIAN_IGNORE=debian-changelog-file-missing-or-wrong-name,dir-in-usr-local,extended-description-is-empty,file-in-usr-local + +deb: all + +ifeq (, $(shell which dpkg-shlibdeps)) + $(error "dpkg-shlibdeps is required, consider doing apt-get install dpkg-dev") +endif +ifeq (, $(shell which fpm)) + $(error "fpm is required, please check https://fpm.readthedocs.io/en/latest/installation.html") +endif + strip -s "${APP_BIN}" + chmod 755 "${APP_BIN}" + chmod 644 "LICENSE" + fpm -f -s dir \ + -t "${PACKAGE_TYPE}" \ + -p "${PACKAGE_FILENAME}" \ + --name "${PACKAGE_NAME}" \ + --version "${PACKAGE_VERSION}" \ + --architecture "${PACKAGE_ARCH}" \ + --depends "${PACKAGE_DEPS}" \ + --description "Converts .m3u8 playlists (using fragmented mpegts) to a .ts video." \ + --url "https://github.com/selsta/hlsdl" \ + --maintainer "selsta " \ + --license "MIT" \ + "LICENSE"="usr/share/doc/${PACKAGE_NAME}/copyright" \ + ${APP_BIN}="${PACKAGE_BINDIR}/${PACKAGE_NAME}" +ifeq (, $(shell which lintian)) + @echo "warning: lintian is not available: package checking is disabled, consider doing apt-get install lintian" +else + lintian --suppress-tags "${LINTIAN_IGNORE}" "${PACKAGE_FILENAME}" +endif