From c0929e3aafdc3f50cb3d3b2b394e2e74280aa347 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Sun, 20 Feb 2022 18:06:55 +0100 Subject: [PATCH] Add some missing files to make-dist --- MANIFEST.in | 16 +++++++++++++--- utils/make-dist.sh | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index d03cbf21..2cff9eba 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,12 +2,13 @@ global-include meson.build recursive-include src *.c *.h meson.build recursive-include src/perl *.c *.h *.xs *.pm *.pl typemap meson.build +recursive-include src/fe-fuzz *.c *.h *.txt meson.build recursive-include tests *.c meson.build include meson_options.txt include subprojects/*.wrap -prune subprojects/*/ +# prune subprojects/* include utils/*.pl utils/*.sh exclude utils/make-dist.sh @@ -17,9 +18,18 @@ include themes/*.theme include docs/*.1 docs/*.txt docs/*.html include docs/help/in/[a-z]*.in include scripts/*.pl scripts/examples/*.pl +include irssi-icon.png include NEWS +include INSTALL +include TODO +include ChangeLog -prune Build -prune dist +include .clang-format + +# prune Build +# prune dist prune *.egg-info + +# ignore fuzz-support/fuzz.diff +# ignore utils/clang-format-xs/* diff --git a/utils/make-dist.sh b/utils/make-dist.sh index d156255a..f1e4e4af 100755 --- a/utils/make-dist.sh +++ b/utils/make-dist.sh @@ -22,8 +22,15 @@ fi cd "$repo_root" ./utils/check-perl-hash.sh +if [ -f pyproject.toml ] || [ -f setup.cfg ]; then + echo "**Error**: ${PKG_NAME} make-dist.sh cannot be run in Dist directory, cannot proceed." + exit 1 +fi + + rm -fr "$dist_tmp" -git clone --no-local "$repo_root" "$dist_tmp" +echo "Cloning to \`$dist_tmp'..." +git clone --quiet --no-local "$repo_root" "$dist_tmp" cd "$dist_tmp" if [ ! -f meson.build ]; then echo "**Error**: ${PKG_NAME} make-dist.sh could not find meson.build, cannot proceed." @@ -37,22 +44,48 @@ if [ -z "$name" ] || [ -z "$version" ]; then exit 1 fi +git log > ChangeLog + +cat <pyproject.toml +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +PYPROJECT_TOML + cat <setup.cfg [metadata] name = $name version = $version url = https://ailin-nemui.github.io/irssi/ maintainer = Ailin Nemui +maintainer_email = @ license = GNU General Public License v2 or later (GPLv2+) +[check-manifest] +ignore = + pyproject.toml +$(perl -a -l -n -e '$F[0] eq "#" and $F[1] eq "ignore" and print " @F[2..$#F]"' MANIFEST.in) + SETUP_CFG -python3 -c 'from setuptools import *;setup()' sdist --formats=tar + +if command -v check-manifest >/dev/null; then + echo "Checking MANIFEST.in..." + check-manifest --ignore ChangeLog +else + echo "**Warning**: check-manifest not found, did not check MANIFEST.in" +fi + +echo "Creating sdist..." +python3 -W ignore -c 'from setuptools import *;setup()' --quiet sdist --formats=tar tar --delete --file "dist/$name-$version.tar" \ "$name-$version/setup.cfg" \ + "$name-$version/pyproject.toml" \ "$name-$version/$name.egg-info" \ "$name-$version/PKG-INFO" +echo "Zipping..." xz -k "dist/$name-$version.tar" gzip -k "dist/$name-$version.tar"