File: rules

package info (click to toggle)
less 332-4.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 952 kB
  • ctags: 1,145
  • sloc: ansic: 13,030; sh: 185; makefile: 116; awk: 7
file content (61 lines) | stat: -rwxr-xr-x 1,783 bytes parent folder | download | duplicates (2)
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
#! /usr/bin/make -f
# debian.rules file - for patch

package = less

PWD    := $(shell pwd)
DOCDIR  = debian/tmp/usr/doc/$(package)
PREFIX  = /usr
INST_PREFIX = debian/tmp/usr
MAN1DIR = $(INST_PREFIX)/man/man1

EDITOR  = \\\"/usr/bin/editor\\\"
CFLAGS  = -O2 -DEDIT_PGM=$(EDITOR)
LDFLAGS = -s

conf:
	./configure --prefix=$(PREFIX)
	touch conf

build less lesskey: conf
	make CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS=-lncurses datadir=$(PREFIX)/lib
	strip -s less lesskey

binary-indep:
	true
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: less lesskey
	-[ -d debian/tmp ] && rm -rf debian/tmp
	install -d debian/tmp/DEBIAN
	install -d $(DOCDIR)
	install -m 0644 NEWS $(DOCDIR)/changelog
	install -m 0644 debian/changelog $(DOCDIR)/changelog.Debian
	install -m 0644 debian/LESSOPEN $(DOCDIR)
	make install prefix=$(PWD)/$(INST_PREFIX)
	gzip -9rf $(DOCDIR) $(MAN1DIR) || true
	install -m 0755 debian/lessopen $(INST_PREFIX)/bin/lesspipe
	ln -s lesspipe $(INST_PREFIX)/bin/lessfile
	ln -s ../man7/undocumented.7.gz $(MAN1DIR)/lesspipe.1.gz
	ln -s ../man7/undocumented.7.gz $(MAN1DIR)/lessfile.1.gz
	ln -s ../man7/undocumented.7.gz $(MAN1DIR)/lessecho.1.gz
	install -m 0644 debian/copyright $(DOCDIR)
	install -m 0755 debian/postinst debian/prerm debian/tmp/DEBIAN
	chmod -R go=rX $(DOCDIR)
	dpkg-shlibdeps $(INST_PREFIX)/bin/$(package)
	dpkg-gencontrol
	chmod 644 debian/tmp/DEBIAN/control
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

clean:
	-rm -f conf debian/files debian/substvars *~ debian/*~
	-[ -d debian/tmp ] && rm -rf debian/tmp
	-make distclean

.PHONY: binary binary-arch binary-indep clean