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
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that can build a kernel modules
# architecture-dependant package via make-kpkg, as well as an
# architecture-independent module source package, and other packages
# either dep/indep for things like common files or userspace components
# needed for the kernel modules.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
export KVERS
k = $(shell echo $(KVERS) | grep -q ^2.6 && echo k)
build-indep:
build-arch: build-arch-stamp
build-arch-stamp:
dh_testdir
cd modem ; $(MAKE) SUPPORT_ALSA=1
touch build-arch-stamp
build: build-arch
configure:
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean SUPPORT_ALSA=1
-cd modem; $(MAKE) clean SUPPORT_ALSA=1
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Create the directories to install the source into
# dh_installdirs -psl-modem-source usr/src/modules/sl-modem/latest usr/src/modules/sl-modem/debian
# dh_installdirs -psl-modem-daemon
# Copy only the driver source to the proper location
tar -c --exclude ".svn" modem/*.h drivers patches ungrab-winmodem | tar x -C debian/sl-modem-source/usr/src/modules/sl-modem/
# Copy the needed debian/ pieces to the proper location
cd debian ; cp control compat *_KVERS_* *.modules.in rules changelog copyright sl-modem-source/usr/src/modules/sl-modem/debian
chmod -R a+r debian/sl-modem-source/
cd debian/sl-modem-source/usr/src && tar c modules | bzip2 -9 > sl-modem.tar.bz2 && rm -rf modules
cp modem/slmodemd debian/sl-modem-daemon/usr/sbin/
cp debian/sl-modem-daemon.modutils debian/sl-modem-daemon/etc/modutils
cp debian/sl-modem-daemon.modutils debian/sl-modem-daemon/etc/modprobe.d
echo "install slamr modprobe --ignore-install ungrab-winmodem ; modprobe --ignore-install slamr; test -e /dev/slamr0 || (/bin/mknod -m 660 /dev/slamr0 c 242 0 2>/dev/null && chgrp dialout /dev/slamr0) " >> debian/sl-modem-daemon/etc/modprobe.d/sl-modem-daemon.modutils
dh_installdocs -psl-modem-source debian/README.Debian README
dh_installdocs -psl-modem-daemon
dh_install
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs -a Changes
dh_installdirs -psl-modem-daemon /etc/udev/rules.d
install -m 644 debian/sl-modem-daemon.rules debian/sl-modem-daemon/etc/udev
dh_link -p sl-modem-daemon /etc/udev/sl-modem-daemon.rules /etc/udev/rules.d/030_sl-modem-daemon.rules
dh_installdocs -a
dh_installexamples -a
# dh_install -a
# dh_installmenu -a
dh_installdebconf -a
perl debian/setcountries.pl debian/sl-modem-daemon/DEBIAN/templates
# dh_installlogrotate -a
# dh_installemacsen -a
# dh_installpam -a
# dh_installmime -a
dh_installinit -a -n
# dh_installcron -a
# dh_installinfo -a
dh_installman -a debian/slmodemd.1
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
# dh_python -a
# dh_makeshlibs -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
# prefix of the target package name
PACKAGE=sl-modem-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules
-include $(MA_DIR)/include/common-rules.make
binary-modules:
dh_clean -k
dh_installdirs lib/modules/$(KVERS)/misc usr/lib/sl-modem
if ! test -e drivers/Makefile ; then echo "Please update the package, extract the tarball!"; exit 1 ; fi
$(MAKE) -C drivers KERNEL_DIR=$(KSRC) KVERS=$(KVERS)
cp drivers/slusb.$ko drivers/slamr.$ko debian/$(PKGNAME)/lib/modules/$(KVERS)/misc
ifeq ($k,k)
$(MAKE) -C ungrab-winmodem KERNEL_DIR=$(KSRC) KVERS=$(KVERS)
cp ungrab-winmodem/ungrab-winmodem.ko debian/$(PKGNAME)/lib/modules/$(KVERS)/misc
endif
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
kdist_clean: clean
$(MAKE) -C drivers clean
kdist_config: prep-deb-files
.PHONY: build clean binary-indep binary-arch binary install configure binary-modules kdist kdist_config kdist_image kdist_clean configure
|