1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
|
#!/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/cherokee-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
rm -f config.log
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)
# Move the generated webpage to its proper location - We will set up
# the symlinks, if needed, in the postinst. The package is still
# generated with wwwroot=/var/www as it is mentioned in several places
# (i.e. configurations) useful to us.
install -d $(BUILD_DIR)/usr/share/cherokee/default-site
mv $(BUILD_DIR)/var/www/* $(BUILD_DIR)/usr/share/cherokee/default-site/
# Add the Debian logo for the default page
/usr/bin/uudecode -o $(BUILD_DIR)/usr/share/cherokee/default-site/cherokee-images/powered_by_debian.png $(CURDIR)/debian/powered_by_debian.png.uu
# 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 configuration versions 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/
install $(CURDIR)/contrib/06to07.py $(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/
# Just leave the webroot back in its place :-/
mv $(LIB_SERVER_DIR)/usr/share/cherokee/default-site $(BUILD_DIR)/usr/share/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
mv $(SERVER_DIR)/usr/share/man/man1/spawn-fcgi.1 $(SERVER_DIR)/usr/share/man/man1/spawn-fcgi.cherokee.1
# The binary is called cherokee-tweak, but the manpage is for
# cherokee_tweak. Grmbl.
mv $(SERVER_DIR)/usr/share/man/man1/cherokee_tweak.1 $(SERVER_DIR)/usr/share/man/man1/cherokee-tweak.1
# 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_pysupport /usr/share/cherokee/admin
# dh_python
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_installdeb
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
|