~ubuntu-branches/ubuntu/maverick/nvidia-graphics-drivers-96/maverick-proposed

« back to all changes in this revision

Viewing changes to debian.binary/rules

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Milone
  • Date: 2010-01-08 23:34:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100108233451-f1142o5r7z0ou4o0
Tags: 96.43.14-0ubuntu1
* Rework packaging taking Mandriva's as a model:
  - Use alternatives instead of diversions.
  - Reduce the number of binary packages to nvidia-96,
    nvidia-96-dev and nvidia-96-modaliases.
* debian/rules:
  - Switch to CDBS.
  - Remove libGL.la as no static library is provided.
* debian/nvidia-current.README.Debian.in:
  - Document the update process.
* nvidia-current.postinst: try to build the module for the most
  recent kernel in addition to building it for the current kernel
  (LP: #474917).
* New upstream release (LP: #494166):
 - Add support for xserver 1.7.x.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/make -f
2
 
# Sample debian/rules that uses debhelper.
3
 
# GNU copyright 1997 to 1999 by Joey Hess.
4
 
 
5
 
# Uncomment this to turn on verbose mode.
6
 
#export DH_VERBOSE=1
7
 
 
8
 
# This is the debhelper compatability version to use.
9
 
export DH_COMPAT=4
10
 
 
11
 
ifeq ($(shell id -u),0)
12
 
     ROOT_CMD=
13
 
endif
14
 
        
15
 
include $(CURDIR)/debian/conf.mk
16
 
 
17
 
 
18
 
 
19
 
.PHONY: build build-stamp
20
 
build: configure-stamp build-stamp
21
 
build-stamp:
22
 
 
23
 
        dh_testdir
24
 
        dh_testroot
25
 
 
26
 
 
27
 
        @echo "PATCHLEVEL = $(PATCHLEVEL) " ;
28
 
        @echo "Kernel compiler version : $(kernel_cc)" ; 
29
 
        @echo "Detected compiler version : $(module_cc)" ;
30
 
       
31
 
 
32
 
        @if [ "$(kernel_cc)" != "$(module_cc)" ]; then \
33
 
        echo "                                                           "; \
34
 
        echo "You appear to be compiling the NVIDIA kernel module with   "; \
35
 
        echo "a compiler different from the one that was used to compile "; \
36
 
        echo "the running kernel. This may be perfectly alright and you "; \
37
 
        echo "may be building this module for another kernel in which case"; \
38
 
        echo "you may ignore this message."; \
39
 
        echo " " ; \
40
 
        echo "The compiler that will be used to compile this module has been"; \
41
 
        echo "determined from:" ; \
42
 
        echo " 1) the CC environment variable " ; \
43
 
        echo " 2) that specified in "; \
44
 
        echo "    $(KSRC)/include/linux/compile.h" ; \
45
 
        echo " 3) gcc " ; \
46
 
        fi
47
 
        @echo "Using compiler $(CC) version $(module_cc)"; 
48
 
 
49
 
        
50
 
 
51
 
        touch $(CURDIR)/$(dirname)/gcc-check
52
 
        touch $(CURDIR)/$(dirname)/cc-sanity-check
53
 
 
54
 
        ## Main Make ##
55
 
        IGNORE_CC_MISMATCH=1 CC="$(CC)" $(MAKE) -C $(CURDIR)/$(dirname) -f Makefile SYSSRC=$(KSRC)  $(KPKG_EXTRAV_ARG) KBUILD_PARAMS=$(KBUILD_PARAMS) module;
56
 
 
57
 
        touch build-stamp
58
 
 
59
 
 
60
 
.PHONY: install
61
 
install: build
62
 
        dh_testdir
63
 
        dh_testroot
64
 
        dh_clean -k
65
 
 
66
 
        sed 's/#KVERS#/$(KVERS)/g' debian/control.template > $(CURDIR)/debian/control
67
 
        sed 's/#KVERS#/$(KVERS)/g' debian/dirs.template > $(CURDIR)/debian/dirs
68
 
        sed 's/#KVERS#/$(KVERS)/g' debian/override.template > $(CURDIR)/debian/override
69
 
 
70
 
        dh_installdirs
71
 
 
72
 
 
73
 
        install -m 0644 $(CURDIR)/debian/override $(CURDIR)/debian/nvidia-kernel-$(KVERS)/usr/share/lintian/overrides/nvidia-kernel-$(KVERS)
74
 
        if [ "$(PATCHLEVEL)" = "6" ] ; then \
75
 
           install -m 0644 $(CURDIR)/$(dirname)/nvidia.ko $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.ko ; \
76
 
        else \
77
 
           install -m 0644 $(CURDIR)/$(dirname)/nvidia.o $(CURDIR)/debian/nvidia-kernel-$(KVERS)/lib/modules/$(KVERS)/nvidia/nvidia.o ;\
78
 
        fi
79
 
 
80
 
 
81
 
 
82
 
 
83
 
 
84
 
.PHONY: binary_modules
85
 
binary_modules: build install
86
 
        dh_testdir
87
 
        dh_testroot
88
 
#       dh_installdebconf       
89
 
        dh_installdocs
90
 
#       dh_installexamples
91
 
#       dh_installmanpages
92
 
#       dh_undocumented
93
 
        dh_installmodules
94
 
 
95
 
        dh_installinit
96
 
        
97
 
        dh_installchangelogs 
98
 
        dh_link
99
 
        dh_strip
100
 
        dh_compress
101
 
        dh_fixperms
102
 
# You may want to make some executables suid here.
103
 
#       dh_suidregister
104
 
#       dh_makeshlibs
105
 
        dh_installdeb
106
 
#       dh_shlibdeps
107
 
        dh_gencontrol -- -v$(PKG_VERSION)
108
 
        dh_md5sums
109
 
ifeq "$(origin KPKG_DEST_DIR)" "undefined"      
110
 
ifeq "$(origin KMAINT)" "undefined"     
111
 
        dh_builddeb  --destdir=$(CURDIR)/..
112
 
else    
113
 
        dh_builddeb  --destdir=$(KSRC)/..
114
 
endif
115
 
else
116
 
        dh_builddeb  --destdir=$(KPKG_DEST_DIR)
117
 
endif   
118
 
 
119
 
 
120
 
.PHONY: clean
121
 
clean: clean.Makefile  unpatch
122
 
        if [ -f $(CURDIR)/debian/control.template ]; then \
123
 
                cp  $(CURDIR)/debian/control.template $(CURDIR)/debian/control; \
124
 
        fi
125
 
 
126
 
        dh_testroot
127
 
        rm -f build-stamp configure-stamp
128
 
 
129
 
 
130
 
        $(MAKE) clean SYSSRC=$(KSRC) -C $(CURDIR)/$(dirname) -f Makefile $(KPKG_EXTRAV_ARG)
131
 
        
132
 
        rm -f $(CURDIR)/$(dirname)/Makefile || true;    
133
 
        -rm $(CURDIR)/$(dirname)/gcc-check
134
 
        -rm $(CURDIR)/$(dirname)/cc-sanity-check
135
 
        
136
 
        -dh_clean
137
 
 
138
 
        -rm $(CURDIR)/debian/control
139
 
        -rm $(CURDIR)/debian/dirs
140
 
        -rm $(CURDIR)/debian/override
141
 
 
142
 
 
143
 
unpatch: 
144
 
        if [ -e patch-stamp ]; then \
145
 
           dpatch deapply-all ; \
146
 
           rm -rf patch-stamp debian/patched ; \
147
 
        fi
148
 
        patch -R -p3 < $(CURDIR)/debian/patches/xen.patch
149
 
        
150
 
           
151
 
 
152
 
# The kdist_configure target is called by make-kpkg modules_config. It
153
 
# should configure the module so it is ready for compilation (mostly
154
 
# useful for calling configure)
155
 
.PHONY: kdist_config
156
 
kdist_config:
157
 
             $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
158
 
 
159
 
.PHONY: kdist_configure
160
 
kdist_configure:
161
 
                $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules configure
162
 
 
163
 
# the kdist_image target is called by make-kpkg modules_image. It is
164
 
# responsible for compiling the module and creating the package. It
165
 
# should also clean up after making the module. Please note we use a
166
 
# seperate binary-modules target to make testing the package building
167
 
# easier
168
 
.PHONY: kdist_image
169
 
kdist_image:
170
 
            echo "ROOT_CMD = $(ROOT_CMD)"
171
 
            $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary_modules
172
 
            $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean
173
 
 
174
 
 
175
 
 
176
 
# the kdist_clean target is called by make-kpkg modules_clean. It is
177
 
# responsible for cleaning up any changes that have been made by the
178
 
# other kdist_commands (except for the .deb files created).
179
 
.PHONY: kdist_clean
180
 
kdist_clean: 
181
 
             $(MAKE) $(MFLAGS) -f debian/rules clean
182
 
 
183
 
kdist: 
184
 
        $(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary_modules
185
 
        # Build a .changes file.
186
 
        dpkg-genchanges -b -e"$(KMAINT) <$(KEMAIL)>" -u"$(CURDIR)/../.." > $(CHFILE)
187
 
        debsign -e"$(KMAINT) <$(KEMAIL)>" $(CHFILE)
188
 
        $(MAKE) $(MFLAGS) -f debian/rules clean
189