~ubuntu-branches/ubuntu/hoary/pacman/hoary

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Joe Nahmias
  • Date: 2003-10-29 12:52:30 UTC
  • Revision ID: james.westby@ubuntu.com-20031029125230-kyl842evu7irna50
Tags: 10-15
* New Maintainer (closes: #182985).
* Update build system to use debhelper.
* debian/control: Std-Ver (bumped to 3.6.1).
* pacman.man: escaped bare dash.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
##############################################################################
3
 
# Generic debian/rules file. Based on:
4
 
#
5
 
#> Sample debian.rules file - for GNU Hello (1.3).
6
 
#> Copyright 1994,1995 by Ian Jackson.
7
 
#> I hereby give you perpetual unlimited permission to copy,
8
 
#> modify and relicense this file, provided that you do not remove
9
 
#> my name from the file itself.  (I assert my moral right of
10
 
#> paternity under the Copyright, Designs and Patents Act 1988.)
11
 
#
12
 
# Heavily modified by Joey Hess <jeh22@cornell.edu>
13
 
#
14
 
##############################################################################
15
 
#
16
 
# NOTE: You shouldn't have to edit this file. Edit debian/config instead.
17
 
# If you must edit this file to get your package to build properly, then
18
 
# I have failed. Let me know; mail jeh22@cornell.edu.
19
 
#
20
 
# (Currently not handled: multiple binary packages from 1 source package,
21
 
# and binary-indep rule.)
22
 
#
23
 
# NOTE: This file is designed so it doesn't need to be run as root. For
24
 
# actions that require that the user be root, the root password will be
25
 
# prompted for, if you're not already root.
26
 
#
27
 
##############################################################################
28
 
 
29
 
# Include config file.
30
 
include debian/config
31
 
 
32
 
# Generate a makefile (via configure scriopt or xmkmf).
33
 
makefile-stamp:
34
 
  ifeq ($(strip $(use_imakefile)),y)
 
2
# -*- makefile -*-
 
3
# Sample debian/rules that uses debhelper.
 
4
# GNU copyright 1997 to 1999 by Joey Hess.
 
5
 
 
6
# Uncomment this to turn on verbose mode.
 
7
#export DH_VERBOSE=1
 
8
 
 
9
CFLAGS = -Wall -g
 
10
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
11
        CFLAGS += -O0
 
12
else
 
13
        CFLAGS += -O2
 
14
endif
 
15
export CFLAGS
 
16
 
 
17
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 
18
        INSTALL_PROGRAM += -s
 
19
endif
 
20
 
 
21
build: build-stamp
 
22
build-stamp:
 
23
        dh_testdir
 
24
 
 
25
        # Add here commands to compile the package.
35
26
        xmkmf -a
36
 
  endif 
37
 
        $(use_configure)
38
 
        touch makefile-stamp
39
 
 
40
 
# Preserve some files that may get deleted/overwritten/modified otherwise.
41
 
preserve-stamp:
42
 
  ifneq ($(strip $(preserve_files)),)
43
 
        $(foreach file,$(preserve_files),-cp $(file) $(file).preserved)
44
 
  endif
45
 
        touch preserve-stamp
46
 
 
47
 
build: preserve-stamp makefile-stamp
48
 
        $(checkdir)
49
 
        $(build_command)
50
 
        touch build
51
 
 
52
 
clean: preserve-stamp makefile-stamp
53
 
        $(checkdir)
54
 
  # Do actual cleaning up here.
55
 
        -rm -f build
56
 
        $(clean_command)
57
 
        -rm -rf *~ debian/*~ debian/files* $(clean_files)
58
 
        $(clean_tmp)
59
 
  # Remove Makefile that xmkmf creates.
60
 
  ifeq ($(strip $(use_imakefile)),y)
61
 
        -rm -f Makefile
62
 
  endif
63
 
  # If we preserved some files, we need to restore them now.
64
 
  ifneq ($(strip $(preserve_files)),)
65
 
        $(foreach file,$(preserve_files),-mv -f $(file).preserved $(file))
66
 
  endif
67
 
        -rm -f preserve-stamp makefile-stamp
 
27
        $(MAKE)
 
28
 
 
29
        touch build-stamp
 
30
 
 
31
clean:
 
32
        dh_testdir
 
33
        dh_testroot
 
34
        rm -f build-stamp
 
35
 
 
36
        # Add here commands to clean up after the build process.
 
37
        -$(MAKE) clean
 
38
        rm -f Makefile
 
39
 
 
40
        dh_clean 
 
41
 
 
42
install: build
 
43
        dh_testdir
 
44
        dh_testroot
 
45
        dh_clean -k 
 
46
        dh_installdirs
 
47
 
 
48
        # Add here commands to install the package into debian/pacman.
 
49
#       $(MAKE) install DESTDIR=$(CURDIR)/debian/pacman
 
50
        dh_install
 
51
 
68
52
 
69
53
# Build architecture-independent files here.
70
 
# (not yet set up to be used)
71
 
binary-indep: build
72
 
        $(checkdir)
 
54
binary-indep: build install
 
55
# We have nothing to do by default.
73
56
 
74
57
# Build architecture-dependent files here.
75
 
binary-arch: build
76
 
        $(checkdir)
77
 
        $(clean_tmp)
78
 
        install -d debian/tmp debian/tmp/DEBIAN debian/tmp/usr/share/doc/$(package)
79
 
        $(install_command)
80
 
  # Compress manpages
81
 
        -gzip -9v -r debian/tmp/usr/share/man/ debian/tmp/usr/X11R6/man/
82
 
  # Install documentation files, compressed.
83
 
  ifneq ($(strip $(docs)),)
84
 
        cp $(docs) debian/tmp/usr/share/doc/$(package)
85
 
        gzip -9v debian/tmp/usr/share/doc/$(package)/*
86
 
  endif
87
 
  # Install copyright file, don't compress.
88
 
  ifneq ($(strip $(copyright)),)
89
 
        cp $(copyright) debian/tmp/usr/share/doc/$(package)/copyright
90
 
  endif
91
 
  # Install examples, compressed.
92
 
  ifneq ($(strip $(examples)),)
93
 
        install -d debian/tmp/usr/sharedoc/examples/$(package)
94
 
        cp $(examples) debian/tmp/usr/share/doc/examples/$(package)
95
 
        gzip -9v debian/tmp/usr/share/doc/examples/$(package)/*
96
 
  endif
97
 
  # Install other debian files if they exist.
98
 
        -install -m 644 debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
99
 
        -gzip -9v debian/tmp/usr/share/doc/$(package)/changelog.Debian
100
 
        -install -m 644 debian/conffiles debian/tmp/DEBIAN/conffiles
101
 
        -install -m 755 debian/preinst debian/tmp/DEBIAN/preinst
102
 
        -install -m 755 debian/postinst debian/tmp/DEBIAN/postinst
103
 
        -install -m 755 debian/prerm debian/tmp/DEBIAN/prerm
104
 
        -install -m 755 debian/postrm debian/tmp/DEBIAN/postrm
105
 
  # Generate control file.
106
 
        dpkg-shlibdeps $(binfiles)
107
 
        dpkg-gencontrol -isp
108
 
  # Set permissions.
109
 
        @[ "`whoami`" != root ] && \
110
 
                echo -e "\n ** Enter root password to set file permissions."; \
111
 
        debian/rules setperms
112
 
  # Actually build the .deb file.
113
 
        dpkg --build debian/tmp ..
114
 
 
115
 
# This must be run suid root, it sets the file permissions in debian/tmp
116
 
setperms:
117
 
        chown -R root.root debian/tmp
118
 
        chmod -R g-ws debian/tmp
119
 
        $(ch_commands)
120
 
 
121
 
define checkdir
122
 
        @test -f $(test_file) -a -f debian/rules || (echo -e "\n\
123
 
        ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\
124
 
        ** Either \"$(package)\" is not unpacked in this directory, or\n\
125
 
        ** an incorrect test_file is specified in debian/config.\n" && false)
126
 
endef
127
 
 
128
 
# This rm's the debian/tmp directory.
129
 
define clean_tmp
130
 
        -rm -rf debian/tmp >/dev/null 2>&1
131
 
        @if [ -d debian/tmp ]; then \
132
 
                if  [ "`whoami`" != root ]; then \
133
 
                        echo -e "\n ** Enter root password to remove debian/tmp."; \
134
 
                fi; \
135
 
                rm -rf debian/tmp; \
136
 
        fi
137
 
endef
 
58
binary-arch: build install
 
59
        dh_testdir
 
60
        dh_testroot
 
61
        dh_installchangelogs 
 
62
        dh_installdocs
 
63
        dh_installexamples
 
64
        dh_installmenu
 
65
        dh_installman
 
66
        dh_link
 
67
        dh_strip
 
68
        dh_compress
 
69
        dh_fixperms
 
70
        dh_installdeb
 
71
        dh_shlibdeps
 
72
        dh_gencontrol
 
73
        dh_md5sums
 
74
        dh_builddeb
138
75
 
139
76
binary: binary-indep binary-arch
140
 
.PHONY: clean setperms binary
 
77
.PHONY: build clean binary-indep binary-arch binary install