3 # Script to be called from debian/rules to setup all the debian specifc
5 # Christoph Lameter, <clameter@debian.org> October 10, 1996
7 # All the parameters are documentation files to be installed.
8 # (but doc files can also be listed in debian/docs)
10 # This has been gutted and extensively rewritten to function as a debhelper
11 # command by Joey Hess.
13 # Pre-parse command line before we load dh_lib, becuase we use a
14 # different style of arguments.
27 *) collect="$collect$i "
33 PATH=debian:$PATH:/usr/lib/debhelper
36 # Tolerate old style debstd invocations
37 if [ "$DH_FIRSTPACKAGE" = "$1" ]; then
43 # debinit handles the installation of an init.d script
45 # $1= name in /etc/init.d
48 # $4 = extra params for debhelper
53 INITPARAMS=`grep "^FLAGS=" $2` || true
54 if [ "$INITPARAMS" != "" ]; then
55 INITPARAMS=`expr "$INITPARAMS" : 'FLAGS="\(.*\)"'` || true
56 if [ "$INITPARAMS" ]; then
57 INITPARAMS="--update-rcd-params='$INITPARAMS'"
61 if grep -q NO_RESTART_ON_UPGRADE $2; then
62 doit "dh_installinit --no-restart-on-upgrade -p$PPACKAGE $INITPARAMS --init-script=$SCRIPT $4"
64 doit "dh_installinit -p$PPACKAGE $INITPARAMS --init-script=$SCRIPT $4"
68 # Package specific things
70 # The first parameter is the package name
71 # The second parameter is the directory name of the temp directory
72 # The third parameter is the prefix for all configuration files to be processed
80 # Deal with scripts in etc directories
81 if [ -f $3/rc.boot ]; then
82 warning "file $3/rc.boot was ignored."
85 # etc files that could need some tweaking
86 for i in services inittab crontab protocols profile shells rpc shells \
87 syslog.conf conf.modules modules aliases diversions inetd.conf \
88 X11/Xresources X11/config X11/window-managers X11/xinit purge ; do
90 warning "file $3$i was ignored."
94 if [ -f $3init.d ]; then
95 debinit $1 $3init.d $1 ""
98 # The case of a daemon without the final d
99 if [ -f $3init ]; then
100 X=`expr $1 : '\(.*\)d$'` || true
102 debinit $X $3init $1 "--remove-d"
106 if [ -f $3info ]; then
107 warning "debhelper does not yet support info files, so $3info was ignored."
110 X=`find $2 -type f -perm +111 2>/dev/null | tr "\n" " "`
112 BINPATH="`expr "$i" : "$2/\(.*\)/.*"`"
113 BINNAME="`expr "$i" : "$2/.*/\(.*\)"`"
115 # Check if manpages exist
117 DEBIAN|etc/rc.boot|usr/lib/cgi-bin|etc/init.d|etc/cron.*|usr/lib/lib*|usr/lib/*) SECTION=""
119 sbin|usr/sbin) SECTION="8"
121 usr/X11R6/bin) SECTION="1x"
123 bin|usr/bin) SECTION="1"
125 usr/games) SECTION="6"
130 if [ "$SECTION" ]; then
131 Y=`find $2/usr/man $2/usr/X11R6/man -name "$BINNAME.*" 2>/dev/null` || true
132 if [ "$Y" = "" ]; then
133 if [ "$UNDOC" ]; then
134 doit "dh_undocumented -p$CPACKAGE $BINNAME.$SECTION"
146 package $i debian/$i "debian/$i."
147 if [ -x debian/$i.prebuild ]; then
148 warning "file debian/$i.prebuild ignored"
152 if [ -f debian/clean ]; then
153 warning "file debian/clean ignored"
155 package $BASE debian/tmp "debian/"
158 # Special case of changelog
160 if echo "$1" | egrep -qi "change|news|history" ; then
166 doit "dh_installdirs" # here just to make the debian/tmp, etc directories.
167 doit "dh_installdocs $*"
168 doit "dh_installexamples"
169 doit "dh_installchangelogs $changelogfile"
170 doit "dh_installmenu"
171 doit "dh_installcron"
174 if [ "$NOAUTOMAN" = "" ]; then
175 doit "dh_installmanpages -p$DH_FIRSTPACKAGE"
178 packages $DH_DOPACKAGES
183 if [ ! "$nocompress" ]; then
188 doit "dh_suidregister"
193 # Check to see if the install scripts have #DEBHELPER# in them, if not,
195 for PACKAGE in $DH_DOPACKAGES; do
196 for file in postinst postrm preinst prerm; do
197 f="`pkgfile $PACKAGE $file`"
199 filelist="$filelist$f "
203 if [ "$filelist" ]; then
204 warning "The following scripts do not contain \"#DEBHELPER#\" in them,"
205 warning "and so debhelper will not automatically add commands to them:"
211 if [ "$SUMS" = "" ]; then
215 # This causes the main binary package to be built, which
216 # real debstd does not do. Shouldn't be a problem though,
217 # if that package gets built twice.