#!/usr/bin/make -f # # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PACKAGE:= alsa-lib #include /usr/share/quilt/quilt.make export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) biarch_map := i386=amd64 powerpc=ppc64 sparc=sparc64 s390=s390x \ amd64=i386 # ppc64=powerpc biarch_cpu := $(strip $(patsubst $(DEB_BUILD_ARCH_CPU)=%, %, \ $(filter $(DEB_BUILD_ARCH_CPU)=%, $(biarch_map)))) ifneq (,$(biarch_cpu)) ifneq (,$(findstring /$(DEB_HOST_ARCH)/, /i386/powerpc/sparc/s390/)) bi = 64 bilibdir = usr/lib64 endif #ifneq (,$(findstring /$(DEB_HOST_ARCH)/, /amd64/ppc64/)) ifneq (,$(findstring /$(DEB_HOST_ARCH)/, /amd64/)) bi = 32 bilibdir = usr/lib32 ifeq ($(DEB_HOST_ARCH),amd64) # amd64 unstable only! bilibdir = usr/lib32 endif endif ifneq (,$(bi)) configure_biarch_stamp = configure-biarch-stamp build_biarch_stamp = build-biarch-stamp BIARCH_CC = gcc -m$(bi) dpkg_ctrl_args = -- '-Vbilib:depends=libc6-$(biarch_cpu)' \ '-Vbidev:depends=libc6-dev-$(biarch_cpu)' endif endif CFLAGS = -g -Wall -D_GNU_SOURCE ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif configure-stamp: $(configure_biarch_stamp) dh_testdir -rm -f config.sub config.guess ln -s /usr/share/misc/config.sub config.sub ln -s /usr/share/misc/config.guess config.guess ./configure --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --datadir=\$${prefix}/share \ --build $(DEB_BUILD_GNU_TYPE) \ --enable-static --disable-maintainer-mode \ --with-plugindir=/usr/lib/alsa-lib touch configure-stamp configure-biarch-stamp: dh_testdir -rm -f config.sub config.guess ln -s /usr/share/misc/config.sub config.sub ln -s /usr/share/misc/config.guess config.guess rm -rf bibuild mkdir bibuild mkdir bibuild/include cd bibuild && CC="$(BIARCH_CC)" ../configure --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --datadir=\$${prefix}/share \ --build $(DEB_BUILD_GNU_TYPE) \ --enable-static --disable-maintainer-mode \ --disable-python --with-plugindir=/$(bilibdir)/alsa-lib #ln -sf . include/alsa rm -f bibuild/include/alsa ln -s . bibuild/include/alsa sed -e '/^SUBDIRS/s/doc//' bibuild/Makefile > bibuild/Makefile.new mv bibuild/Makefile bibuild/Makefile.old mv bibuild/Makefile.new bibuild/Makefile touch -r bibuild/Makefile.old bibuild/Makefile touch configure-biarch-stamp configure: configure-stamp $(configure_biarch_stamp) build-arch-stamp: configure-stamp dh_testdir $(MAKE) CFLAGS="$(CFLAGS)" touch build-arch-stamp build-biarch-stamp: configure-biarch-stamp dh_testdir $(MAKE) -C bibuild touch build-biarch-stamp build-arch: $(build_biarch_stamp) build-arch-stamp build-indep-stamp: build-arch-stamp dh_testdir $(MAKE) doc CFLAGS="$(CFLAGS)" touch build-indep-stamp build-indep: build-indep-stamp build: build-arch build-indep install-arch: build-arch-stamp dh_testdir dh_testroot dh_prep -s $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp mkdir -p $(CURDIR)/debian/tmp/usr/share/alsa/ucm cp -r $(CURDIR)/debian/ucm/SDP4430 \ $(CURDIR)/debian/tmp/usr/share/alsa/ucm ifneq (,$(build_biarch_stamp)) rm -rf debian/bitmp $(MAKE) -C bibuild/src install DESTDIR=$(CURDIR)/debian/bitmp $(MAKE) -C bibuild/modules install DESTDIR=$(CURDIR)/debian/bitmp mkdir -p debian/lib$(bi)asound2/$(bilibdir)/alsa-lib/smixer/ cp -a debian/bitmp/usr/lib/libasound.so.* \ debian/lib$(bi)asound2/$(bilibdir)/ cp -a debian/bitmp/$(bilibdir)/alsa-lib/smixer/*.so \ debian/lib$(bi)asound2/$(bilibdir)/alsa-lib/smixer/ mkdir -p debian/lib$(bi)asound2-dev/$(bilibdir)/alsa-lib/smixer # mkdir -p debian/lib$(bi)asound2-dev/$(bilibdir)/pkgconfig cp -a \ debian/bitmp/usr/lib/libasound.so \ debian/bitmp/usr/lib/libasound.a \ debian/lib$(bi)asound2-dev/$(bilibdir)/ sed -e "/^libdir=/s,=.*,='/$(bilibdir)',;s,^dependency_libs=.*,dependency_libs=''," \ debian/bitmp/usr/lib/libasound.la \ > debian/lib$(bi)asound2-dev/$(bilibdir)/libasound.la mkdir -p debian/lib$(bi)asound2/etc/ld.so.conf.d echo "/$(bilibdir)/alsa-lib" > debian/lib$(bi)asound2/etc/ld.so.conf.d/lib$(bi)asound2.conf # sed -e "/^libdir=.*lib$$/s,=.*,=/$(bilibdir)," \ # debian/bitmp/usr/lib/pkgconfig/alsa.pc \ # > debian/lib$(bi)asound2-dev/$(bilibdir)/pkgconfig/alsa.pc else sed -ie "s,^dependency_libs=.*,dependency_libs=''," \ debian/tmp/usr/lib/libasound.la endif mkdir -p debian/libasound2/etc/ld.so.conf.d echo "/usr/lib/alsa-lib" > debian/libasound2/etc/ld.so.conf.d/libasound2.conf dh_installdirs -s dh_install -s dh_installdocs -plibasound2 dh_installexamples -s doc/asoundrc.txt dh_installchangelogs -plibasound2 debian/changelog.ALSA dh_strip -s dh_link -s dh_compress -s dh_fixperms -s install-indep: build-indep-stamp dh_testdir dh_testroot dh_prep -i $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp dh_installdirs -i dh_install -i dh_installdocs -i dh_installexamples -i dh_installchangelogs -plibasound2-doc debian/changelog.ALSA cp -r doc/doxygen/html debian/libasound2-doc/usr/share/doc/libasound2-doc dh_compress -i dh_fixperms -i binary-arch: build-arch-stamp install-arch dh_makeshlibs -plibasound2 -V'libasound2 (>> 1.0.24.1)' --exclude=usr/lib/alsa-lib/smixer ifneq (,$(build_biarch_stamp)) dh_makeshlibs -plib$(bi)asound2 -V'lib$(bi)asound2 (>> 1.0.24.1)' --exclude=usr/lib$(bi)/alsa-lib/smixer endif dh_installdeb -s #dh_shlibdeps -s -Nlib64asound2 dh_shlibdeps -s dh_gencontrol -s dh_md5sums -s dh_builddeb -s binary-indep: build-indep-stamp install-indep dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary: binary-arch binary-indep clean: dh_testdir dh_testroot #-$(MAKE) distclean [ ! -f Makefile ] || $(MAKE) distclean -rm -f *-stamp rm -f config.sub config.guess config.status config.cache -rm -rf doc/doxygen rm -rf bibuild debian/bitmp -rm -f include/alsa dh_clean .PHONY: configure build-arch build-indep build install-arch install-indep binary-arch binary-indep binary clean stamp-patched