xref: /aosp_15_r20/external/sg3_utils/debian/rules (revision 44704f698541f6367e81f991ef8bb54ccbf3fc18)
1*44704f69SBart Van Assche#!/usr/bin/make -f
2*44704f69SBart Van Assche# Sample debian/rules that uses debhelper.
3*44704f69SBart Van Assche# GNU copyright 1997 by Joey Hess.
4*44704f69SBart Van Assche#
5*44704f69SBart Van Assche# This version is for a hypothetical package that builds an
6*44704f69SBart Van Assche# architecture-dependant package, as well as an architecture-independent
7*44704f69SBart Van Assche# package.
8*44704f69SBart Van Assche
9*44704f69SBart Van Assche# Uncomment this to turn on verbose mode.
10*44704f69SBart Van Assche# export DH_VERBOSE=1
11*44704f69SBart Van Assche
12*44704f69SBart Van AsscheDEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
13*44704f69SBart Van Assche
14*44704f69SBart Van Asscheconfigure: configure-stamp
15*44704f69SBart Van Asscheconfigure-stamp:
16*44704f69SBart Van Assche	dh_testdir
17*44704f69SBart Van Assche	# Add here commands to configure the package.
18*44704f69SBart Van Assche	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --bindir=/usr/bin --prefix=/usr --mandir=\$${prefix}/share/man
19*44704f69SBart Van Assche	touch configure-stamp
20*44704f69SBart Van Assche
21*44704f69SBart Van Asschebuild: configure-stamp build-stamp
22*44704f69SBart Van Asschebuild-stamp:
23*44704f69SBart Van Assche	dh_testdir
24*44704f69SBart Van Assche
25*44704f69SBart Van Assche	# Add here commands to compile the package.
26*44704f69SBart Van Assche	PREFIX=/usr MANDIR=/usr/share/man $(MAKE) -e
27*44704f69SBart Van Assche
28*44704f69SBart Van Assche	touch build-stamp
29*44704f69SBart Van Assche
30*44704f69SBart Van Asscheclean:
31*44704f69SBart Van Assche	dh_testdir
32*44704f69SBart Van Assche	dh_testroot
33*44704f69SBart Van Assche
34*44704f69SBart Van Assche	# Add here commands to clean up after the build process.
35*44704f69SBart Van Assche	-$(MAKE) distclean
36*44704f69SBart Van Assche
37*44704f69SBart Van Assche	rm -f build-stamp configure-stamp debian/substvars
38*44704f69SBart Van Assche
39*44704f69SBart Van Assche	dh_clean
40*44704f69SBart Van Assche
41*44704f69SBart Van Asscheinstall: DH_OPTIONS=
42*44704f69SBart Van Asscheinstall: build
43*44704f69SBart Van Assche	dh_testdir
44*44704f69SBart Van Assche	dh_testroot
45*44704f69SBart Van Assche	dh_clean
46*44704f69SBart Van Assche	dh_installdirs
47*44704f69SBart Van Assche
48*44704f69SBart Van Assche	# Add here commands to install the package into debian/tmp
49*44704f69SBart Van Assche	$(MAKE) -e install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
50*44704f69SBart Van Assche
51*44704f69SBart Van Assche	dh_install --autodest --sourcedir=debian/tmp
52*44704f69SBart Van Assche
53*44704f69SBart Van Assche	dh_installman
54*44704f69SBart Van Assche
55*44704f69SBart Van Assche# Build architecture-independent files here.
56*44704f69SBart Van Assche# Pass -i to all debhelper commands in this target to reduce clutter.
57*44704f69SBart Van Asschebinary-indep: build install
58*44704f69SBart Van Assche# nothing to do here
59*44704f69SBart Van Assche
60*44704f69SBart Van Assche# Build architecture-dependent files here.
61*44704f69SBart Van Asschebinary-arch: build install
62*44704f69SBart Van Assche	dh_testdir -a
63*44704f69SBart Van Assche	dh_testroot -a
64*44704f69SBart Van Assche	dh_installdocs -a
65*44704f69SBart Van Assche	dh_installexamples -a
66*44704f69SBart Van Assche	dh_installmenu -a
67*44704f69SBart Van Assche	dh_installchangelogs ChangeLog -a
68*44704f69SBart Van Assche	dh_strip -a
69*44704f69SBart Van Assche	dh_link -a
70*44704f69SBart Van Assche	dh_compress -a -X archive -X .c -X .h
71*44704f69SBart Van Assche	dh_fixperms -a
72*44704f69SBart Van Assche	dh_makeshlibs -V -v
73*44704f69SBart Van Assche	dh_installdeb -a
74*44704f69SBart Van Asscheifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
75*44704f69SBart Van Assche	echo kfreebsd:Depends=libcam-dev >>debian/libsgutils2-dev.substvars
76*44704f69SBart Van Asscheendif
77*44704f69SBart Van Assche	dh_shlibdeps -ldebian/tmp/usr/lib -L libsgutils2
78*44704f69SBart Van Assche	dh_gencontrol -a
79*44704f69SBart Van Assche	dh_md5sums -a
80*44704f69SBart Van Assche	dh_builddeb -a
81*44704f69SBart Van Assche
82*44704f69SBart Van Asschebinary: binary-indep binary-arch
83*44704f69SBart Van Assche.PHONY: build clean binary-indep binary-arch binary install configure
84