2 # debian/rules for the Debian mesa package
3 # Copyright © 2006 Thierry Reding <thierry@gilfi.de>
5 # Uncomment this to turn on verbose mode.
10 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
17 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
19 MAKEFLAGS += -j$(NUMJOBS)
22 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
23 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
24 DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
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 DEB_BUILD_DIR ?= $(CURDIR)/build
28 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
29 confflags += --build=$(DEB_HOST_GNU_TYPE)
31 confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
34 # keep a list of files we don't install (yet), but since it's a bit
35 # large, use an external file:
36 include debian/not-installed
38 # build the following configurations by default
41 include /usr/share/quilt/quilt.make
47 --disable-driglx-direct \
49 CXXFLAGS="$(CXXFLAGS)"
52 GALLIUM_DRIVERS = swrast
55 --disable-gallium-gbm \
56 --disable-gallium-llvm \
57 --without-dri-drivers \
58 --with-driver=osmesa \
59 --with-egl-driver-dir=/usr/lib \
60 --with-gallium-drivers=swrast \
61 --with-egl-platforms=x11 \
62 --enable-gallium-egl \
69 configure: configure.ac
72 # list the configurations that will built
74 @echo Building the following configurations: $(CONFIGS)
79 mkdir -p $(DEB_BUILD_DIR)/$(CONFIGS)
80 find $(CURDIR)/* -maxdepth 0 -not -path '$(DEB_BUILD_DIR)*' | \
81 xargs cp -rlf -t $(DEB_BUILD_DIR)/$(CONFIGS)
83 cd $(DEB_BUILD_DIR)/$(CONFIGS) && \
84 ../../configure --prefix=/usr --mandir=\$${prefix}/share/man \
85 --infodir=\$${prefix}/share/info --sysconfdir=/etc \
86 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
87 --localstatedir=/var $(confflags) $(confflags-$(CONFIGS))
88 cd $(DEB_BUILD_DIR)/$(CONFIGS) && $(MAKE)
91 # Add here commands to install the package into debian/tmp
96 set -e; for config in $(filter-out dri, $(CONFIGS)); do \
97 $(MAKE) -C $(DEB_BUILD_DIR)/$$config DESTDIR=$(CURDIR)/debian/tmp install; \
100 for file in debian/*.in; \
102 sed -e"s,\$${DEB_HOST_MULTIARCH},$(DEB_HOST_MULTIARCH),g" \
103 $${file} > $${file%%.in}; \
110 rm -f config.cache config.log config.status
111 rm -f */config.cache */config.log */config.status
112 rm -f conftest* */conftest*
113 rm -rf autom4te.cache */autom4te.cache
115 rm -rf configure config.guess config.sub config.h.in
116 rm -rf $$(find -name Makefile.in)
117 rm -rf aclocal.m4 missing depcomp install-sh ltmain.sh
118 for file in debian/*.in; do rm -f $${file%%.in}; done
122 # Build architecture-independent files here.
123 binary-indep: install
125 allpkg = $(shell dh_listpackages -s)
126 dbgpkg = $(filter %-dbg, $(allpkg))
127 otherpkg = $(filter-out %-dbg, $(allpkg))
128 havedbgpkg = $(patsubst %-dbg,%,$(dbgpkg))
129 nodbgpkg = $(filter-out $(havedbgpkg),$(otherpkg))
131 # Build architecture-dependent files here.
135 dh_installchangelogs -s
136 dh_installchangelogs -pmesa-common-dev
138 dh_installexamples -s
140 dh_install --sourcedir=debian/tmp
144 # Install bug control and script:
145 set -e; for p in $(allpkg); do \
146 install -d debian/$$p/usr/share/bug/$$p && \
147 install -m 644 debian/local/control debian/$$p/usr/share/bug/$$p && \
148 install -m 755 debian/local/script debian/$$p/usr/share/bug/$$p; \
150 set -e; for p in $(havedbgpkg); do \
151 dh_strip -p$${p} --dbg-package=$${p}-dbg; \
154 # dh_strip -s --remaining-packages doesn't work with resumed
155 # builds (see changelog for mesa 7.10-1):
156 dh_strip $(foreach p,$(nodbgpkg),-p$(p))
160 LD_LIBRARY_PATH=/usr/lib/mesa-gl dh_shlibdeps -s
163 dh_builddeb $(foreach pkg,$(dbgpkg),-p$(pkg))
164 dh_builddeb $(foreach pkg,$(otherpkg),-p$(pkg))
166 binary: binary-indep binary-arch
167 .PHONY: configs build clean binary-indep binary-arch binary install
169 # For maintainer use only, generate a tarball:
170 gentarball: SOURCE=mesa
171 gentarball: UV=$(shell dpkg-parsechangelog|awk '/^Version:/ {print $$2}'|sed 's/-.*$$//')
173 git archive --format=tar upstream-experimental --prefix=$(SOURCE)-$(UV)/ | gzip -9 > ../$(SOURCE)_$(UV).orig.tar.gz