File: Makefile

package info (click to toggle)
rpmlint 1.9-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 22,212 kB
  • ctags: 722
  • sloc: python: 14,926; makefile: 63; sh: 49
file content (76 lines) | stat: -rw-r--r-- 2,244 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#############################################################################
# File		: Makefile
# Package	: rpmlint
# Author	: Frederic Lepied
# Created on	: Mon Sep 30 13:20:18 1999
# Purpose	: rules to manage the files.
#############################################################################

BINDIR=/usr/bin
LIBDIR=/usr/share/rpmlint
ETCDIR=/etc
MANDIR=/usr/share/man

FILES = rpmlint *.py INSTALL README.md README.devel COPYING tools/*.py \
	Makefile config rpmdiff rpmdiff.1 rpmlint.bash-completion rpmlint.1 \
	test.sh test/*/*.rpm test/spec/*.spec test/*.py
GENERATED = __version__.py

PACKAGE = rpmlint
PYTHON = /usr/bin/python

# update this variable to create a new release
VERSION := 1.9

# for the [A-Z]* part
LC_ALL:=C
export LC_ALL

all: __version__.py __isocodes__.py

clean:
	rm -rf *~ *.py[co] */*.py[co] __pycache__ */__pycache__ $(GENERATED)

install: all
	mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(ETCDIR)/$(PACKAGE) $(DESTDIR)$(MANDIR)/man1
	cp -p *.py $(DESTDIR)$(LIBDIR)
	if [ "x${COMPILE_PYC}" = "x1" ] ; then \
		$(PYTHON) -m py_compile \
			$(DESTDIR)$(LIBDIR)/[A-Z]*.py \
			$(DESTDIR)$(LIBDIR)/__*__.py ; \
	fi
	$(PYTHON) -O -m py_compile \
		$(DESTDIR)$(LIBDIR)/[A-Z]*.py \
		$(DESTDIR)$(LIBDIR)/__*__.py ; \
	for file in rpmlint rpmdiff ; do \
		sed -e "s,#!/usr/bin/python ,#!$(PYTHON) ," $$file > $(DESTDIR)$(BINDIR)/$$file ; \
		chmod +x $(DESTDIR)$(BINDIR)/$$file ; \
	done
	cp -p config $(DESTDIR)$(ETCDIR)/$(PACKAGE)
	compdir=`pkg-config --variable=completionsdir bash-completion 2>/dev/null` ; \
	if [ "x$$compdir" = "x" ] ; then \
		mkdir -p $(DESTDIR)$(ETCDIR)/bash_completion.d ; \
		cp -p rpmlint.bash-completion $(DESTDIR)$(ETCDIR)/bash_completion.d/rpmlint ; \
	else \
		mkdir -p $(DESTDIR)$$compdir ; \
		cp -p rpmlint.bash-completion $(DESTDIR)$$compdir/rpmlint ; \
		ln -sf rpmlint $(DESTDIR)$$compdir/rpmdiff ; \
	fi
	cp -p rpmdiff.1 rpmlint.1 $(DESTDIR)$(MANDIR)/man1

verify:
	pychecker --limit=100 [A-Z]*.py __*__.py

check:
	./test.sh

__version__.py: Makefile
	echo "# Automatically generated, do not edit" > $@
	echo "__version__ = '$(VERSION)'" >> $@

__isocodes__.py:
	tools/generate-isocodes.py > $@

.PHONY: all clean install verify check

# Makefile ends here