root/morphix/trunk/cloop/debian/rules

Revision 2, 4.9 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

  • Property svn:executable set to
Line 
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 by Joey Hess.
4 #
5 # This version is for a hypothetical package that builds an
6 # architecture-dependant package, as well as an architecture-independent
7 # package.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 SHELL=/bin/bash
13
14 # This is the debhelper compatability version to use.
15 export DH_COMPAT=3
16
17 KVERS=2.6.9
18
19 ifdef KDREV
20 FULLVER := $(shell dpkg-parsechangelog |grep ^Version | cut -f2 -d' ')+$(KDREV)
21 DEBDEP := (= $(KDREV))
22 else
23 FULLVER := $(shell dpkg-parsechangelog |grep ^Version | cut -f2 -d' ')
24 DEBDEP :=
25 endif
26
27 #defining some values
28 TARGETDIR=lib/modules/$(KVERS)/kernel/drivers/block
29
30 # this is the modules package target
31 ifdef KSRC
32 MOD_DESTDIR := --destdir=$(KSRC)/..
33 endif
34
35 # I like the Kernel module to be built anyways. -KK
36 ## ifeq ($(shell ls knoppix 2>/dev/null|| true ),knoppix)
37 ## Good morning Mr. Knopper, using your settings
38 TARGETDIR=lib/modules/$(KVERS)/misc
39 KSRC := /usr/src/linux
40 MOD_DESTDIR := --destdir=$(CURDIR)/..
41 binary: forknoppix
42 ## else
43 ## binary: binary-indep binary-arch
44 ## endif
45
46 gencontrol= sed 's/\#KVERS\#/$(KVERS)/g' | sed 's/\#DEBDEP\#/$(DEBDEP)/g'  > $(CURDIR)/debian/control
47
48 forknoppix:
49         debian/rules clean ; debian/rules binary-indep ; debian/rules binary-arch ; debian/rules clean ; debian/rules kdist_image
50
51 kdist_clean: clean
52
53 kdist_configure:
54         dh_testdir
55         cat debian/{control.head,control.mod} | $(gencontrol)
56         cp debian/templates.template debian/cloop-$(KVERS).templates
57         cp debian/cloop.postinst.template debian/cloop-$(KVERS).postinst
58         cp debian/cloop.config.template debian/cloop-$(KVERS).config
59
60 configure: configure-stamp
61 configure-stamp:
62         dh_testdir
63         cat debian/{control.head,control.utils,control.src} | $(gencontrol)
64         # Add here commands to configure the package.
65
66         touch configure-stamp
67
68 build: configure-stamp build-stamp
69 build-stamp:
70         dh_testdir
71         $(MAKE) create_compressed_fs extract_compressed_fs APPSONLY=yes
72         touch build-stamp
73
74 build-mod: kdist_configure
75         dh_testdir
76         type gcc-2.95 >/dev/null 2>&1 && { CC=gcc-2.95; export CC; }; $(MAKE) cloop.ko KERNEL_DIR=$(KSRC)
77         touch build-stamp
78
79 clean:
80         dh_testdir
81         dh_testroot
82         rm -f build-stamp configure-stamp
83         -$(MAKE) clean APPSONLY=yes
84         -dh_clean
85         rm -rf debian/cloop-?.?.?* debian/cloop debian/cloop-module debian/*.files
86
87 install: DH_OPTIONS=
88 install: build
89         dh_testdir
90         dh_testroot
91         dh_clean -k
92         dh_installdirs -p cloop-utils usr/bin
93         install -m 755 create_compressed_fs  $(CURDIR)/debian/cloop-utils/usr/bin/
94         install -m 755 extract_compressed_fs $(CURDIR)/debian/cloop-utils/usr/bin/
95         dh_installman $(CURDIR)/debian/create_compressed_fs.1
96         cd debian/cloop-utils/usr/share/man/man1 && ln -s create_compressed_fs.1.gz extract_compressed_fs.1.gz
97
98 install-mod: build-mod
99         dh_testdir
100         dh_testroot
101         dh_clean -k
102         dh_installdirs -p cloop-module-$(KVERS) $(TARGETDIR)
103         install -m 644 cloop.ko $(CURDIR)/debian/cloop-module-$(KVERS)/$(TARGETDIR)
104         rm cloop.ko compressed_loop.o
105
106 install-src: configure-stamp
107         dh_testdir
108         dh_testroot
109         dh_clean -k
110         dh_installdirs -p cloop-src usr/src/modules/cloop
111         echo $$UID
112         tar -cf - {Makefile,*.[ch],debian/{control*,copyright,rules,dirs,postrm,README.Debian,templates.template,cloop.postinst.template,cloop.config.template,changelog,genchanges.sh},CHANGELOG,README} | tar -x -C debian/cloop-src/usr/src/modules/cloop
113         dh_fixperms -i
114         cd debian/cloop-src/usr/src ; tar -cf - modules | gzip -9 > cloop.tar.gz ; rm -rf modules
115
116 binary-arch: build install build-deb
117
118 binary-indep: install-src build-indep
119
120 kdist_targets: clean build-mod install-mod build-deb
121
122 kdist_image: kdist_targets clean
123
124 kdist: kdist_targets
125         # Build a .changes file.
126         KVERS="$(KVERS)" KSRC="$(KSRC)" KMAINT="$(KMAINT)" \
127                                  REV="$(KDREV)" KEMAIL="$(KEMAIL)" sh -v debian/genchanges.sh
128         # Only now can we clean up.
129         debian/rules clean
130
131 build-deb:
132         dh_testdir -a
133         dh_testroot -a
134         dh_installdebconf -a
135         dh_installdocs -a README debian/README.Debian
136         dh_installexamples -a
137         dh_installmenu -a
138 #       dh_installlogrotate -a
139 #       dh_installemacsen -a
140 #       dh_installpam -a
141 #       dh_installmime -a
142 #       dh_installinit -a
143         dh_installcron -a
144 #       dh_installman -a
145         dh_installinfo -a
146         dh_installchangelogs CHANGELOG -a
147         dh_strip -a
148         dh_link -a
149         dh_compress -a
150         dh_fixperms -a
151 #       dh_makeshlibs -a
152         dh_installdeb -a
153         dh_shlibdeps -a
154         dh_gencontrol -a -- -v$(FULLVER)
155         dh_md5sums -a
156         dh_builddeb -a $(MOD_DESTDIR)
157
158 build-indep: configure-stamp install-src
159         dh_testdir -i
160         dh_testroot -i
161 #       dh_installdebconf -i
162         dh_installdocs -i README debian/README.Debian
163         dh_installexamples -i
164         dh_installmenu -i
165 #       dh_installlogrotate -i
166 #       dh_installemacsen -i
167 #       dh_installpam -i
168 #       dh_installmime -i
169 #       dh_installinit -i
170         dh_installcron -i
171 #       dh_installman -i
172         dh_installinfo -i
173         dh_installchangelogs CHANGELOG -i
174         dh_strip -i
175         dh_link -i
176         dh_compress -i
177         dh_fixperms -i
178 #       dh_makeshlibs -i
179         dh_installdeb -i
180         dh_shlibdeps -i
181         dh_gencontrol -i
182         dh_md5sums -i
183         dh_builddeb -i
184
185 .PHONY: build clean binary-indep binary-arch binary kdist kdist_image kdist_configure kdist_clean kdist
Note: See TracBrowser for help on using the browser.