~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2007-12-15 23:32:51 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071215233251-2vgs2lmg8mai5d9e
Tags: 0+20071211-1ubuntu1
* Merge from debian unstable (LP: #175705), remaining changes:
  - Fix for Ubuntu Kernels (updated)
* patches/01_vserver.dpatch: Removed
* patches/06_ubuntu.dpatch: Added (update of ubuntu patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
 
3
 
# Uncomment this to turn on verbose mode.
4
 
#export DH_VERBOSE=1
5
 
 
6
 
DATE=$(shell date +%Y%m%d)
7
 
CFLAGS = -Wall -g
 
2
DATE      := $(shell date +%Y%m%d)
 
3
M         := $(CURDIR)
 
4
CFLAGS     = -Wall -g
 
5
# Include dpatch (don't fail, because we do not need it for m-a)
 
6
-include /usr/share/dpatch/dpatch.make
 
7
include debian/conf.mk
8
8
 
9
9
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
10
10
        CFLAGS += -O0
12
12
        CFLAGS += -O2
13
13
endif
14
14
 
15
 
CONFIG_AUFS = m
16
 
CONFIG_AUFS_FAKE_DM = y
17
 
CONFIG_AUFS_BRANCH_MAX_127 = y
18
 
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
19
 
 
20
 
ifneq ($(ARCH),arm)
21
 
CONFIG_AUFS_SYSAUFS=y
22
 
AUFS_DEF_CONFIG += -DCONFIG_AUFS_SYSAUFS
23
 
endif
24
 
 
25
 
AUFS_DEF_CONFIG += -DCONFIG_AUFS_BRANCH_MAX_127 -DCONFIG_AUFS_FAKE_DM
26
 
AUFS_DEF_CONFIG += -DCONFIG_AUFS_MODULE -UCONFIG_AUFS
27
 
 
28
 
 
29
 
 
30
 
EXTRA_CFLAGS += -I ${CURDIR}/include
31
 
EXTRA_CFLAGS += ${AUFS_DEF_CONFIG}
32
 
EXTRA_CFLAGS += -DLKTRHidePrePath=\"${CURDIR}/fs/aufs\"
33
 
export EXTRA_CFLAGS AUFS_DEF_CONFIG CONFIG_AUFS CONFIG_AUFS_FAKE_DM CONFIG_AUFS_BRANCH_MAX_127 CONFIG_AUFS_SYSAUFS
34
 
 
35
 
# some default definitions, important!
36
 
#
 
15
 
37
16
# Name of the source package
38
17
psource:=aufs-source
39
 
 
40
18
# The short upstream name, used for the module source directory
41
19
sname:=aufs
42
20
 
43
21
### KERNEL SETUP
44
 
### Setup the stuff needed for making kernel module packages
45
 
### taken from /usr/share/kernel-package/sample.module.rules
46
 
 
47
22
# prefix of the target package name
48
 
PACKAGE=aufs-modules
49
 
# modifieable for experiments or debugging m-a
 
23
PACKAGE = aufs-modules
50
24
MA_DIR ?= /usr/share/modass
51
 
# load generic variable handling
52
25
-include $(MA_DIR)/include/generic.make
53
 
# load default rules, including kdist, kdist_image, ...
54
26
-include $(MA_DIR)/include/common-rules.make
55
 
 
56
 
# module assistant calculates all needed things for us and sets
57
 
# following variables:
58
 
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
59
 
# (revision of the Debian kernel-image package), CC (the correct
60
 
# compiler), VERSION (the final package version string), PKGNAME (full
61
 
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
62
 
 
63
 
# The kdist_configure target is called by make-kpkg modules_config and
64
 
# by kdist* rules by dependency. It should configure the module so it is
65
 
# ready for compilation (mostly useful for calling configure).
66
 
# prep-deb-files from module-assistant creates the neccessary debian/ files
67
27
kdist_config: prep-deb-files
68
28
 
69
 
# the kdist_clean target is called by make-kpkg modules_clean and from
70
 
# kdist* rules. It is responsible for cleaning up any changes that have
71
 
# been made by the other kdist_commands (except for the .deb files created)
72
29
kdist_clean:
73
 
        $(MAKE) -C $(KSRC) M=$(CURDIR)/fs/aufs clean
 
30
        $(MAKE) -C $(KSRC) M=$(CURDIR) clean
74
31
 
75
32
# Create the directories to
76
33
#
80
37
 
81
38
build-arch-stamp:
82
39
        dh_testdir
83
 
 
84
 
        # Add here command to compile/build the package.
85
40
        $(MAKE) -C util
86
 
 
87
41
        touch $@
88
42
 
89
 
#k = $(shell echo $(KVERS) | grep -q ^2.6 && echo k)
90
 
 
91
 
# the binary-modules rule is invoked by module-assistant while processing the
92
 
# kdist* targets. It is called by module-assistant or make-kpkg and *not*
93
 
# during a normal build
94
43
binary-modules:
95
44
        dh_testroot
96
45
        dh_clean -k
97
 
 
98
46
        # Build the module
99
 
        $(MAKE) -C $(KSRC) M=$(CURDIR)/fs/aufs modules
 
47
        $(MAKE) -C $(KSRC) M=$(CURDIR) modules
100
48
        # Install the module
101
 
        install -D -m 0644 fs/aufs/aufs.ko debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/fs/aufs/aufs.ko
 
49
        install -D -m 0644 aufs.ko debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/fs/aufs/aufs.ko
102
50
 
103
51
        dh_installdocs
104
52
        dh_installchangelogs
111
59
        dh_builddeb --destdir=$(DEB_DESTDIR)
112
60
        dh_clean -k
113
61
 
114
 
build: build-arch
 
62
build: patch build-arch
115
63
 
116
 
clean:
 
64
clean: unpatch
117
65
        dh_testdir
118
66
        #dh_testroot
119
67
        rm -f build-arch-stamp
120
 
 
121
 
        # Add here commands to clean up after the build process.
122
 
        -$(MAKE) -C util clean
 
68
        $(MAKE) -C util clean
123
69
 
124
70
        dh_clean
125
71
 
129
75
        dh_testroot
130
76
        dh_clean -k
131
77
        dh_installdirs
132
 
 
 
78
        dh_installkpatches
133
79
        # Create the directories to install the source into
134
 
        dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian usr/src/modules/$(sname)/fs usr/src/modules/$(sname)/include
 
80
        dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian \
 
81
                                    usr/src/modules/$(sname)/fs \
 
82
                                    usr/src/modules/$(sname)/include
135
83
        dh_installdirs -A -paufs-tools  usr/sbin
136
84
 
137
85
        # Copy only the driver source to the proper location
138
 
        cp -r fs/* debian/$(psource)/usr/src/modules/$(sname)/fs
139
 
        cp -r include/* debian/$(psource)/usr/src/modules/$(sname)/include
140
 
        # Copy the needed debian/ pieces to the proper location
141
 
        cp debian/*modules.in* \
142
 
                debian/$(psource)/usr/src/modules/$(sname)/debian
143
 
        cp debian/rules debian/changelog debian/copyright \
144
 
                debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/
 
86
        cp -r fs/aufs/*        debian/$(psource)/usr/src/modules/$(sname)/
 
87
        cp -r include/*        debian/$(psource)/usr/src/modules/$(sname)/include
 
88
        cd debian/$(psource)/usr/src/modules/$(sname)/ && mv Makefile Makefile.upstream
 
89
        cp debian/modules.mk   debian/$(psource)/usr/src/modules/$(sname)/Makefile
 
90
        cp debian/*modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian
 
91
        cp debian/rules debian/changelog debian/copyright debian/compat debian/conf.mk \
 
92
                debian/$(psource)/usr/src/modules/$(sname)/debian/
145
93
        cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules
146
94
 
147
 
        # Add here commands to install the package into debian/aufs.
148
95
        for i in mount.aufs umount.aufs auplink aulchown; do \
149
96
                install -m 755 -p $(CURDIR)/util/$$i debian/aufs-tools/usr/sbin || exit 1; \
150
97
        done;
162
109
        # Creating tarball
163
110
        tar cfz ../aufs_0+$(DATE).orig.tar.gz ../aufs-0+$(DATE)
164
111
 
165
 
# Build architecture-independent files here.
166
 
# Pass -i to all debhelper commands in this target to reduce clutter.
167
112
binary-indep: build install
168
113
        dh_testdir -i
169
114
        dh_testroot -i
176
121
        dh_md5sums -i
177
122
        dh_builddeb -i
178
123
 
179
 
# Create the directories to
180
124
binary-arch: build install
181
125
        dh_testdir -s
182
126
        dh_testroot -s