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
# rules
#
# Robert Jordens <rjo@gmx.de>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
#
# $Id$
#
PACKAGE = gpib-modules
MA_DIR ?= /usr/share/modass
-include $(MA_DIR)/include/generic.make
-include $(MA_DIR)/include/common-rules.make
# save from environment
KPKG_DESTDIR := $(DEB_DESTDIR)
include /usr/share/cdbs/1/class/makefile.mk
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed 's/-[^-]*$$//')
DEB_UPSTREAM_TARBALL_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed 's/+[^+]*$$//')
DEB_TAR_SRCDIR := linux-$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_TARBALL_VERSION)
# tarball has to be first because of #205396
include /usr/share/cdbs/1/rules/tarball.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
# force using a specific python version for build
#DEB_PYTHON_COMPILE_VERSION := 2.3
DEB_PYTHON_VERSIONS = 2.2 2.3
DEB_PYTHON_SETUP_CMD := language/python/setup.py
DEB_PYTHON_INSTALL_ARGS_ALL = --root=$(CURDIR)/debian/tmp
phpapiver=$(shell grep '\#define PHP_API_VERSION ' /usr/include/php4/main/php.h |sed 's/\#define PHP_API_VERSION //')
#include /usr/share/cdbs/1/class/perlmodule.mk
#DEB_MAKEMAKER_INVOKE = /usr/bin/perl language/perl/Makefile.PL INSTALLDIRS=vendor
DEB_CONFIGURE_EXTRA_FLAGS := --enable-pcmcia --enable-static
DEB_DH_MAKESHLIBS_ARGS := -V
DEB_SHLIBDEPS_INCLUDE := lib/.libs
# after the directories are created but before dh_compress is run.
common-binary-post-install-arch::
dh_buildinfo
# make include = gpib to build perl and python bindings
#post-patches::
# -rm -f gpib && ln -s include gpib
build/libgpib-perl::
(cd $(DEB_BUILDDIR)/language/perl; \
perl Makefile.PL INSTALLDIRS=vendor;\
$(MAKE) OPTIMIZE="-O2 -g -Wall")
install/libgpib-perl::
(cd $(DEB_BUILDDIR)/language/perl; \
$(MAKE) install PREFIX=$(CURDIR)/debian/libgpib-perl/usr )
binary-predeb/php4-gpib::
echo "php:Depends=phpapi-$(phpapiver)" >> debian/php4-gpib.substvars
.PHONY: clean/libgpib-perl
clean/libgpib-perl:
-(cd $(DEB_BUILDDIR)/language/perl; \
$(MAKE) distclean )
clean:: clean/libgpib-perl
build/gpib-modules-source::
mkdir -p debian/gpib-modules-source/usr/src/modules
cp -a build-tree/linux-gpib-*/driver \
debian/gpib-modules-source/usr/src/modules/gpib
mkdir -p debian/gpib-modules-source/usr/src/modules/gpib/debian
cd debian ; cp changelog control common-description \
compat *.modules.in rules copyright \
gpib-modules-source/usr/src/modules/gpib/debian
cp build-tree/linux-gpib-*/config.h \
debian/gpib-modules-source/usr/src/modules/gpib/include
ln -s . debian/gpib-modules-source/usr/src/modules/gpib/include/gpib
cd debian/gpib-modules-source/usr/src/ ; \
tar -c modules | bzip2 -9 > gpib.tar.bz2 && rm -rf modules
mkdir -p debian/gpib-modules-source/usr/share/modass/overrides
ln -s ../packages/default.sh \
debian/gpib-modules-source/usr/share/modass/overrides/gpib-modules-source
kdist_clean:
dh_clean
find $(CURDIR) \( -name '*.[oas]' -o -name '*.ko' \
-o -name core -o -name '.*.cmd' \) -type f -exec $(RM) {} \;
kdist_config: prep-deb-files
kdist_configure: kdist_config
KO := k
GPIB_MODULE_SUBDIRS :=agilent_82350b agilent_82357a cb7210 cec hp82335 ines nec7210 pc2 sys tms9914 tnt4882 ni_usb
GPIB_ABS_MODULE_SUBDIRS :=$(patsubst %, $(CURDIR)/%/, $(GPIB_MODULE_SUBDIRS))
binary-modules: prep-deb-files
dh_testdir
dh_testroot
dh_clean -k
$(MAKE) -C $(KSRC) V=1 MODVERSIONS=detect modules\
CC="$(CC) -I$(CURDIR) -I$(CURDIR)/include" \
SUBDIRS="$(GPIB_ABS_MODULE_SUBDIRS)" \
MODVERDIR="$(CURDIR)/.tmp-versions"
install -d $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/gpib
install -m644 */*.$(KO)o \
$(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/gpib/
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
cat debian/common-description >> debian/$(PKGNAME).substvars
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(KPKG_DESTDIR)
$(patsubst %,binary-predeb/%,$(DEB_PACKAGES)) :: binary-predeb/%: binary-fixup/%
cat debian/common-description >> debian/$(cdbs_curpkg).substvars
.PHONY: update-regen-autotools-patch
update-regen-autotools-patch:
-fakeroot debian/rules clean apply-patches
(cd build-tree/*-*; \
quilt push -a -f; \
aclocal-1.9 --force; \
autoconf --force; \
automake-1.9 -a -c -f; \
libtoolize --force --copy; \
quilt refresh; )
.PHONY: update-create-orig-tarball
update-create-orig-tarball:
mkdir -p tmp-orig-tree/$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig
cp *.tar.* tmp-orig-tree/$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig
tar -C tmp-orig-tree -czvf \
../$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz \
$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig
.PHONY: update-clean
update-clean:
rm -rf tmp-cvs-tarball \
tmp-orig-tree
clean:: update-clean
|