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
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
CONFIGFLAG = --build $(DEB_HOST_GNU_TYPE)
else
CONFIGFLAG = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS = -g -Wall -O0
else
CFLAGS = -g -Wall -O2
endif
BUILDDIR=debian/BUILD
AUTOTOOLS_TGZ=$(BUILDDIR)/autotools.tgz
NCPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
ifeq ($(NCPUS),-1)
NCPUS:=1
endif
ifeq ($(NCPUS),0)
NCPUS:=1
endif
CFLAGS = -Wall -g
ifeq ($(DEB_BUILD_ARCH_OS),linux)
CONFIGFLAG += --enable-v4l
else
CONFIGFLAG += --enable-bktr
endif
build: configure $(BUILDDIR)/build-stamp
configure: $(AUTOTOOLS_TGZ) patch $(BUILDDIR)/configure-stamp
include /usr/share/quilt/quilt.make
$(AUTOTOOLS_TGZ): $(QUILT_STAMPFN)
find . ! -path '*debian*' ! -path '*$(BUILDDIR)*' ! -path '*/.*' -type d \
-exec mkdir -p $(BUILDDIR)/{} \;
tar cvzf "$@".tmp config.sub config.guess help/man/*.1
ln -fs /usr/share/misc/config.sub config.sub
ln -fs /usr/share/misc/config.guess config.guess
rm -f help/man/*.1
mv "$@".tmp "$@"
$(AUTOTOOLS_TGZ)-clean:
[ ! -f $(AUTOTOOLS_TGZ) ] || { tar xvzf $(AUTOTOOLS_TGZ) && rm $(AUTOTOOLS_TGZ) ; }
$(BUILDDIR)/configure-stamp: $(AUTOTOOLS_TGZ)
dh_testdir
automake-1.9 --ignore-deps -f -o $(BUILDDIR)
cd $(BUILDDIR) && LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" \
$(CURDIR)/configure \
--prefix=/usr \
$(CONFIGFLAG) \
--datadir=\$${prefix}/share \
--mandir=\$${prefix}/share/man \
--x-libraries=/usr/X11R6/lib \
--enable-pam \
--x-includes=/usr/X11R6/include \
--with-gconf-schema-file-dir=\$${prefix}/share/gconf/schemas
mv $(BUILDDIR)/libtool $(BUILDDIR)/libtool.old
sed -e '/^archive_cmds/{ s/="\\$$CC -shared /&$${wl}--as-needed /;s/ [^ ]*soname[^ ]*/ /g; }' < \
$(BUILDDIR)/libtool.old > $(BUILDDIR)/libtool
chmod 755 $(BUILDDIR)/libtool
@echo "Config variables:"
sed -ne "s/^#define \(.*\) 1 *$$/ \1/p" $(BUILDDIR)/config.h
touch "$@"
$(BUILDDIR)/build-stamp: $(BUILDDIR)/configure-stamp
dh_testdir
cd $(BUILDDIR) && $(MAKE) -j $(NCPUS) LDFLAGS+="$(LDFLAGS)"
touch "$@"
clean: unpatch $(AUTOTOOLS_TGZ)-clean
dh_testdir
dh_testroot
rm -rf $(BUILDDIR)
dh_clean help/C/zapping-C.omf.out intltool-extract intltool-merge \
intltool-update po/.intltool-merge-cache site_def.h zapping.desktop \
libvbi/fontgen
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs usr/sbin usr/share/lintian/overrides
cd $(BUILDDIR) && GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 $(MAKE) install \
LDFLAGS+="$(LDFLAGS)" DESTDIR=$(CURDIR)/debian/zapping
rm debian/zapping/usr/lib/zapping/plugins/*.la
# Install lintian override file
cp debian/lintian debian/zapping/usr/share/lintian/overrides/zapping
# Install xpm icon
cp debian/gnome-television.xpm debian/zapping/usr/share/pixmaps/zapping
# Install the schemas file
# cp zapping.schemas debian/zapping/usr/share/gconf/schemas
# Build architecture-independent files here.
binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_buildinfo
dh_installdocs README README.plugins TODO BUGS NEWS
dh_installmenu
# dh_installman
dh_scrollkeeper
dh_installchangelogs ChangeLog
dh_gconf
dh_link
dh_strip
dh_compress
dh_fixperms -Xzapping_setup_fb
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install $(AUTOTOOLS_TGZ)-clean configure
|