tags 480108 +patch
thanks
It seems this problem is actually caused by an over-zelous distclean
target in the doc directories makefile (it removes a load of html files
that are not generated at least not as part of the normal build
process). I tried to fix this in the upstream build system but that
didn't seem to work and regenerating the autohell stuff is often
undesirable anyway.
So instead I have solved the problem by a small workarround in
debian/rules. Namely replacing that makefile with a dummy before calling
make distclean and cleaning up the dummy afterwards. I have also done
some other cleanup related fixes so that the result of extracting the
source package then doing debian/rules clean is the same as extracting
the source package then doing dpkg-buildpackage then doing debian/rules
clean.
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001
include /usr/share/quilt/quilt.make
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
INSTALL_PROGRAM = /usr/bin/install
BUILD_DIR = $(CURDIR)/debian/tmp
LIB_BASE_DIR = $(CURDIR)/debian/libcherokee-base0
DEV_BASE_DIR = $(CURDIR)/debian/libcherokee-base0-dev
LIB_CLIENT_DIR = $(CURDIR)/debian/libcherokee-client0
DEV_CLIENT_DIR = $(CURDIR)/debian/libcherokee-client0-dev
LIB_SERVER_DIR = $(CURDIR)/debian/libcherokee-server0
DEV_SERVER_DIR = $(CURDIR)/debian/libcherokee-server0-dev
LIB_CONFIG_DIR = $(CURDIR)/debian/libcherokee-config0
DEV_CONFIG_DIR = $(CURDIR)/debian/libcherokee-config0-dev
SERVER_DIR = $(CURDIR)/debian/cherokee
CGET_DIR = $(CURDIR)/debian/cget
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
export DEB_HOST_GNU_TYPE
export DEB_BUILD_GNU_TYPE
# Compiler flags to use
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
config.status: configure
dh_testdir
./configure --host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--enable-os-string="Debian GNU/Linux" \
--enable-pthreads \
--enable-tls=gnu \
--prefix=/usr \
--localstatedir=/var \
--mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info \
--sysconfdir=/etc \
--with-wwwroot=/var/www
build: patch build-stamp
build-stamp: $(QUILT_STAMPFN) build-arch build-indep
build-arch: build-arch-stamp
build-arch-stamp: config.status
$(MAKE)
# $(MAKE) test
touch build-arch-stamp
build-indep: build-indep-stamp
build-indep-stamp: config.status
#$(MAKE) doc
clean: unpatch
dh_testdir
dh_testroot
#the distclean target in the doc directory seems broken, replace the
#makefile with a dummy so it's broken distclean target doesn't get run
rm -f doc/Makefile
echo distclean: > doc/Makefile
[ ! -f Makefile ] || $(MAKE) distclean
#now get rid of the dummy makefile
rm -f doc/Makefile
rm -rf build-arch-stamp build-indep-stamp
# Cruft not cleaned by the build process
rm -fr cherokee/mime_grammar.output cherokee/icons_grammar.output
cherokee/config_protocol_grammar.output www/images
rm -f cherokee/loader.autoconf.h
rm -f cherokee/loader.autoconf.inc
rm -f cherokee/Makefile.MingW
rm -f cherokee.spec
rm -f windows/cherokee.nsi
dh_clean
install: install-indep install-arch
install-indep:
# debian/<package>-doc
#INSTALLDOC#
install-arch:
dh_testdir
dh_testroot
dh_clean -k -s
dh_installdirs -s
install -d $(BUILD_DIR)
$(MAKE) install INSTALL_PROGRAM=$(INSTALL_PROGRAM) CFLAGS="$(CFLAGS)"
DESTDIR=$(BUILD_DIR)
# FIX: Add a Debian look to the default page
/usr/bin/uudecode -o $(BUILD_DIR)/var/www/images/powered_by_debian.png
$(CURDIR)/debian/www/powered_by_debian.png.uu
rm $(BUILD_DIR)/var/www/index.html
install -m 644 $(CURDIR)/debian/www/cherokee.index.html
$(BUILD_DIR)/var/www/cherokee.index.html
# libcherokee-base0-dev - Development files
install -d $(DEV_BASE_DIR)/DEBIAN
install -d $(DEV_BASE_DIR)/usr/bin
install -d $(DEV_BASE_DIR)/usr/lib/pkgconfig
install -d $(DEV_BASE_DIR)/usr/include/cherokee
install -d $(DEV_BASE_DIR)/usr/share/doc/libcherokee-base0-dev
install -d $(DEV_BASE_DIR)/usr/share/aclocal
install -d $(DEV_BASE_DIR)/usr/share/man/man1
install $(CURDIR)/debian/README.docs
$(DEV_BASE_DIR)/usr/share/doc/libcherokee-base0-dev/
mv $(BUILD_DIR)/usr/lib/libcherokee-base.a
$(DEV_BASE_DIR)/usr/lib/
mv $(BUILD_DIR)/usr/lib/libcherokee-base.la
$(DEV_BASE_DIR)/usr/lib/
mv $(BUILD_DIR)/usr/lib/libcherokee-base.so
$(DEV_BASE_DIR)/usr/lib/
mv $(BUILD_DIR)/usr/include/cherokee/*
$(DEV_BASE_DIR)/usr/include/cherokee/
mv $(BUILD_DIR)/usr/bin/cherokee-config
$(DEV_BASE_DIR)/usr/bin
mv $(BUILD_DIR)/usr/share/man/man1/cherokee-config.1
$(DEV_BASE_DIR)/usr/share/man/man1/
mv $(BUILD_DIR)/usr/lib/pkgconfig/*
$(DEV_BASE_DIR)/usr/lib/pkgconfig/
mv $(BUILD_DIR)/usr/share/aclocal/*
$(DEV_BASE_DIR)/usr/share/aclocal/
# libcherokee-client0-dev - Development files for the client libraries
install -d $(DEV_CLIENT_DIR)/DEBIAN
install -d $(DEV_CLIENT_DIR)/usr/share/doc/libcherokee-client0-dev
install -d $(DEV_CLIENT_DIR)/usr/lib
install $(CURDIR)/debian/README.docs
$(DEV_CLIENT_DIR)/usr/share/doc/libcherokee-client0-dev/
mv $(BUILD_DIR)/usr/lib/libcherokee-client.a
$(DEV_CLIENT_DIR)/usr/lib
mv $(BUILD_DIR)/usr/lib/libcherokee-client.la
$(DEV_CLIENT_DIR)/usr/lib
mv $(BUILD_DIR)/usr/lib/libcherokee-client.so
$(DEV_CLIENT_DIR)/usr/lib
# libcherokee-config0-dev - Development files for the config libraries
install -d $(DEV_CONFIG_DIR)/DEBIAN
install -d $(DEV_CONFIG_DIR)/usr/share/doc/libcherokee-config0-dev
install -d $(DEV_CONFIG_DIR)/usr/lib
install $(CURDIR)/debian/README.docs
$(DEV_CONFIG_DIR)/usr/share/doc/libcherokee-config0-dev/
mv $(BUILD_DIR)/usr/lib/libcherokee-config.a
$(DEV_CONFIG_DIR)/usr/lib
mv $(BUILD_DIR)/usr/lib/libcherokee-config.la
$(DEV_CONFIG_DIR)/usr/lib
mv $(BUILD_DIR)/usr/lib/libcherokee-config.so
$(DEV_CONFIG_DIR)/usr/lib
# libcherokee-server0-dev - Development files for the server libraries
install -d $(DEV_SERVER_DIR)/DEBIAN
install -d $(DEV_SERVER_DIR)/usr/share/doc/libcherokee-server0-dev
install -d $(DEV_SERVER_DIR)/usr/lib
install $(CURDIR)/debian/README.docs
$(DEV_SERVER_DIR)/usr/share/doc/libcherokee-server0-dev/
mv $(BUILD_DIR)/usr/lib/libcherokee-server.a
$(DEV_SERVER_DIR)/usr/lib
mv $(BUILD_DIR)/usr/lib/libcherokee-server.la
$(DEV_SERVER_DIR)/usr/lib
mv $(BUILD_DIR)/usr/lib/libcherokee-server.so
$(DEV_SERVER_DIR)/usr/lib
# libcherokee-base0 - Runtime library
install -d $(LIB_BASE_DIR)/DEBIAN
install -d $(LIB_BASE_DIR)/usr/lib/
install -d $(LIB_BASE_DIR)/usr/share/doc/libcherokee-base0
install $(CURDIR)/debian/README.docs
$(LIB_BASE_DIR)/usr/share/doc/libcherokee-base0/
install -m644 debian/shlibs.libcherokee-base0
$(LIB_BASE_DIR)/DEBIAN/shlibs
mv $(BUILD_DIR)/usr/lib/libcherokee-base.so*
$(LIB_BASE_DIR)/usr/lib/
# libcherokee-client0 - Runtime library
install -d $(LIB_CLIENT_DIR)/DEBIAN
install -d $(LIB_CLIENT_DIR)/usr/lib
install -d $(LIB_CLIENT_DIR)/usr/share/doc/libcherokee-client0
install $(CURDIR)/debian/README.docs
$(LIB_CLIENT_DIR)/usr/share/doc/libcherokee-client0/
install -m644 debian/shlibs.libcherokee-client0
$(LIB_CLIENT_DIR)/DEBIAN/shlibs
mv $(BUILD_DIR)/usr/lib/libcherokee-client.so*
$(LIB_CLIENT_DIR)/usr/lib/
# libcherokee-config0 - Configuration-handling library
install -d $(LIB_CONFIG_DIR)/DEBIAN
install -d $(LIB_CONFIG_DIR)/usr/lib
install -d $(LIB_CONFIG_DIR)/usr/share/cherokee
install -d $(LIB_CONFIG_DIR)/usr/share/cherokee/admin
install -d $(LIB_CONFIG_DIR)/usr/share/doc/libcherokee-config0
install $(CURDIR)/debian/README.docs
$(LIB_CONFIG_DIR)/usr/share/doc/libcherokee-config0/
install -m644 debian/shlibs.libcherokee-config0
$(LIB_CONFIG_DIR)/DEBIAN/shlibs
mv $(BUILD_DIR)/usr/lib/libcherokee-config.so*
$(LIB_CONFIG_DIR)/usr/lib/
mv $(BUILD_DIR)/usr/share/cherokee/admin/server.py
$(LIB_CONFIG_DIR)/usr/share/cherokee/admin/
# We will use the 0.5-to-0.6 migration tool in Cherokee's preinst -
# Hence, cherokee will pre-depend on libcherokee-config0
install $(CURDIR)/contrib/05to06.py
$(LIB_CONFIG_DIR)/usr/share/cherokee/
install $(CURDIR)/debian/config_joiner
$(LIB_CONFIG_DIR)/usr/share/cherokee/
# libcherokee-server0 - Runtime library
install -d $(LIB_SERVER_DIR)/DEBIAN
install -d $(LIB_SERVER_DIR)/usr/lib/cherokee
install -d $(LIB_SERVER_DIR)/usr/share/cherokee
install -d $(LIB_SERVER_DIR)/usr/share/doc/libcherokee-server0
install $(CURDIR)/debian/README.docs
$(LIB_SERVER_DIR)/usr/share/doc/libcherokee-server0/
install -m644 debian/shlibs.libcherokee-server0
$(LIB_SERVER_DIR)/DEBIAN/shlibs
mv $(BUILD_DIR)/usr/lib/libcherokee-server.so*
$(LIB_SERVER_DIR)/usr/lib/
mv $(BUILD_DIR)/usr/share/cherokee/*
$(LIB_SERVER_DIR)/usr/share/cherokee/
mv $(BUILD_DIR)/usr/lib/cherokee/*
$(LIB_SERVER_DIR)/usr/lib/cherokee/
# cget - Downloader utility
install -d $(CGET_DIR)/DEBIAN
install -d $(CGET_DIR)/usr/bin
install -d $(CGET_DIR)/usr/share/doc/cget
install -d $(CGET_DIR)/usr/share/man/man1
install $(CURDIR)/debian/README.docs $(CGET_DIR)/usr/share/doc/cget/
mv $(BUILD_DIR)/usr/bin/cget
$(CGET_DIR)/usr/bin/
mv $(BUILD_DIR)/usr/share/man/man1/cget.1
$(CGET_DIR)/usr/share/man/man1/
# cherokee - Main binary package
# Whatever we still have in $(BUILD_DIR) will become the main Cherokee
# package
mv $(BUILD_DIR)/* $(SERVER_DIR)
# References to cherokee-panic have been shuffled elsewhere
mv $(SERVER_DIR)/usr/bin/cherokee-panic
$(SERVER_DIR)/usr/share/cherokee
# spawn-fcgi is handled through alternatives
mv $(SERVER_DIR)/usr/bin/spawn-fcgi
$(SERVER_DIR)/usr/bin/spawn-fcgi.cherokee
# Remove directories that have been emptied by shuffling around
# files to our other generated packages
rmdir --ignore-fail-on-non-empty $(SERVER_DIR)/usr/lib/cherokee \
$(SERVER_DIR)/usr/lib/pkgconfig \
$(SERVER_DIR)/usr/lib \
$(SERVER_DIR)/usr/include/cherokee \
$(SERVER_DIR)/usr/include \
$(SERVER_DIR)/usr/share/aclocal
# And create an empty directory for the log files
install -d $(SERVER_DIR)/var/log/cherokee
# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs AUTHORS debian/README_0.5_to_0.6
# dh_installexamples
# dh_installmenu
# dh_installdebconf
dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_python
dh_installdeb
dh_makeshlibs
dh_shlibdeps -L libcherokee-base0 -L libcherokee-server0 -L
libcherokee-client0 -L libcherokee-base0-dev -L libcherokee-server0-dev -L
libcherokee-client0-dev -L cget -L cherokee -l
debian/libcherokee-base0/usr/lib:debian/libcherokee-base0/usr/lib/cherokee:debian/libcherokee-client0/usr/lib:debian/libcherokee-client0/usr/lib/cherokee:debian/libcherokee-server0/usr/lib:debian/libcherokee-server0/usr/lib/cherokee
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
#### $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep
install-arch