File: rules

package info (click to toggle)
cogito 0.18.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 176 kB
  • ctags: 3
  • sloc: makefile: 48
file content (62 lines) | stat: -rwxr-xr-x 1,753 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
#!/usr/bin/make -f

VERSION =$(shell head -n1 debian/changelog |sed -e 's/.*(\(.*\)-.*).*/\1/')

OPTS =prefix=/usr

DIR =$(shell pwd)/debian/cogito

unpack: deb-checkdir unpack-stamp
unpack-stamp:
	tar xzf cogito-'$(VERSION)'.tar.gz
	rm -f cogito
	ln -s cogito-'$(VERSION)' cogito
	for i in `ls -t debian/diff/*.diff || :`; do \
	  (cd cogito && patch -p1) <$$i || exit 1; \
	done
	touch unpack-stamp

build: deb-checkdir build-stamp
build-stamp: unpack-stamp
	-gcc -v
	$(MAKE) -Ccogito all test doc $(OPTS)
	touch build-stamp

clean: deb-checkdir deb-checkuid
	rm -rf cogito-'$(VERSION)' cogito
	rm -f unpack-stamp build-stamp
	rm -rf '$(DIR)'
	rm -f debian/files changelog

install: install-indep
install-indep: deb-checkdir deb-checkuid build-stamp
	rm -rf '$(DIR)'
	mkdir -p '$(DIR)'/usr
	$(MAKE) -Ccogito install $(OPTS) DESTDIR='$(DIR)'
	# man pages
	mkdir -p '$(DIR)'/usr/share/man/man1
	mkdir -p '$(DIR)'/usr/share/man/man7
	install -m0644 cogito/Documentation/*.1 \
	  '$(DIR)'/usr/share/man/man1/
	gzip -9 '$(DIR)'/usr/share/man/man1/*.1
	install -m0644 cogito/Documentation/*.7 \
	  '$(DIR)'/usr/share/man/man7/
	gzip -9 '$(DIR)'/usr/share/man/man7/*.7
	# man pages for deprecated programs
	ln -s cg-reset.1.gz '$(DIR)'/usr/share/man/man1/cg-cancel.1.gz
	ln -s cg-fetch.1.gz '$(DIR)'/usr/share/man/man1/cg-pull.1.gz
	for i in cg-commit-id cg-parent-id cg-tree-id commit-id parent-id \
	 tree-id; do \
	  ln -s cg-object-id.1.gz '$(DIR)'/usr/share/man/man1/$$i.1.gz; \
	done
	# no upstream changelog
	cp /dev/null changelog

binary: binary-indep
binary-indep: install-indep cogito.deb
	dpkg-gencontrol -isp -pcogito -P'$(DIR)'
	dpkg -b '$(DIR)' ..

.PHONY: unpack build clean install install-indep binary binary-indep

include debian/implicit