File: rules

package info (click to toggle)
afnix 1.5.2-3.3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,216 kB
  • ctags: 10,587
  • sloc: cpp: 73,617; xml: 28,868; makefile: 3,756; sh: 1,050; lisp: 249
file content (100 lines) | stat: -rwxr-xr-x 2,634 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/make -f
# -*- makefile -*-
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpatch/dpatch.make

CFLAGS = -Wall -g
EMACS_LISP=usr/share/emacs/site-lisp

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

configure: configure-stamp
configure-stamp: patch-stamp
	dh_testdir
	./cnf/bin/afnix-setup -o --prefix=/usr
	touch configure-stamp


build: build-stamp

build-stamp: configure-stamp 
	dh_testdir
	$(MAKE) world
	touch $@

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	[ ! -f Makefile ] || $(MAKE) clean
	rm -rf bld
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

	$(MAKE) PREFIX=$(CURDIR)/debian/afnix/usr SHRDIR=$(CURDIR)/debian/afnix/usr/share ALTDIR=$(CURDIR)/debian/afnix DESTDIR=$(CURDIR)/debian/afnix LIBDIR=$(CURDIR)/debian/afnix/usr/lib/afnix install instdoc
	mkdir -p $(CURDIR)/debian/afnix/$(EMACS_LISP)/afnix
	# Debian-specific placement of emacs lisp add-ins
	mv $(CURDIR)/debian/afnix/etc/afnix $(CURDIR)/debian/afnix/$(EMACS_LISP)
	rmdir $(CURDIR)/debian/afnix/etc

	# Rename man page from e.g. afnix::axc to plain axc (the same as the command name).
	for name in $(CURDIR)/debian/afnix/usr/share/man/man1/*; \
	do \
	    mv $$name `echo $$name | sed 's/::afnix//'`; \
	done

	for name in $(CURDIR)/debian/afnix/usr/share/man/man[2-9]/*; \
	do \
	    mv $$name `echo $$name | sed 's%\([^/]*\)::afnix%afnix-\1%'`; \
	done

	# Remove duplicate license files (lintian would complain if it knew about them)
	rm $(CURDIR)/debian/afnix/usr/share/man/man7/afnix-eul.7 $(CURDIR)/debian/afnix/usr/share/doc/afnix/eul.xht

	# Separate documentation package.
	install -d $(CURDIR)/debian/afnix-doc/usr/share/doc
	mv $(CURDIR)/debian/afnix/usr/share/doc/afnix $(CURDIR)/debian/afnix-doc/usr/share/doc

	# Installing linda overrides
	for LINDA in debian/linda/*; \
	do \
		install -D -m 644 $$LINDA debian/`basename $$LINDA`/usr/share/linda/overrides/`basename $$LINDA` || exit 1; \
	done


# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	LD_LIBRARY_PATH=debian/afnix/usr/lib/afnix:$$LD_LIBRARY_PATH dh_shlibdeps debian/tmp/usr/bin/*
	rm -r $(CURDIR)/debian/afnix/usr/include
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb


binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure