~ubuntu-branches/ubuntu/hardy/slack/hardy-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Pollock
  • Date: 2007-10-27 16:14:42 UTC
  • Revision ID: james.westby@ubuntu.com-20071027161442-z3wjuy3juutuxu7m
Tags: upstream-0.14.1
ImportĀ upstreamĀ versionĀ 0.14.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# debian.rules file for slack
 
3
# $Id: rules,v 1.3 2006/09/22 07:38:53 alan Exp $
 
4
# Copyright 2004 Alan Sundell <alan@sundell.net>
 
5
# Based on the debian.rules file for rsync.
 
6
#   Copyright 1996 by Philip Hands.
 
7
#   Copyright 2001 Colin Walters <walters@debian.org>
 
8
# Based on the  sample debian.rules file - for GNU Hello (1.3).
 
9
#   Copyright 1994,1995 by Ian Jackson.
 
10
# I hereby give you perpetual unlimited permission to copy,
 
11
# modify and relicense this file, provided that you do not remove
 
12
# my name from the file itself.  (I assert my moral right of
 
13
# paternity under the Copyright, Designs and Patents Act 1988.)
 
14
 
 
15
 
 
16
SHELL = /bin/bash
 
17
INSTALL = install
 
18
INSTALL_FILE = $(INSTALL) -p    -o root -g root  -m  644
 
19
INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
 
20
INSTALL_SCRIPT = $(INSTALL) -p    -o root -g root  -m  755
 
21
INSTALL_DIR = $(INSTALL) -p -d -o root -g root  -m  755
 
22
INSTALL_PRIV_DIR = $(INSTALL) -p -d -o root -g root  -m  700
 
23
 
 
24
# backwards compatibility stuff, from dpkg-architecture manpage
 
25
DEB_BUILD_ARCH := $(shell dpkg --print-installation-architecture)
 
26
DEB_BUILD_GNU_CPU := $(patsubst hurd-%,%,$(DEB_BUILD_ARCH))
 
27
ifeq ($(filter-out hurd-%,$(DEB_BUILD_ARCH)),)
 
28
DEB_BUILD_GNU_SYSTEM := gnu
 
29
else
 
30
DEB_BUILD_GNU_SYSTEM := linux
 
31
endif
 
32
DEB_BUILD_GNU_TYPE=$(DEB_BUILD_GNU_CPU)-$(DEB_BUILD_GNU_SYSTEM)
 
33
 
 
34
DEB_HOST_ARCH=$(DEB_BUILD_ARCH)
 
35
DEB_HOST_GNU_CPU=$(DEB_BUILD_GNU_CPU)
 
36
DEB_HOST_GNU_SYSTEM=$(DEB_BUILD_GNU_SYSTEM)
 
37
DEB_HOST_GNU_TYPE=$(DEB_BUILD_GNU_TYPE)
 
38
 
 
39
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
40
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
41
 
 
42
 
 
43
build:
 
44
        touch build
 
45
 
 
46
clean: checkdir
 
47
        -rm -f build
 
48
        -rm -rf *~ debian/tmp debian/*~ debian/*.bak debian/files* debian/substvars
 
49
 
 
50
binary-indep:   checkroot build
 
51
        -rm -rf debian/tmp
 
52
        $(INSTALL_DIR)  debian/tmp \
 
53
                        debian/tmp/DEBIAN \
 
54
                        debian/tmp/usr/bin \
 
55
                        debian/tmp/usr/sbin \
 
56
                        debian/tmp/usr/share/doc/slack \
 
57
                        debian/tmp/usr/lib/slack \
 
58
                        debian/tmp/etc \
 
59
                        debian/tmp/var/lib \
 
60
                        debian/tmp/var/cache
 
61
        $(MAKE) install DESTDIR=`pwd`/debian/tmp
 
62
        $(INSTALL_FILE) debian/changelog debian/tmp/usr/share/doc/slack/changelog.Debian
 
63
        $(INSTALL_FILE) README ChangeLog TODO debian/tmp/usr/share/doc/slack/
 
64
        gzip -9fr `find debian/tmp/usr/share/doc/ debian/tmp/usr/share/man/ -type f`
 
65
        $(INSTALL_SCRIPT) debian/prerm   debian/tmp/DEBIAN
 
66
        (cd debian/tmp; find ./etc -type f | sed s,.,,) > debian/tmp/DEBIAN/conffiles
 
67
        chown -R root.root debian/tmp
 
68
        dpkg-gencontrol -isp
 
69
        dpkg --build debian/tmp ..
 
70
 
 
71
binary-arch:    checkroot clean build
 
72
# nothing to do
 
73
 
 
74
# Below here is fairly generic really
 
75
 
 
76
binary:         binary-indep binary-arch
 
77
 
 
78
checkdir:
 
79
        @test -f debian/rules
 
80
 
 
81
checkroot: checkdir
 
82
        @test 0 = `id -u` || { echo "Error: not super-user"; exit 1; }
 
83
 
 
84
.PHONY: binary binary-arch binary-indep clean checkroot checkdir