forked from Distrotech/pycups
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
50 lines (39 loc) · 1.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
PYTHON=python3
NAME=pycups
VERSION:=$(shell $(PYTHON) setup.py --version)
SDIST_ARGS=--formats=gztar -d.
RPMCONFIGDIR:=$(shell rpm -E "%{_rpmconfigdir}" 2>/dev/null || :)
SOURCES=cupsmodule.c cupsconnection.c cupsppd.c cupsipp.c setup.py \
cupsppd.h cupsipp.h cupsconnection.h cupsmodule.h \
psdriver.attr postscriptdriver.prov
DIST=Makefile test.py \
examples \
COPYING NEWS README TODO
cups.so: force
$(PYTHON) setup.py build
ln -sf build/lib*/$@ .
doc: cups.so
rm -rf html
$(PYTHON) -m pydoc -w cups
mkdir html
mv cups.html html
doczip: doc
cd html && zip ../cups-html.zip *
clean:
-rm -rf build cups.so html *.pyc *~ __pycache__
dist:
$(PYTHON) setup.py sdist $(SDIST_ARGS)
upload:
$(PYTHON) setup.py sdist $(SDIST_ARGS) upload -s
install: install-rpmhook
ROOT= ; \
if [ -n "$$DESTDIR" ]; then ROOT="--root $$DESTDIR"; fi; \
$(PYTHON) setup.py install --skip-build $$ROOT
install-rpmhook:
if [ -n "$(RPMCONFIGDIR)" ]; then \
RPMCONFIG="$$DESTDIR$(RPMCONFIGDIR)" ; \
mkdir -p "$$RPMCONFIG"/fileattrs ; \
install -m0644 psdriver.attr "$$RPMCONFIG"/fileattrs/ ; \
install -m0755 postscriptdriver.prov "$$RPMCONFIG"/ ; \
fi
.PHONY: doc doczip clean dist install install-rpmhook force