install bash completion into share/bash-completion/completions
This commit is contained in:
13
Makefile
13
Makefile
@@ -5,13 +5,10 @@ MANDIR ?= $(PREFIX)/man
|
|||||||
SHAREDIR ?= $(PREFIX)/share
|
SHAREDIR ?= $(PREFIX)/share
|
||||||
PYTHON ?= /usr/bin/env python3
|
PYTHON ?= /usr/bin/env python3
|
||||||
|
|
||||||
# set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
|
|
||||||
SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi)
|
|
||||||
|
|
||||||
all: man completion docs/supportedsites.rst
|
all: man completion docs/supportedsites.rst
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) gallery-dl.1 gallery-dl.conf.5 gallery-dl.bash_completion
|
|
||||||
$(RM) -r build/
|
$(RM) -r build/
|
||||||
|
|
||||||
install: man completion
|
install: man completion
|
||||||
@@ -26,20 +23,20 @@ test:
|
|||||||
executable:
|
executable:
|
||||||
scripts/pyinstaller.py
|
scripts/pyinstaller.py
|
||||||
|
|
||||||
completion: gallery-dl.bash_completion
|
completion: build/completion/gallery-dl
|
||||||
|
|
||||||
man: gallery-dl.1 gallery-dl.conf.5
|
man: build/man/gallery-dl.1 build/man/gallery-dl.conf.5
|
||||||
|
|
||||||
.PHONY: all clean install release test executable completion man
|
.PHONY: all clean install release test executable completion man
|
||||||
|
|
||||||
docs/supportedsites.rst: gallery_dl/*/*.py scripts/supportedsites.py
|
docs/supportedsites.rst: gallery_dl/*/*.py scripts/supportedsites.py
|
||||||
$(PYTHON) scripts/supportedsites.py
|
$(PYTHON) scripts/supportedsites.py
|
||||||
|
|
||||||
gallery-dl.1: gallery_dl/option.py scripts/man.py
|
build/man/gallery-dl.1: gallery_dl/option.py gallery_dl/version.py scripts/man.py
|
||||||
$(PYTHON) scripts/man.py
|
$(PYTHON) scripts/man.py
|
||||||
|
|
||||||
gallery-dl.conf.5: docs/configuration.rst scripts/man.py
|
build/man/gallery-dl.conf.5: docs/configuration.rst gallery_dl/version.py scripts/man.py
|
||||||
$(PYTHON) scripts/man.py
|
$(PYTHON) scripts/man.py
|
||||||
|
|
||||||
gallery-dl.bash_completion: gallery_dl/option.py scripts/bash_completion.py
|
build/completion/gallery-dl: gallery_dl/option.py scripts/bash_completion.py
|
||||||
$(PYTHON) scripts/bash_completion.py
|
$(PYTHON) scripts/bash_completion.py
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ for action in option.build_parser()._actions:
|
|||||||
if opt.startswith("--"):
|
if opt.startswith("--"):
|
||||||
opts.append(opt)
|
opts.append(opt)
|
||||||
|
|
||||||
PATH = util.path("gallery-dl.bash_completion")
|
PATH = util.path("build/completion/gallery-dl")
|
||||||
with open(PATH, "w", encoding="utf-8") as file:
|
with open(PATH, "w", encoding="utf-8") as file:
|
||||||
file.write(TEMPLATE % {
|
file.write(TEMPLATE % {
|
||||||
"opts" : " ".join(opts),
|
"opts" : " ".join(opts),
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ and https://github.com/mikf/gallery-dl/graphs/contributors
|
|||||||
))
|
))
|
||||||
|
|
||||||
if not path:
|
if not path:
|
||||||
path = util.path("gallery-dl.1")
|
path = util.path("build/man/gallery-dl.1")
|
||||||
with open(path, "w", encoding="utf-8") as file:
|
with open(path, "w", encoding="utf-8") as file:
|
||||||
file.write(TEMPLATE.lstrip() % {
|
file.write(TEMPLATE.lstrip() % {
|
||||||
"options": "\n".join(options),
|
"options": "\n".join(options),
|
||||||
@@ -217,7 +217,7 @@ and https://github.com/mikf/gallery-dl/graphs/contributors
|
|||||||
content.append(strip_rst(text, field != "Example"))
|
content.append(strip_rst(text, field != "Example"))
|
||||||
|
|
||||||
if not path:
|
if not path:
|
||||||
path = util.path("gallery-dl.conf.5")
|
path = util.path("build/man/gallery-dl.conf.5")
|
||||||
with open(path, "w", encoding="utf-8") as file:
|
with open(path, "w", encoding="utf-8") as file:
|
||||||
file.write(TEMPLATE.lstrip() % {
|
file.write(TEMPLATE.lstrip() % {
|
||||||
"options": "\n".join(content),
|
"options": "\n".join(content),
|
||||||
|
|||||||
@@ -8,4 +8,6 @@ sys.path.insert(0, os.path.realpath(ROOTDIR))
|
|||||||
|
|
||||||
|
|
||||||
def path(*segments, join=os.path.join):
|
def path(*segments, join=os.path.join):
|
||||||
return join(ROOTDIR, *segments)
|
result = join(ROOTDIR, *segments)
|
||||||
|
os.makedirs(os.path.dirname(result), exist_ok=True)
|
||||||
|
return result
|
||||||
|
|||||||
6
setup.py
6
setup.py
@@ -36,9 +36,9 @@ VERSION = re.search(
|
|||||||
FILES = [
|
FILES = [
|
||||||
(path, [f for f in files if check_file(f)])
|
(path, [f for f in files if check_file(f)])
|
||||||
for (path, files) in [
|
for (path, files) in [
|
||||||
('etc/bash_completion.d', ['gallery-dl.bash_completion']),
|
("share/bash-completion/completions", ["build/completion/gallery-dl"]),
|
||||||
('share/man/man1' , ['gallery-dl.1']),
|
("share/man/man1" , ["build/man/gallery-dl.1"]),
|
||||||
('share/man/man5' , ['gallery-dl.conf.5']),
|
("share/man/man5" , ["build/man/gallery-dl.conf.5"]),
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user