Merge pull request #5 from mdr78/main

build: initial pybuild based deb packaging
This commit is contained in:
Pim van Pelt
2022-07-04 14:26:31 +02:00
committed by GitHub
9 changed files with 70 additions and 22 deletions

View File

@ -3,10 +3,12 @@ VPPCFG:=vppcfg
PYTHON?=python3
PIP?=pip
PIP_DEPENDS=build yamale netaddr pylint
PIP_DEPENDS+=argparse pyyaml ipaddress pyinstaller black
PIP_DEPENDS+=argparse pyyaml ipaddress black
WIPE=dist $(VPPCFG).egg-info .pybuild debian/vppcfg debian/vppcfg.*.log
WIPE+=debian/vppcfg.*.debhelper debian/.debhelper debian/files
WIPE+=debian/vppcfg.substvars
WHL_INSTALL=dist/$(VPPCFG)-$(VERSION)-py3-none-any.whl
.PHONY: build
build:
$(PYTHON) -m build
@ -19,10 +21,14 @@ install-deps:
install:
sudo $(PIP) install $(WHL_INSTALL)
.PHONY: pkg-deb
pkg-deb:
dpkg-buildpackage -uc -us -b
.PHONY: uninstall
uninstall:
sudo $(PIP) uninstall $(VPPCFG)
.PHONY: wipe
wipe:
$(RM) -rf dist $(VPPCFG).egg-info
$(RM) -rf $(WIPE)

View File

@ -25,8 +25,9 @@ $ make build
## Install the tool with PIP
$ make install
###
## To build & install debian packaging
$ make pkg-deb
$ sudo deb -i ../vppcfg_0.0.1_amd64.deb
```
## Running

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
vppcfg (0.0.1) unstable; urgency=low
* Initial public release
-- Ray Kinsella <mdr@ashroe.eu> Thu, 30 Jun 2022 14:00:00 +0000

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

12
debian/control vendored Normal file
View File

@ -0,0 +1,12 @@
Source: vppcfg
Section: python
Priority: extra
Maintainer: Ray Kinsella <mdr@ashroe.eu>
Build-Depends: debhelper (>= 9), python3-all, dh-python
Standards-Version: 3.9.5
Package: vppcfg
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python3.8, ${misc:Pre-Depends}
Depends: python3-netaddr, python3-ipaddr, ${misc:Depends}
Description: A configuration tool for FD.io VPP

6
debian/rules vendored Normal file
View File

@ -0,0 +1,6 @@
#!/usr/bin/make -f
%:
dh $@ --with python3 --buildsystem=pybuild --with systemd
override_dh_auto_test:

13
debian/vppcfg.service vendored Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=vppcfg
BindsTo=vpp.service
After=vpp.service
ConditionPathExists=/etc/vpp/config.yaml
[Service]
Type=oneshot
ExecStart=vppcfg apply -c /etc/vpp/config.yaml
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@ -1,17 +0,0 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "vppcfg"
version = "0.0.1"
dependencies = [
'requests',
'importlib-metadata; python_version<"3.8"',
]
[project.scripts]
vppcfg = "vppcfg:vppcfg.main"
[options]
include_package_data = true

21
setup.py Normal file
View File

@ -0,0 +1,21 @@
from setuptools import setup, find_packages
setup(
name="vppcfg",
version="0.0.1",
install_requires=[
"requests",
'importlib-metadata; python_version == "3.8"',
"yamale",
"netaddr",
"ipaddress",
"vpp_papi",
],
packages=["vppcfg", "vppcfg/config", "vppcfg/vpp"],
entry_points={
"console_scripts": [
"vppcfg = vppcfg.vppcfg:main",
]
},
include_package_data=True,
)