This shell script automates the process of cloning the nftables repository, fetching all Git tags, and creating a compressed Python source package (.tar.gz) for each release.
Each .tar.gz archive will contain the Python source code from the py/ directory of the respective nftables tag. All packages are collected into a dist directory.
- Clones the official nftables repository
- Fetches all Git tags
- Creates a clean
.tar.gzpackage of Python sources for each version - Organizes output in a
distfolder - Cleans up temporary files after execution
- git
- tar
- realpath
- Shell environment that supports POSIX sh
./builder.sh <working_directory>working_directory: Path where the script will create:tempdirectory for cloning and processingdistdirectory for storing the generated.tar.gzfiles
./builder.sh /tmp/nftables_buildAfter running, you will find a .tar.gz package for each nftables tag in the /tmp/nftables_build/dist/ directory.
If incorrect parameters are supplied, the script will display detailed usage instructions automatically.
- The resulting
.tar.gzpackages are simple archives of thepy/source code. - They are not pip-installable Python packages unless a
setup.pyorpyproject.tomlis manually added. - The script is designed for a clean, professional build process, adhering strictly to POSIX sh standards.