~ubuntu-branches/ubuntu/gutsy/vm/gutsy

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Manoj Srivastava
  • Date: 2005-05-02 23:57:59 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050502235759-lsq60hinwkchrbxp
Tags: 7.19-4
* Bug fix: "vm: Please do not discriminate against XEmacs", thanks to
  Dirk Eddelbuettel. Well, back in the mists of time, VM was packaged to
  be byte-compiled for XEmacs, but the XEmacs maintainer at that time
  asked me to cease and desist. Times change, so that is reverted. 
                                                        (Closes: #306876).
* Bug fix: "vm: purge doesn't", thanks to Ian Zimmerman. This should be
  better.                                               (Closes: #303519).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/make -f
2
 
############################ -*- Mode: Makefile -*- ###########################
3
 
## rules ---
4
 
## Author           : Manoj Srivastava ( srivasta@tiamat.datasync.com )
5
 
## Created On       : Tue Feb 11 15:39:24 1997
6
 
## Created On Node  : tiamat.datasync.com
 
1
#! /usr/bin/make -f
 
2
############################ -*- Mode: Makefile; coding: utf-8 -*- ###########################
 
3
## rules --- 
 
4
## Author           : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com ) 
 
5
## Created On       : Fri Nov 14 12:33:34 2003
 
6
## Created On Node  : glaurung.green-gryphon.com
7
7
## Last Modified By : Manoj Srivastava
8
 
## Last Modified On : Mon Mar 19 09:43:56 2001
 
8
## Last Modified On : Tue Nov 18 17:46:22 2003
9
9
## Last Machine Used: glaurung.green-gryphon.com
10
 
## Update Count     : 116
 
10
## Update Count     : 70
11
11
## Status           : Unknown, Use with caution!
12
 
## HISTORY          :
13
 
## Description      :
 
12
## HISTORY          : 
 
13
## Description      : 
 
14
## 
 
15
## arch-tag: 9a5063f4-1e20-4fff-b22a-de94c1e3d954
 
16
## 
 
17
## This program is free software; you can redistribute it and/or modify
 
18
## it under the terms of the GNU General Public License as published by
 
19
## the Free Software Foundation; either version 2 of the License, or
 
20
## (at your option) any later version.
 
21
##
 
22
## This program is distributed in the hope that it will be useful,
 
23
## but WITHOUT ANY WARRANTY; without even the implied warranty of
 
24
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
25
## GNU General Public License for more details.
 
26
##
 
27
## You should have received a copy of the GNU General Public License
 
28
## along with this program; if not, write to the Free Software
 
29
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14
30
##
15
31
###############################################################################
16
 
# The name of the package (for example, `emacs').
17
 
package = $(shell grep Source debian/control | sed 's/^Source: //')
18
 
version := $(shell perl -n0777e 'if ($$. == 1 && m/\(([\S]+)\)/o){print "$$1\n";}' debian/changelog)
19
 
 
20
 
ifdef ARCH
21
 
  ha:=-a$(ARCH)
22
 
endif
23
 
 
24
 
# set the dpkg-architecture vars
25
 
export DEB_BUILD_ARCH      := $(shell dpkg-architecture $(ha) \
26
 
                                        -qDEB_BUILD_ARCH)
27
 
export DEB_BUILD_GNU_CPU   := $(shell dpkg-architecture $(ha) \
28
 
                                        -qDEB_BUILD_GNU_CPU)
29
 
export DEB_BUILD_GNU_SYSTEM:= $(shell dpkg-architecture $(ha) \
30
 
                                        -qDEB_BUILD_GNU_SYSTEM)
31
 
export DEB_BUILD_GNU_TYPE  := $(shell dpkg-architecture $(ha) \
32
 
                                        -qDEB_BUILD_GNU_TYPE)
33
 
export DEB_HOST_ARCH       := $(shell dpkg-architecture $(ha) \
34
 
                                        -qDEB_HOST_ARCH)
35
 
export DEB_HOST_GNU_CPU    := $(shell dpkg-architecture $(ha) \
36
 
                                        -qDEB_HOST_GNU_CPU)
37
 
export DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture $(ha) \
38
 
                                        -qDEB_HOST_GNU_SYSTEM)
39
 
export DEB_HOST_GNU_TYPE   := $(shell dpkg-architecture $(ha) \
40
 
                                        -qDEB_HOST_GNU_TYPE)
41
 
 
42
 
#
43
 
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
44
 
#                          sed 's/^Version: *//')
45
 
#
46
 
 
47
 
FILES_TO_CLEAN  := vm.elc vm.info* debian/files debian/substvars \
48
 
                   debian/buildinfo base64-decode base64-encode \
49
 
                   qp-decode qp-encode
50
 
STAMPS_TO_CLEAN := stamp-binary stamp-build stamp-html stamp-el \
51
 
                   stamp-codec stamp-info
52
 
DIRS_TO_CLEAN   := debian/tmp debian/tmp-el debian/html debian/codec
53
 
 
54
 
# Location of the source dir
55
 
SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
56
 
TMPTOP    := $(SRCTOP)/debian/tmp
57
 
INFODIR   := $(TMPTOP)/usr/share/info
58
 
DOCDIR    := $(TMPTOP)/usr/share/doc/$(package)
59
 
DOCBASE   := $(TMPTOP)/usr/share/doc-base
60
 
MENUDIR   := $(TMPTOP)/usr/lib/menu
61
 
LISPDIR   := $(TMPTOP)/usr/share/emacs/site-lisp/$(package)
62
 
PIXMAPDIR := $(LISPDIR)/etc
63
 
STARTDIRS := $(TMPTOP)/etc/emacs19/site-start.d
64
 
COMPILEDIR:= $(TMPTOP)/usr/lib/emacsen-common/packages/
65
 
STARTFILE := $(package)-init.el
66
 
 
67
 
MTMPTOP    := $(SRCTOP)/debian/codec
68
 
MDOCDIR    := $(MTMPTOP)/usr/share/doc/mime-codecs
69
 
MBINDIR    := $(MTMPTOP)/usr/bin
70
 
MMANDIR    := $(MTMPTOP)/usr/share/man
71
 
MMAN1DIR    := $(MMANDIR)/man1
72
 
LINTIANDIR:= $(TMPTOP)/usr/share/lintian/overrides
73
 
 
74
 
CC          := gcc
75
 
CFLAGS      := -O2 -Wall
76
 
 
77
 
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
78
 
  CFLAGS += -g
79
 
endif
80
 
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
81
 
  STRIP = -s
82
 
endif
83
 
 
84
 
# install commands
85
 
install_file    := install -p    -o root -g root -m 644
86
 
install_program := install -p    -o root -g root -m 755
87
 
make_directory  := install -p -d -o root -g root -m 755
88
 
 
89
 
all build: stamp-build
90
 
stamp-build:
91
 
        $(checkdir)
92
 
# This used to be needed for older dpkg-sources
93
 
#-test ! -d debian/examples && $(MAKE) -f debian/rules explode
94
 
#$(MAKE) INFODIR=$(INFODIR) LISPDIR=$(LISPDIR) PIXMAPDIR=$(PIXMAPDIR);
95
 
        $(CC) $(CFLAGS) base64-decode.c -o base64-decode
96
 
        $(CC) $(CFLAGS) base64-encode.c -o base64-encode
97
 
        $(CC) $(CFLAGS) qp-decode.c     -o qp-decode
98
 
        $(CC) $(CFLAGS) qp-encode.c     -o qp-encode
99
 
        dpkg -l gcc perl dpkg 'libc*' binutils ldso make dpkg-dev |\
100
 
         awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' > \
101
 
          debian/buildinfo
102
 
        touch stamp-build
103
 
 
104
 
clean:
105
 
        $(checkdir)
106
 
        -rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
107
 
        -rm -rf $(DIRS_TO_CLEAN)
108
 
        -$(MAKE) clean
109
 
        -rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
110
 
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
111
 
                -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
112
 
 
113
 
implode:
114
 
        $(checkdir)
115
 
        -test -d debian/examples && (cd debian && \
116
 
           tar zfc debian.tar.gz examples && \
117
 
             uuencode debian.tar.gz debian.tar.gz > debian.uue \
118
 
               && rm -f debian.tar.gz )
119
 
explode:
120
 
        $(checkdir)
121
 
        -test ! -d debian/examples && (cd debian && uudecode debian.uue \
122
 
           && tar zfx debian.tar.gz && rm -f debian.tar.gz )
123
 
 
124
 
binary: binary-arch binary-indep
125
 
binary-arch: build stamp-codecs
126
 
 
127
 
 
128
 
# builds the architecture dependent part
129
 
stamp-codecs: build
130
 
        @test 0 = $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
131
 
                   (echo need root priviledges; exit 1)
132
 
        $(checkdir)
133
 
        rm -rf $(MTMPTOP) debian/codec.deb
134
 
        $(make_directory)  $(MTMPTOP)/DEBIAN
135
 
        $(make_directory)  $(MMAN1DIR)
136
 
        $(make_directory)  $(MBINDIR)
137
 
        $(make_directory)  $(MDOCDIR)
138
 
        $(make_directory)  $(LINTIANDIR)
139
 
        echo               'mime-codecs: postinst-does-not-set-usr-doc-link' \
140
 
                             >> $(LINTIANDIR)/mime-codecs
141
 
        $(install_program) debian/postinst.codec $(MTMPTOP)/DEBIAN/postinst
142
 
        $(install_program) debian/prerm.codec    $(MTMPTOP)/DEBIAN/prerm
143
 
        $(install_program) $(STRIP)              base64-decode $(MBINDIR)
144
 
        $(install_program) $(STRIP)              base64-encode $(MBINDIR)
145
 
        $(install_program) $(STRIP)              qp-decode     $(MBINDIR)
146
 
        $(install_program) $(STRIP)              qp-encode     $(MBINDIR)
147
 
        $(install_file)    base64-decode.1       $(MMAN1DIR)
148
 
        $(install_file)    base64-encode.1       $(MMAN1DIR)
149
 
        $(install_file)    qp-decode.1           $(MMAN1DIR)
150
 
        $(install_file)    qp-encode.1           $(MMAN1DIR)
151
 
        $(install_file)    debian/README.debian  $(MDOCDIR)
152
 
        $(install_file)    debian/changelog      $(MDOCDIR)/changelog.Debian
153
 
        $(install_file)    debian/buildinfo      $(MDOCDIR)/buildinfo.Debian
154
 
        gzip -9fqr         $(MMANDIR)
155
 
        gzip -9fqr         $(MDOCDIR)
156
 
        $(install_file)    debian/copyright      $(MDOCDIR)
157
 
        dpkg-shlibdeps     base64-decode base64-encode qp-decode qp-encode
158
 
        dpkg-gencontrol    -pmime-codecs -isp -P$(MTMPTOP)
159
 
        chown -R root.root $(MTMPTOP)
160
 
        chmod -R go=rX     $(MTMPTOP)
161
 
        dpkg --build       $(MTMPTOP) ..
162
 
        touch              stamp-codecs
163
 
 
164
 
binary-indep: build html info stamp-binary
165
 
 
166
 
stamp-binary: html info
167
 
        @test 0 = $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
168
 
                   (echo need root priviledges; exit 1)
169
 
        $(checkdir)
170
 
        rm -rf $(TMPTOP)  debian/tmp.deb
171
 
        $(make_directory)  $(TMPTOP)/DEBIAN
172
 
        $(make_directory)  $(INFODIR)
173
 
        $(make_directory)  $(LISPDIR)
174
 
        $(make_directory)  $(PIXMAPDIR)
175
 
        $(make_directory)  $(STARTDIRS)
176
 
        $(make_directory)  $(DOCDIR)/examples
177
 
        $(make_directory)  $(PIXMAPDIR)
178
 
        $(make_directory)  $(DOCBASE)
179
 
        $(make_directory)  $(MENUDIR)
180
 
        $(make_directory)  $(COMPILEDIR)/install
181
 
        $(make_directory)  $(COMPILEDIR)/remove
182
 
        $(make_directory)  $(LINTIANDIR)
183
 
        echo               "vm: postinst-does-not-set-usr-doc-link" \
184
 
                             >> $(LINTIANDIR)/vm
185
 
        $(install_file)    make-autoloads        $(LISPDIR)
186
 
        $(install_file)    Makefile *.el         $(LISPDIR)
187
 
        $(install_file)    debian/$(STARTFILE)   $(LISPDIR)
188
 
        $(install_file)    pixmaps/*.xbm         $(PIXMAPDIR)
189
 
        $(install_file)    pixmaps/*.xpm         $(PIXMAPDIR)
190
 
        $(install_file)    vm.info*              $(INFODIR)/
191
 
        $(install_file)    debian/changelog      $(DOCDIR)/changelog.Debian
192
 
        $(install_file)    debian/README.debian  $(DOCDIR)
193
 
        $(install_file)    debian/README.hilit19 $(DOCDIR)
194
 
        $(install_file)    vm-vars.el            $(DOCDIR)
195
 
        $(install_file)    README                $(DOCDIR)
196
 
        $(install_file)    debian/buildinfo      $(DOCDIR)/buildinfo.Debian
197
 
        (cd debian/examples;  tar cf - * | (cd $(DOCDIR)/examples;tar xf -))
198
 
        (cd pixmaps;          tar cf - * | (cd $(PIXMAPDIR);      tar xf -))
199
 
        rm -rf             $(DOCDIR)/examples/CVS
200
 
        gzip -9fqr         $(INFODIR)/
201
 
        gzip -9frq         $(DOCDIR)/
202
 
# Make sure the copyright file is not compressed
203
 
        $(install_file)    debian/copyright      $(DOCDIR)/copyright
204
 
        $(install_file)    debian/html/vm_*.html $(DOCDIR)/
205
 
        $(install_file)    debian/menuentry      $(MENUDIR)/$(package)
206
 
        $(install_file)    debian/docentry       $(DOCBASE)/$(package)
207
 
        $(install_program) debian/postinst       $(TMPTOP)/DEBIAN/postinst
208
 
        $(install_program) debian/prerm          $(TMPTOP)/DEBIAN/prerm
209
 
        $(install_program) debian/postrm         $(TMPTOP)/DEBIAN/postrm
210
 
        sed                -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \
211
 
                              debian/emacsen.install > \
212
 
                           $(COMPILEDIR)/install/$(package)
213
 
        sed                -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \
214
 
                              debian/emacsen.remove  > \
215
 
                           $(COMPILEDIR)/remove/$(package)
216
 
        chmod 0755         $(COMPILEDIR)/install/$(package) \
217
 
                           $(COMPILEDIR)/remove/$(package)
218
 
        dpkg-gencontrol    -pvm -isp -P$(TMPTOP)
219
 
        chown -R root.root $(TMPTOP)
220
 
        chmod -R go=rX     $(TMPTOP)
221
 
        dpkg --build       $(TMPTOP) ..
222
 
        touch              stamp-binary
223
 
 
224
 
html: stamp-html
225
 
 
226
 
stamp-html:
227
 
        $(checkdir)
228
 
        $(make_directory) debian/html
229
 
        (cd debian/html; \
230
 
         texi2html -doctype html2 -expandinfo -menu \
231
 
                   -split_chapter -verbose  ../../vm.texinfo)
232
 
        touch stamp-html
233
 
 
234
 
info: stamp-info
235
 
 
236
 
stamp-info:
237
 
        $(checkdir)
238
 
        $(MAKE) vm.info
239
 
        touch stamp-info
240
 
 
241
 
define checkdir
242
 
        @test -f debian/rules -a -f vm-license.el || \
243
 
          (echo Not in correct source directpry; exit 1)
244
 
endef
245
 
 
246
 
# Below here is fairly generic really
247
 
 
248
 
source diff:
249
 
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
250
 
 
251
 
.PHONY: binary binary-arch binary-indep clean implode explode
 
32
 
 
33
# Include dpkg-architecture generated variables
 
34
include debian/common/archvars.mk
 
35
 
 
36
# Set variables with information extracted from control and changelog files
 
37
include debian/common/pkgvars.mk
 
38
 
 
39
# variables useful for perl packages
 
40
include debian/common/perlvars.mk
 
41
 
 
42
# Install commands
 
43
include debian/common/install_cmds.mk
 
44
 
 
45
include debian/local-vars.mk
 
46
 
 
47
include debian/common/copt.mk
 
48
 
 
49
include debian/common/automake.mk
 
50
 
 
51
 
 
52
 
 
53
all:
 
54
        @echo nothing to be done
 
55
 
 
56
include debian/common/targets.mk
 
57
 
 
58
include debian/local.mk
 
59
 
 
60
 
 
61
#Local variables:
 
62
#mode: makefile
 
63
#End: