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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
|
#!/usr/bin/make -f
# Include dpatch stuff.
include /usr/share/dpatch/dpatch.make
package := em8300
PWD := $(shell pwd)
CFLAGS := -Wall -g
INSTALL_PROGRAM := install -m755
INSTALL_DATA := install -m644
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=4
KERNEL_DEPENDS=n
configure: configure-stamp
configure-stamp: patch-stamp
dh_testdir
# sh bootstrap
CFLAGS="$(CFLAGS)" ./configure --build=$(DEB_BUILD_GNU_TYPE) \
--host=$(DEB_HOST_GNU_TYPE) --prefix=/usr \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info --with-pic \
--with-alsa-dir=/usr/share/alsa
diff include/config.h debian/config.h.good
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
$(MAKE)
touch build-stamp
clean: unpatch
dh_testdir
dh_testroot
rm -f configure-stamp build-stamp install-stamp
rm -f modules.tar.gz
-$(MAKE) distclean
dh_clean
documentation:
perl debian/scripts/dh_docbook
-if [ ! -d debian/sourceforge.html ]; then \
install -d debian/dxr3.sourceforge.net ; \
cd debian/dxr3.sourceforge.net ; \
for f in faq.html howto.html; do \
wget -N --timeout=10 dxr3.sourceforge.net/$$f; \
done; \
cd ../..; \
cp -a debian/dxr3.sourceforge.net debian/sourceforge.html; \
fi
html2text -nobs -o debian/faq.txt debian/sourceforge.html/faq.html
html2text -nobs -o debian/howto.txt debian/sourceforge.html/howto.html
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
install DESTDIR="$(PWD)/debian/tmp"
# install devfsd files
install -o root -g audio -m 644 debian/local/devfs.conf \
debian/em8300/etc/devfs/conf.d/em8300
mv debian/tmp/usr/bin/dhc debian/tmp/usr/bin/em8300-dhc
dh_movefiles
ls debian/em8300/usr/share/em8300/*.pm | xargs chmod a-x
# rename files for proper naming (and to avoid clashes, etc)
mv debian/em8300/usr/share/em8300/microcode_extract.pl \
debian/em8300/usr/bin/em8300-mc_ex
rm debian/em8300/usr/share/em8300/*.pl \
debian/em8300/usr/share/em8300/em8300.pm
rmdir debian/em8300/usr/share/em8300
touch install-stamp
MODULES_DEST=debian/$(package)-source/usr/src/modules/$(package)
srcpkg := $(package)-source
install-source:
dh_testdir
dh_testroot
# install -d $(MODULES_DEST)/debian
perl debian/scripts/dh_modulecontrol
cd modules && \
find . | grep -v '\(CVS\|ldm\|rmm\)' | \
cpio -admpv $(PWD)/$(MODULES_DEST)
cp include/linux/em8300.h $(MODULES_DEST)/
cp debian/changelog $(MODULES_DEST)/debian/
cp debian/copyright $(MODULES_DEST)/debian/
cp debian/modules-tools.d/rules $(MODULES_DEST)/debian/
chmod u+x $(MODULES_DEST)/debian/rules
# clean the source tree
# $(MAKE) -C $(MODULES_DEST) INSTALL_MODULES=1 \
# -f debian/rules clean-modules
# change owner & permissions
chown -R root.root debian/$(srcpkg)
find debian/$(srcpkg) -type d | xargs chmod 755
-find debian/$(srcpkg) -type f -perm -100 | xargs chmod 755
-find debian/$(srcpkg) -type f -not -perm -100 | xargs chmod 644
# build tar.bz2
cd debian/$(srcpkg)/usr/src && \
tar cf $(package).tar modules && \
rm -r modules/$(package)
bzip2 -9 debian/$(srcpkg)/usr/src/$(package).tar
chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.bz2
install -o root -g root -m 755 -d debian/$(srcpkg)/etc
install -o root -g root -m 644 debian/local/em8300-source \
debian/$(srcpkg)/etc/em8300-source
# Build architecture-independent files here.
binary-indep: install-stamp install-source
dh_testdir -i
dh_testroot -i
dh_installdebconf -i
dh_installdocs -i
dh_installexamples -i
dh_installmenu -i
dh_installinit -i
dh_installcron -i
dh_installman -i
dh_installinfo -i
dh_installchangelogs ChangeLog -i
dh_strip -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_makeshlibs -i
dh_installdeb -i
dh_perl -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: install-stamp
dh_testdir -a
dh_testroot -a
dh_installdebconf -a
dh_installdocs -a
dh_installexamples -a
dh_installmenu -a
dh_installinit -a
dh_installcron -a
dh_installman -a
dh_installinfo -a
dh_installchangelogs ChangeLog -a
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|