Clean up spec file for packaging.
[profile/ivi/xorg-drv-evdev.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian xserver-xorg-input-evdev package.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
4 # Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
5 # Copyright © 2005 David Nusinow <dnusinow@debian.org>
6
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
9
10 include debian/xsfbs/xsfbs.mk
11
12 CFLAGS = -Wall -g -D_F_INIT_ABS_ONLY_FOR_POINTER_
13 LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed
14 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -O0
16 else
17         CFLAGS += -O2
18 endif
19 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
20         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21         MAKEFLAGS += -j$(NUMJOBS)
22 endif
23
24 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
25 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
26 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
27 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
28         confflags += --build=$(DEB_HOST_GNU_TYPE)
29 else
30         confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
31 #       confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
32 endif
33
34 # kbd_drv.a isn't phenomenally useful; kbd_drv.so more so
35 confflags += --disable-static
36
37 #configure: $(STAMP_DIR)/patch
38 configure:
39         autoreconf -vfi
40         #./autogen.sh
41
42 obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
43         mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
44         cd obj-$(DEB_BUILD_GNU_TYPE) && \
45         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
46                      --infodir=\$${prefix}/share/info $(confflags) \
47                      CFLAGS="$(CFLAGS)"
48
49 build: build-stamp
50 build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
51         dh_testdir
52         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
53         >$@
54
55 clean: xsfclean
56         dh_testdir
57         dh_testroot
58         rm -f build-stamp
59
60         rm -f config.cache config.log config.status
61         rm -f */config.cache */config.log */config.status
62         rm -f conftest* */conftest*
63         rm -rf autom4te.cache */autom4te.cache
64         rm -rf obj-*
65         rm -f $$(find -name Makefile.in)
66         rm -f compile config.guess config.sub configure depcomp install-sh
67         rm -f ltmain.sh missing INSTALL aclocal.m4 ylwrap mkinstalldirs config.h.in
68
69         dh_clean
70
71 install: build
72         dh_testdir
73         dh_testroot
74         dh_clean -k
75         dh_installdirs
76
77         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
78
79 # Build architecture-dependent files here.
80 binary-arch: build install serverabi
81         dh_testdir
82         dh_testroot
83
84         dh_installdocs
85 #       dh_installchangelogs ChangeLog
86         dh_installchangelogs
87         dh_install --sourcedir=debian/tmp --list-missing  --exclude=usr/share/man/man4
88         #dh_install --sourcedir=debian/tmp --list-missing --exclude=evdev_drv.la --exclude=usr/share/man/man4
89 #       install -d debian/xserver-xorg-input-evdev/usr/share/hal/fdi/policy/20thirdparty
90 #       install -m 644 debian/local/10-x11-evdev.fdi debian/xserver-xorg-input-evdev/usr/share/hal/fdi/policy/20thirdparty/
91         dh_installman
92         dh_link
93         dh_strip --dbg-package=xserver-xorg-input-evdev-dbg
94         dh_compress
95         dh_fixperms
96         dh_installdeb
97 #       dh_shlibdeps -- --warnings=6
98         dh_shlibdeps --
99         dh_gencontrol
100         dh_md5sums
101         dh_builddeb
102
103 # Build architecture-independent files here.
104 binary-indep: build install
105 # Nothing to do
106
107 binary: binary-indep binary-arch
108 .PHONY: build clean binary-indep binary-arch binary install