#! /bin/sh
#
# pack.sh - package program for redistribution
# Copyright (C) 2025  Paulina Laura Emilia
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without any warranty.
#
program_name=jpdftweak
program_version=1.1
output=$PWD/$program_name-$program_version.tar

if ! cd -- "$(dirname -- "$0")/../.."; then
	printf '%s: Cannot change to the package root directory.\n' "$0"
	exit 1
fi

"${GTAR:-tar}" -cf "$output" -T "share/$program_name/manifest.txt" --sort=name \
	--mtime="@${SOURCE_DATE_EPOCH:-0}" --owner=0 --group=0 --numeric-owner \
	--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime
