1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
12 include /usr/share/quilt/quilt.make
14 export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
16 PACKAGE = compiz
18 CFLAGS = -Wall -g
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20 CFLAGS += -O0
21 else
22 CFLAGS += -O2
23 endif
24 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
25 INSTALL_PROGRAM += -s
26 endif
28 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
29 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
30 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
31 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
32 confflags += --build=$(DEB_HOST_GNU_TYPE)
33 else
34 confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
35 endif
37 INSTALL = /usr/bin/install
39 confflags += --disable-static \
40 --disable-fuse \
41 --disable-kde \
42 --enable-kde4 \
43 --enable-librsvg \
44 --enable-gconf \
45 --enable-gconf-dump
47 # the following files are modified in the build process, but shouldn't be.
48 # UPSTREAM_PRESERVE:=po/Makefile.in.in
50 # the following are generated by autoconf and have no way of being deleted
51 # gracefully.
52 AUTOFOO_DELETE:=aclocal.m4 config.guess config.h.in config.sub configure \
53 depcomp install-sh intltool-extract.in intltool-merge.in \
54 intltool-update.in ltmain.sh missing mkinstalldirs \
55 Makefile.in gtk/Makefile.in gtk/gnome/Makefile.in \
56 gtk/window-decorator/Makefile.in images/Makefile.in \
57 include/Makefile.in kde/Makefile.in \
58 kde/window-decorator/Makefile.in libdecoration/Makefile.in \
59 metadata/Makefile.in plugins/Makefile.in po/Makefile.in.in \
60 src/Makefile.in kde/window-decorator-kde4/Makefile.in
62 # brief shorthand for cleaner rules below
63 DESTDIR:=$(CURDIR)/debian/tmp
65 build: build-stamp
66 build-stamp: $(QUILT_STAMPFN)
67 dh_testdir
68 for f in $(UPSTREAM_PRESERVE); do \
69 cp -a $$f $$f.preserve; \
70 done
71 autoreconf -vi
72 intltoolize --copy --force --automake
73 ./configure --prefix=/usr --sysconfdir=\$${prefix}/share $(confflags) \
74 CFLAGS="$(CFLAGS)" QTDIR=/usr
75 $(MAKE)
76 touch $@
78 unpatch: distclean
80 distclean:
81 [ ! -f Makefile ] || $(MAKE) distclean
83 clean: unpatch
84 dh_testdir
85 dh_testroot
86 rm -f po/*.gmo
87 rm -f build-stamp
88 rm -f $(AUTOFOO_DELETE)
89 for f in $(UPSTREAM_PRESERVE); do \
90 if [ -f $$f.preserve ]; then \
91 cp -a $$f.preserve $$f; rm -f $$f.preserve; \
92 fi; \
93 done
94 dh_clean
96 install: build
97 dh_testdir
98 dh_testroot
99 dh_clean -k
100 dh_installdirs
101 $(MAKE) DESTDIR=$(DESTDIR) install
102 mv $(DESTDIR)/usr/bin/compiz $(DESTDIR)/usr/bin/compiz.real
103 $(INSTALL) --mode 0755 debian/compiz-manager $(DESTDIR)/usr/bin/compiz
104 # remove unneeded .la files
105 find $(DESTDIR)/usr/lib -type f -name '*.la' | xargs rm -f
107 # Build architecture-dependent files here.
108 binary-arch: build install
109 dh_testdir
110 dh_testroot
112 dh_installdocs
113 dh_installchangelogs ChangeLog
114 dh_install --sourcedir=$(DESTDIR) --fail-missing
115 # the gconf and kconfig plugins are seperately installed into
116 # the -gnome and -kde packages respectively
117 rm -f $(CURDIR)/debian/tmp/usr/lib/compiz/libkconfig.so
118 rm -f $(CURDIR)/debian/compiz-plugins/usr/lib/compiz/libkconfig.so
119 rm $(CURDIR)/debian/tmp/usr/lib/compiz/libgconf.so
120 rm $(CURDIR)/debian/compiz-plugins/usr/lib/compiz/libgconf.so
121 dh_installman
122 dh_link
123 dh_gconf
124 dh_strip
125 dh_compress
126 dh_fixperms
127 dh_makeshlibs -plibdecoration0 -V'libdecoration0 (>= 0.8.2)'
128 dh_shlibdeps
129 dh_installdeb
130 dh_gencontrol
131 dh_md5sums
132 dh_builddeb
134 # Build architecture-independent files here.
135 binary-indep: build install
136 # Nothing to do
138 binary: binary-indep binary-arch
139 .PHONY: build clean binary-indep binary-arch binary install
