File: rules

package info (click to toggle)
keytouch 2.3.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,480 kB
  • ctags: 1,475
  • sloc: ansic: 9,591; sh: 4,008; makefile: 466; perl: 75
file content (160 lines) | stat: -rwxr-xr-x 4,677 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpatch/dpatch.make
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
    SYSTEM = --build $(DEB_HOST_GNU_TYPE)
else
    SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

LDFLAGS += -Wl,--as-needed
CFLAGS = -Wall -g
CONFFLAGS = $(SYSTEM) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --libdir=\$${prefix}/lib

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

config-stamp: patch-stamp configure
	dh_testdir

	# Some distributed files are modified or removed
	# by configure or upstream's clean and they shouldn't. 
	# We save copies now, to restore
	# them, else some patches won't work, the clean target will be dirty,
	# mayhem ensues ...
	-find . \( -name config.h \
		-o -name Makefile.in \) \
	  -execdir cp \{} \{}.debian-orig \; -fprint dist-files	

	# Use updated files from autotools-dev
	rm -f config.sub && ln -sf /usr/share/misc/config.sub .
	rm -f config.guess && ln -sf /usr/share/misc/config.guess .
	rm -f keytouch-config/config.sub &&\
	  ln -sf /usr/share/misc/config.sub keytouch-config/config.sub
	rm -f keytouch-config/config.guess &&\
	  ln -sf /usr/share/misc/config.guess keytouch-config/config.guess
	rm -f keytouch-keyboard/config.sub &&\
	  ln -sf /usr/share/misc/config.sub keytouch-keyboard/config.sub
	rm -f keytouch-keyboard/config.guess &&\
	  ln -sf /usr/share/misc/config.guess keytouch-keyboard/config.guess

	# Configure the package.
	                        CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFFLAGS) 
	cd keytouch-config   && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFFLAGS)  
	cd keytouch-keyboard && CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFFLAGS)  
	touch config-stamp

build: build-stamp

build-stamp:  config-stamp
	dh_testdir

	# Compile the package.
	$(MAKE)
	cd keytouch-config && $(MAKE)
	cd keytouch-keyboard && $(MAKE)

	touch build-stamp

clean: 
	dh_testdir
	dh_testroot
	rm -f build-stamp config-stamp 

	# Clean up after the build process.
	if [ -f Makefile ]; then \
	  $(MAKE) distclean ;\
	  cd keytouch-config && $(MAKE) distclean && cd ..; \
	  cd keytouch-keyboard && $(MAKE) distclean; \
	fi

	# Get saved files back
	if [ -e dist-files ] ; then \
	  for f in `cat dist-files`; do \
	    rm -f $$f; \
            mv $$f.debian-orig $$f; \
          done; \
	  rm dist-files; \
	fi

	rm -f config.guess
	rm -f config.sub
	rm -f keytouch-config/config.guess
	rm -f keytouch-config/config.sub
	rm -f keytouch-keyboard/config.guess
	rm -f keytouch-keyboard/config.sub

	dh_clean
	$(MAKE) -f debian/rules unpatch

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

	# Install the package into debian/keytouch.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/keytouch
	cd $(CURDIR)/keytouch-config && $(MAKE) install DESTDIR=$(CURDIR)/debian/keytouch
	cd $(CURDIR)/keytouch-keyboard && $(MAKE) install DESTDIR=$(CURDIR)/debian/keytouch

	cd debian/keytouch/usr/share/keytouch/pixmaps && convert icon.png icon.xpm

	# Move arch-indep files into -data
	mv debian/keytouch/usr/share/keytouch/doc/html \
	  debian/keytouch-data/usr/share/doc/keytouch-data
	rmdir debian/keytouch/usr/share/keytouch/doc
	mv debian/keytouch/usr/share/keytouch/keyboards \
	  debian/keytouch-data/usr/share/keytouch

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installexamples -i
	dh_installchangelogs -i ChangeLog
	dh_installdocs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install -a
	dh_installmenu -a
	dh_desktop -a
	dh_installinit -a
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a 
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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