~ubuntu-branches/ubuntu/jaunty/open-iscsi/jaunty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Hug
  • Date: 2006-07-23 19:08:48 UTC
  • Revision ID: james.westby@ubuntu.com-20060723190848-d5cwt7l0mzuztbo4
Tags: 1.0.485-3
Added description to man page

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# -*- makefile -*-
 
3
# Sample debian/rules that uses debhelper.
 
4
#
 
5
# This file was originally written by Joey Hess and Craig Small.
 
6
# As a special exception, when this file is copied by dh-make into a
 
7
# dh-make output file, you may use that output file without restriction.
 
8
# This special exception was added by Craig Small in version 0.37 of dh-make.
 
9
#
 
10
# Modified to make a template file for a multi-binary package with separated
 
11
# build-arch and build-indep targets  by Bill Allombert 2001
 
12
 
 
13
# Uncomment this to turn on verbose mode.
 
14
#export DH_VERBOSE=1
 
15
 
 
16
# This has to be exported to make some magic below work.
 
17
export DH_OPTIONS
 
18
 
 
19
 
 
20
 
 
21
CFLAGS = -Wall -g
 
22
export OPTFLAGS =-DDISCOVERY_FILE=\"/var/lib/open-iscsi/discovery\" -DNODE_FILE=\"/var/lib/open-iscsi/node\"
 
23
 
 
24
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
25
        CFLAGS += -O0
 
26
else
 
27
        CFLAGS += -O2
 
28
endif
 
29
 
 
30
configure: configure-stamp
 
31
configure-stamp:
 
32
        dh_testdir
 
33
        # Add here commands to configure the package.
 
34
 
 
35
        touch configure-stamp
 
36
 
 
37
 
 
38
#Architecture 
 
39
build: build-arch
 
40
 
 
41
build-arch: build-arch-stamp
 
42
build-arch-stamp: configure-stamp 
 
43
 
 
44
        # Add here commands to compile the arch part of the package.
 
45
        $(MAKE) -C usr
 
46
 
 
47
        touch build-arch-stamp
 
48
 
 
49
build-indep: build-indep-stamp
 
50
build-indep-stamp: configure-stamp 
 
51
 
 
52
        # Add here commands to compile the indep part of the package.
 
53
        #$(MAKE) doc
 
54
        touch build-indep-stamp
 
55
 
 
56
clean:
 
57
        dh_testdir
 
58
        dh_testroot
 
59
        rm -f build-arch-stamp build-indep-stamp configure-stamp
 
60
 
 
61
        # Add here commands to clean up after the build process.
 
62
        $(MAKE) -C usr clean
 
63
        rm -rf modules
 
64
 
 
65
        dh_clean 
 
66
 
 
67
install: install-arch
 
68
# disabled kernel module package for now because source is already in debian stock kernelsy
 
69
install-indep:
 
70
 
 
71
disabled-install-indep:
 
72
        dh_testdir
 
73
        dh_testroot
 
74
        dh_clean -k -i 
 
75
        dh_installdirs -i
 
76
 
 
77
        # create needed directories
 
78
        dh_installdirs -i usr/src/modules/linux-iscsi
 
79
 
 
80
        mkdir -p modules/linux-iscsi/debian
 
81
 
 
82
        # copy the driver source
 
83
        tar --exclude=debian -c * | (cd modules/linux-iscsi && tar xv)
 
84
 
 
85
        # copy all relevant debian/ files
 
86
        cp debian/{compat,copyright} modules/linux-iscsi/debian
 
87
        cat debian/changelog | sed -e 's/linux-iscsi/linux-iscsi-modules/' > modules/linux-iscsi/debian/changelog
 
88
        cp debian/*.modules.in modules/linux-iscsi/debian
 
89
        install -m755 debian/rules.modules modules/linux-iscsi/debian/rules
 
90
 
 
91
        # entar the source
 
92
        tar jcf debian/linux-iscsi-modules-source/usr/src/linux-iscsi-modules-source.tar.bz2 modules
 
93
 
 
94
        # Add here commands to install the indep part of the package into
 
95
        # debian/<package>-doc.
 
96
        #INSTALLDOC#
 
97
 
 
98
        dh_install -i
 
99
 
 
100
install-arch:
 
101
        dh_testdir
 
102
        dh_testroot
 
103
        dh_clean -k -s 
 
104
        dh_installdirs -s
 
105
 
 
106
        # Add here commands to install the arch part of the package into 
 
107
        # debian/open-iscsi.
 
108
        install -m 755 usr/iscsiadm $(CURDIR)/debian/open-iscsi/usr/bin
 
109
        install -m 755 usr/iscsi-iname $(CURDIR)/debian/open-iscsi/usr/sbin
 
110
        install -m 755 usr/iscsid $(CURDIR)/debian/open-iscsi/usr/sbin
 
111
        install -m 644 etc/iscsid.conf $(CURDIR)/debian/open-iscsi/etc
 
112
        install -m 644 debian/initiatorname.iscsi $(CURDIR)/debian/open-iscsi/etc/initiatorname.iscsi
 
113
 
 
114
        dh_install -s
 
115
 
 
116
# Must not depend on anything. This is to be called by
 
117
# binary-arch/binary-indep
 
118
# in another 'make' thread.
 
119
binary-common:
 
120
        dh_testdir
 
121
        dh_testroot
 
122
        dh_installchangelogs 
 
123
        dh_installdocs
 
124
        dh_installexamples
 
125
        dh_installinit
 
126
        dh_installman
 
127
        dh_link
 
128
        dh_strip
 
129
        dh_compress 
 
130
        dh_fixperms
 
131
        dh_makeshlibs
 
132
        dh_installdeb
 
133
        dh_shlibdeps
 
134
        dh_gencontrol
 
135
        dh_md5sums
 
136
        dh_builddeb
 
137
# Build architecture independant packages using the common target.
 
138
binary-indep: build-indep install-indep
 
139
#       $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
 
140
 
 
141
# Build architecture dependant packages using the common target.
 
142
binary-arch: build-arch install-arch
 
143
        $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
 
144
 
 
145
binary: binary-arch binary-indep
 
146
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure