bundlewrap/bundles/php/metadata.py

47 lines
1 KiB
Python

defaults = {
'apt': {
'repos': {
'php': {
'items': {
'deb https://packages.sury.org/php/ {os_release} main',
},
},
},
},
}
@metadata_reactor
def php_packages_with_features(metadata):
version = metadata.get('php/version')
packages = {
f'php{version}': {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
},
f'php{version}-cli': {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
},
f'php{version}-fpm': {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
},
}
for package in metadata.get('php/packages', set()):
packages[f'php{version}-{package}'] = {
'triggers': {
f'svc_systemd:php{version}-fpm:restart',
}
}
return {
'apt': {
'packages': packages,
},
}