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
|
#!/usr/bin/make -f
# Sample debian.rules -*-makefile -*- for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself. (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
package=ircd
CC=cc
SHELL=/bin/bash
# This is defined to enable experimental linpeople patches...
# TWEAK=-DZIP_LINKS -DWEB_INTERFACE
# This should never be defined in official Debian release...
# HACK=-DGODMODE -DDEBUG
build: build-ircd build-dancer
build-ircd:
$(checkdir)
rm -rf builddir && mkdir builddir
cp -a Makefile.in doc config configure include ircd \
LICENCE INSTALL .patches .indent.pro builddir
cp debian/config.ircd builddir/config/.config
cp debian/config.h.ircd builddir/config/config.h
rm -f builddir/config/{config.cache,config.log}
# cd builddir && md5sum -c ../debian/checksums
cd builddir && sh ../debian/dopatch
cp -p builddir/.patches debian/patches
test -d debian/orig || cp -a builddir debian/orig
cd builddir && ./configure --prefix=/usr
cd builddir && $(MAKE) CC="$(CC) $(HACK)" \
IRCDLIBS="-lresolv -lcrypt" all
test -f builddir/ircd/ircd && touch build-ircd
build-dancer: build-ircd
$(checkdir)
rm -rf debian/build && mkdir debian/build
mkdir -p debian/build
cd builddir && \
cp -a Makefile* doc config configure include ircd \
LICENCE INSTALL .patches .indent.pro ../debian/build
cd debian/build && $(MAKE) distclean > /dev/null
cp debian/config.dancer debian/build/config/.config
# patch -d debian/build -s -p1 < hacks/services.hack
# false
@set -e; echo; for file in hacks/*.hack; do \
echo "H4x0ring with $$file ..."; \
patch -d debian/build -s -p1 < $$file; done; echo
find debian/build -name "*.orig" -print | xargs -r rm -f
find debian/build -name ".*.orig" -print | xargs -r rm -f
# false
cd debian && tar -czf build.tar.gz build
@echo && sleep 5
cd debian/build && ./configure --prefix=/usr \
--cache-file=../../../builddir/config/config.cache
# cd debian/build && make config
cp debian/config.h.dancer debian/build/config/config.h
# false
cd debian/build && $(MAKE) \
CC="$(CC) $(TWEAK) $(HACK)"
test -f debian/build/ircd/ircd && touch build-dancer
clean:
$(checkdir)
dh_clean
-$(MAKE) distclean
rm -rf build-* stamp-configure ircd/crypt/mkpasswd builddir
rm -rf $$(find . -name "*~") $$(find debian/* -type d)
rm -rf *~ debian/*.gz debian/*~ debian/patches
find .. -name $(package)*.asc -size 0 -maxdepth 1 -exec rm {} ";"
chmod +x configure */configure debian/{postinst,postrm,dopatch} \
ircd/crypt/sums
binary-indep: checkroot build
$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package. If there were any they would be
# made here.
binary-arch: checkroot build
rm -rf debian/tmp && install -d debian/tmp
dh_installdirs
dh_installdeb
dh_installmanpages doc/irc.1
dh_installchangelogs
dh_installdocs debian/{features.2.10,TODO} \
debian/README_SERVER_NUMERIC debian/{config.*,patches} \
builddir/INSTALL doc/*
cp -a hacks debian/tmp/usr/doc/$(package)/dancer
cp -p debian/*.html debian/tmp/usr/doc/$(package)/release
rm debian/tmp/usr/doc/$(package)/{Makefile*,irc.1,ircd.8}
cp -p debian/ircd.{conf,motd} \
debian/tmp/usr/doc/$(package)/examples
cp -p debian/ircd.{conf,motd} \
debian/tmp/etc/ircd
dh_compress
install builddir/ircd/ircd debian/tmp/usr/sbin/ircd
install debian/build/ircd/ircd debian/tmp/usr/lib/ircd/bin/dancer
install builddir/ircd/chkconf debian/dancerconfig \
debian/tmp/usr/lib/ircd/bin/
rm -rf $$(find debian/tmp -name CVS)
dh_strip
dh_shlibdeps
dpkg-gencontrol
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
chmod 700 debian/tmp/etc/$(package)
chmod 600 debian/tmp/etc/$(package)/*
dpkg --build debian/tmp ..
if egrep "^HACK=" debian/rules; then false; fi
define checkdir
test -f ircd/ircd.c -a -f debian/rules
endef
# Below here is fairly generic really
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|