Generate proper dependencies on deb Packages

This commit is contained in:
Kishi85 2020-02-19 10:35:31 +01:00
parent e5edc4e5aa
commit 882ddfd0b8
2 changed files with 47 additions and 45 deletions

View File

@ -6,6 +6,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update -qq -y sudo apt update -qq -y
@ -26,11 +28,18 @@ jobs:
python3 setup.py bdist_wheel python3 setup.py bdist_wheel
- name: Prepare stdeb build process - name: Prepare stdeb build process
id: stdebprep
run: | run: |
# Patch setup.py to allow stdeb proper debian style builds
sed "s/=determine_version()/='$(python3 setup.py --version)'/gi" -i setup.py sed "s/=determine_version()/='$(python3 setup.py --version)'/gi" -i setup.py
sed "s@('readme'@('share/doc/python3-acertmgr'@" -i setup.py sed "s@('readme'@('share/doc/python3-acertmgr'@" -i setup.py
# Determine recommended dependencies for deb package
echo "::set-output name=recommends3::$(echo "python3-pkg-resources")"
# Find optional dependencies to suggest in deb package
echo "::set-output name=suggests3::$(python3 -c "from setup import extra_requirements; print('\n'.join(['\n'.join(x) for x in extra_requirements.values()]))" | grep -v cryptography | sed 's/PyYAML/yaml/gi' | awk '{ printf("python3-%s, ",$1)};' | awk '{$1=$1; print}')"
- name: Build debian package using setuptools and stdeb - name: Build debian package using setuptools and stdeb
run: python3 setup.py --command-packages=stdeb.command bdist_deb run: python3 setup.py --command-packages=stdeb.command sdist_dsc --with-python2=False --with-python3=True --recommends3="${{ steps.stdebprep.outputs.recommends3 }}" --suggests3="${{ steps.stdebprep.outputs.suggests3 }}" bdist_deb
- name: Create a changelog from git log since last non-pre/rc tag - name: Create a changelog from git log since last non-pre/rc tag
run: | run: |

View File

@ -45,49 +45,42 @@ def determine_version():
return version return version
setup( extra_requirements = {
name="acertmgr", "dns": ["dnspython"],
version=determine_version(), "yaml": ["PyYAML"],
author="Markus Hauschild", "idna": ["idna"],
author_email="moepman@binary-kitchen.de", "ocsp-must-staple": ["cryptography>=2.1"],
description="An automated certificate manager using ACME/letsencrypt", "ed25519": ["cryptography>=2.6"],
license="ISC", }
keywords="acme letsencrypt",
url="https://github.com/moepman/acertmgr", if __name__ == "__main__":
packages=find_packages(), setup(
long_description=read('README.md'), name="acertmgr",
long_description_content_type="text/markdown", version=determine_version(),
classifiers=[ author="Markus Hauschild",
"Development Status :: 5 - Production/Stable", author_email="moepman@binary-kitchen.de",
"Programming Language :: Python", description="An automated certificate manager using ACME/letsencrypt",
"Environment :: Console", license="ISC",
"Topic :: Security :: Cryptography", keywords="acme letsencrypt",
"License :: OSI Approved :: ISC License (ISCL)", url="https://github.com/moepman/acertmgr",
], packages=find_packages(),
install_requires=[ long_description=read('README.md'),
"cryptography>=0.6", long_description_content_type="text/markdown",
], classifiers=[
extras_require={ "Development Status :: 5 - Production/Stable",
"dns": [ "Programming Language :: Python",
"dnspython", "Environment :: Console",
"Topic :: Security :: Cryptography",
"License :: OSI Approved :: ISC License (ISCL)",
], ],
"yaml": [ install_requires=[
"PyYAML", "cryptography>=0.6",
], ],
"idna": [ extras_require=extra_requirements,
"idna", entry_points={
], 'console_scripts': [
"ocsp-must-staple": [ 'acertmgr=acertmgr:main',
"cryptography>=2.1", ],
], },
"ed25519": [ data_files=[('readme', ['README.md'])]
"cryptography>=2.6", )
],
},
entry_points={
'console_scripts': [
'acertmgr=acertmgr:main',
],
},
data_files=[('readme', ['README.md'])]
)