2
##############################################################################
3
# Generic debian/rules file. Based on:
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.)
12
# Heavily modified by Joey Hess <jeh22@cornell.edu>
14
##############################################################################
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.
20
# (Currently not handled: multiple binary packages from 1 source package,
21
# and binary-indep rule.)
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.
27
##############################################################################
29
# Include config file.
32
# Generate a makefile (via configure scriopt or xmkmf).
34
ifeq ($(strip $(use_imakefile)),y)
40
# Preserve some files that may get deleted/overwritten/modified otherwise.
42
ifneq ($(strip $(preserve_files)),)
43
$(foreach file,$(preserve_files),-cp $(file) $(file).preserved)
47
build: preserve-stamp makefile-stamp
52
clean: preserve-stamp makefile-stamp
54
# Do actual cleaning up here.
57
-rm -rf *~ debian/*~ debian/files* $(clean_files)
59
# Remove Makefile that xmkmf creates.
60
ifeq ($(strip $(use_imakefile)),y)
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))
67
-rm -f preserve-stamp makefile-stamp
69
# Build architecture-independent files here.
70
# (not yet set up to be used)
74
# Build architecture-dependent files here.
78
install -d debian/tmp debian/tmp/DEBIAN debian/tmp/usr/share/doc/$(package)
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)/*
87
# Install copyright file, don't compress.
88
ifneq ($(strip $(copyright)),)
89
cp $(copyright) debian/tmp/usr/share/doc/$(package)/copyright
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)/*
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)
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 ..
115
# This must be run suid root, it sets the file permissions in debian/tmp
117
chown -R root.root debian/tmp
118
chmod -R g-ws debian/tmp
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)
128
# This rm's the debian/tmp directory.
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."; \
139
binary: binary-indep binary-arch
140
.PHONY: clean setperms binary