File: rules

package info (click to toggle)
gpib 3.2.11-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,760 kB
  • ctags: 16
  • sloc: makefile: 108; sh: 41
file content (163 lines) | stat: -rwxr-xr-x 5,270 bytes parent folder | download
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
#!/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$
#

DEB_PYTHON_SYSTEM=pysupport

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)

#"cdbs makefile.mk"
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
#"cdbs tarball.mk"
include /usr/share/cdbs/1/rules/tarball.mk
#"cdbs patchsys-quilt.mk"
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
#"cdbs autotools.mk"
include /usr/share/cdbs/1/class/autotools.mk
#"cdbs debhelper.mk"
include /usr/share/cdbs/1/rules/debhelper.mk

#"cdbs python-distutils.mk"
include /usr/share/cdbs/1/class/python-distutils.mk

DEB_PYTHON_MODULE_PACKAGE := python-gpib
DEB_PYTHON_SETUP_CMD := language/python/setup.py
DEB_PYTHON_INSTALL_ARGS_ALL = --root=$(CURDIR)/debian/python-gpib
phpapiver=$(shell php-config5 --phpapi)


#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
# kludge to make sure script is executable after install
	chmod 0755 debian/libgpib-bin/lib/libgpib0/gpib_config_wrapper

# 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" LD_RUN_PATH=)

install/libgpib-perl::
	(cd $(DEB_BUILDDIR)/language/perl; \
	$(MAKE) install PREFIX=$(CURDIR)/debian/libgpib-perl/usr )

binary-predeb/php5-gpib::
	echo "php:Depends=phpapi-$(phpapiver)" >> debian/php5-gpib.substvars
# Don't use -f when deleting these files so that errors requiring a path change
# will be obvious (CUS)
	rm -f $(CURDIR)/debian/php5-gpib/usr/lib/php5/$(phpapiver)/gpib_php.a
	rm -f $(CURDIR)/debian/php5-gpib/usr/lib/php5/$(phpapiver)/gpib_php.la
	rm -f $(CURDIR)/debian/php5-gpib/usr/lib/php5/$(phpapiver)/gpib_php.so

.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-*/drivers/gpib \
		debian/gpib-modules-source/usr/src/modules/
	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

binary-modules: prep-deb-files
	dh_testdir
	dh_testroot
	dh_clean -k
	$(MAKE) -C $(KSRC) CC="$(CC) -I$(CURDIR) -I$(CURDIR)/include" \
		SUBDIRS="$(CURDIR)" \
                MODVERDIR="$(CURDIR)/.tmp-versions" modules
	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 --force; \
	autoconf --force; \
	automake -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