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 <joeyh@master.debian.org>
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 me.
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 ##############################################################################
30 # * Fakeroot and sudo fixes.
31 # * Run dpkg-gencontrol after debstd, and delete substvars during clean.
32 # * Clean up junk files in subdirs.
33 # * Modifications for multiple binary package support.
34 # * Call debstd after fixing file perms.
35 # * Don't pass package name to debstd + fixes for multi binary packages.
36 # * Use build-stamp instead of build.
37 # * New email address.
40 ##############################################################################
42 # Include config file.
45 # Generate a makefile (via configure scriopt or xmkmf).
47 ifeq ($(strip $(use_imakefile
)),y
)
53 # Preserve some files that may get deleted/overwritten/modified otherwise.
55 ifneq ($(strip $(preserve_files
)),)
56 $(foreach file
,$(preserve_files
),cp
$(file
) $(file
).preserved
;)
60 build-stamp
: preserve-stamp makefile-stamp
67 clean: preserve-stamp makefile-stamp
69 # Do actual cleaning up here.
72 -find .
-name
'\#*\#' -o
-name
'*~' -o
-name
'DEADJOE' -exec
rm -f
{} \
;
73 -rm -f debian
/files
* debian
/substvars debian
/*.substvars
$(clean_files
)
75 # Remove Makefile that xmkmf creates.
76 ifeq ($(strip $(use_imakefile
)),y
)
79 # If we preserved some files, we need to restore them now.
80 ifneq ($(strip $(preserve_files
)),)
81 $(foreach file
,$(preserve_files
),mv
-f
$(file
).preserved
$(file
); )
83 -rm -f preserve-stamp makefile-stamp
85 # Build architecture-independent files here.
86 # (not yet set up to be used)
90 # Build architecture-dependent files here.
95 # Set permissions and check package for problems, then build package.
96 @if
[ "`whoami`" != root
]; then \
97 echo
-e
"\n ** Enter root password to set file permissions."; \
98 sudo debian
/rules setperms
; \
100 debian
/rules setperms
; \
103 # This must be run suid root, it sets the file permissions in debian/tmp
105 chown
-R root.root debian
/tmp
106 chmod
-R g-ws debian
/tmp
107 # Debstd handles lots of nasty details. This requires that the debmake
108 # package is installed.
109 -debstd
$(debstd
) $(docs
)
110 dpkg-gencontrol
-p
$(package
)
112 dpkg
--build debian
/tmp ..
115 @
test -e
$(test_file
) -a
-f debian
/rules ||
(echo
-e
"\n\
116 ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\
117 ** Either the package is not unpacked in this directory, or\n\
118 ** an incorrect test_file is specified in debian/config.\n" && false
)
121 # This rm's the debian/tmp directory, and any other directories specified in
124 -rm -rf debian
/tmp
>/dev
/null
2>&1
125 @if
[ -d debian
/tmp
-o
-n
"$(tmp_dirs)" ]; then \
126 if
[ "`whoami`" != root
]; then \
127 echo
-e
"\n ** Enter root password to remove temporary directories $(tmp_dirs)"; \
128 sudo
rm -rf debian
/tmp
$(tmp_dirs
); \
130 rm -rf debian
/tmp
$(tmp_dirs
); \
135 binary
: binary-indep binary-arch
136 .PHONY
: clean setperms binary