File debian.rules of Package svtplay-dl
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export THISMONTH=$(shell LC_TIME='en_US.UTF-8' date +%B)
export THISYEAR=$(shell date +%Y)
# Variables
export executable=svtplay-dl
export pkgname=$(executable)-git
export pkgname=$(executable)
export pkgver=$(shell head -n 1 /usr/src/packages/BUILD/debian/changelog | cut -d' ' -f 2 | sed 's/[(,)]//g' | cut -d'.' -f 1-2)
export install_prefix=/usr
# format manpage_date=January 2024
export manpage_date="$(THISMONTH) $(THISYEAR)"
export _topdir=/usr/src/packages
export _builddir=$(_topdir)/BUILD
#export _builddir=/usr/src/packages/BUILD
export _sourcedir=$(_topdir)/SOURCES
#export _sourcedir=/usr/src/packages/SOURCES
export _uploaddir=/usr/src/packages/SOURCES
export srcdir=/usr/src/packages/SOURCES
export pkgdir_head=$(_builddir)/debian
#export pkgdir_head=/usr/src/packages/BUILD/debian
export pkgdir=$(pkgdir_head)/$(pkgname)
#export pkgdir=$(pkgdir_head)/tmp
#export pkgdir=/usr/src/packages/BUILD/debian/tmp
export buildroot=/usr/src/packages/BUILD/debian/tmp
export buildroot=$(_builddir)/debian/$(pkgname)
#export buildroot=$(pkgdir)
export _installToDir=$(pkgdir)
#export _installToDir=/usr/src/packages/BUILD/debian/tmp
# Set debhelper options
DEB_BUILD_OPTIONS=nocheck
export LC_ALL=C.UTF-8
export PREFIX=/usr
## Disable basing the --version string on git describe output.
#export NO_GIT_VERSION=y
## This overrides upstream's default shebang for the generated svtplay-dl
## executable, to comform with Debian's Python policy (1.4.2).
export PYTHON=/usr/bin/python3
%:
dh $@
override_dh_auto_test:
override_dh_installman:
cp $(_uploaddir)/manual $(executable).1
dh_installman
execute_before_dh_auto_build:
echo "--- Entering section execute_before_dh_auto_build ---"
echo "Fix version number out of git"
sed -i "s|VERSION\ =\ \(.*\)|VERSION = "$(pkgver)"|g" lib/Makefile
execute_after_dh_auto_build:
echo "--- Entering section execute_after_dh_auto_build ---"
execute_before_dh_auto_install:
echo "--- Entering section execute_before_dh_auto_install ---"
execute_after_dh_auto_install:
echo "--- Entering section execute_after_dh_auto_install ---"
#mv -v $(pkgdir)$(PREFIX)/bin/$(executable) $(pkgdir)$(PREFIX)/bin/$(executable)-git
echo "--- Show files that will be packaged ---"
find $(pkgdir) | sed "s|$(pkgdir)||g"
echo "--- End show files that will be packaged ---"
echo "--- Exiting section execute_after_dh_auto_install ---"