-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1425 from garberg/repackage_nipap-cli
Modernize packaging of nipap-cli
- Loading branch information
Showing
10 changed files
with
76 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,17 @@ Source: nipap-cli | |
Maintainer: Lukas Garberg <[email protected]> | ||
Section: python | ||
Priority: optional | ||
Build-Depends: python3 (>= 3.1), dh-python, debhelper (>= 10), python3-setuptools | ||
Standards-Version: 4.4.0 | ||
Build-Depends: debhelper-compat (= 13), | ||
dh-python, | ||
dh-exec, | ||
python3-all, | ||
python3-setuptools, | ||
bash-completion | ||
Standards-Version: 4.6.1 | ||
|
||
Package: nipap-cli | ||
Architecture: all | ||
Depends: ${misc:Depends}, python3 (>= 3.1), python3-ipy, python3-pynipap | ||
Depends: ${misc:Depends}, ${python3:Depends} | ||
Description: Neat IP Address Planner | ||
The Neat IP Address Planner, NIPAP, is a system built for efficiently managing | ||
large amounts of IP addresses. This is the shell command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/dh-exec | ||
nipaprc => /etc/.nipaprc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../bash_complete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/make -f | ||
|
||
#export DH_VERBOSE=1 | ||
export PYBUILD_NAME=nipap-cli | ||
export PYBUILD_INSTALL_ARGS=--install-lib usr/lib/python3/dist-packages/ | ||
#export PYBUILD_NAME=nipap-cli | ||
#export PYBUILD_INSTALL_ARGS=--install-lib usr/lib/python3/dist-packages/ | ||
|
||
%: | ||
dh $@ --with python3 --buildsystem=pybuild | ||
dh $@ --with python3 --buildsystem=pybuild --with bash-completion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (quilt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[project] | ||
name = "nipap-cli" | ||
dynamic = ["version", "description"] | ||
readme = "README.rst" | ||
license = {text = "MIT"} | ||
classifiers = [ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: System Administrators', | ||
'Intended Audience :: Telecommunications Industry', | ||
'License :: OSI Approved :: MIT License', | ||
'Natural Language :: English', | ||
'Operating System :: POSIX :: Linux', | ||
'Programming Language :: Python :: 3', | ||
'Topic :: Internet' | ||
] | ||
keywords = ["nipap"] | ||
dependencies = [ | ||
"pynipap", | ||
"IPy==1.01" | ||
] | ||
|
||
[project.urls] | ||
Homepage = "http://SpriteLink.github.io/NIPAP" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "nipap_cli.__version__"} | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools", | ||
# Need to be pinned to 0.20.1 in Ubuntu 24.04 as using the latest 0.21.2 | ||
# gives a diff during .deb package build. Unfortunately the files are | ||
# generated twice - first once in a virtualenv (using the version specified | ||
# here) and then once without a virtualenv using the one from the system. | ||
# There two runs produce different outputs (wich they shouldn't) causing a | ||
# diff and the package utils to b0rk out. | ||
"docutils==0.20.1" | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,35 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from distutils.core import setup | ||
import subprocess | ||
from docutils.core import publish_cmdline | ||
from docutils.writers import manpage | ||
from setuptools import setup | ||
import sys | ||
|
||
import nipap_cli | ||
|
||
# return all the extra data files | ||
def get_data_files(): | ||
|
||
# This is a bloody hack to circumvent a lack of feature with Python distutils. | ||
# Files specified in the data_files list cannot be renamed upon installation | ||
# and we don't want to keep two copies of the .nipaprc file in git | ||
import shutil | ||
shutil.copyfile('nipaprc', '.nipaprc') | ||
|
||
# generate man pages using rst2man | ||
# generate man pages from .rst-file | ||
try: | ||
subprocess.call(["rst2man", "nipap.man.rst", "nipap.1"]) | ||
except OSError as exc: | ||
print("rst2man failed to run:", str(exc), file=sys.stderr) | ||
publish_cmdline(writer=manpage.Writer(), argv=["nipap.man.rst", "nipap.1"]) | ||
except Exception as exc: | ||
print("rst2man failed to run: %s" % str(exc), file=sys.stderr) | ||
sys.exit(1) | ||
|
||
files = [ | ||
('/etc/skel/', ['.nipaprc']), | ||
('/usr/bin/', ['helper-nipap', 'nipap']), | ||
('/usr/share/doc/nipap-cli/', ['bash_complete', 'nipaprc']), | ||
('/usr/share/man/man1/', ['nipap.1']) | ||
('bin/', ['helper-nipap', 'nipap']), | ||
('share/doc/nipap-cli/', ['bash_complete', 'nipaprc']), | ||
('share/man/man1/', ['nipap.1']) | ||
] | ||
|
||
return files | ||
|
||
|
||
long_desc = open('README.rst').read() | ||
short_desc = long_desc.split('\n')[0] | ||
|
||
setup( | ||
name = 'nipap-cli', | ||
version = nipap_cli.__version__, | ||
description = "NIPAP shell command", | ||
long_description = "A shell command to interact with NIPAP.", | ||
author = nipap_cli.__author__, | ||
author_email = nipap_cli.__author_email__, | ||
license = nipap_cli.__license__, | ||
url = nipap_cli.__url__, | ||
description = short_desc, | ||
long_description = long_desc, | ||
packages = ['nipap_cli'], | ||
keywords = ['nipap_cli'], | ||
requires = ['IPy', 'pynipap'], | ||
data_files = get_data_files(), | ||
classifiers = [ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: System Administrators', | ||
'Intended Audience :: Telecommunications Industry', | ||
'License :: OSI Approved :: MIT License', | ||
'Natural Language :: English', | ||
'Operating System :: POSIX :: Linux', | ||
'Programming Language :: Python :: 3 :: Only', | ||
'Topic :: Internet' | ||
] | ||
) | ||
|
||
# Remove the .nipaprc put the by the above hack. | ||
import os | ||
os.remove('.nipaprc') |