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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for packages that are architecture independent.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
CONFIGURE_OPTIONS = --prefix=/usr --with-gtk-prefix=/usr --sysconfdir=/etc \
--infodir=/usr/share/info
debbuilt =
# Patches applied in this order.
debian_patches =
Makefile:
dh_testdir
./configure $(CONFIGURE_OPTIONS)
build: build-stamp
build-stamp: Makefile patched-stamp
dh_testdir
sed < libtool > libtool-2 \
-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/'
mv libtool-2 libtool
$(MAKE)
touch build-stamp
force-clean: Makefile
debian/rules clean
cvs-clean:
dh_testdir
dh_testroot
-find $(shell pwd) -name .cvsignore | while read name; do dir=`dirname $$name`; echo "Removing cruft in $$dir"; ( cd $$dir && rm -rf `cat .cvsignore` ); done
rm -f missing mkinstalldirs install-sh COPYING INSTALL
clean:
dh_testdir
dh_testroot
if [ -f Makefile ]; then if [ -f autobuilt-configure ]; then $(MAKE) -k maintainer-clean && debian/rules cvs-clean && rm -f autobuilt-configure; else $(MAKE) -k distclean; fi; fi
debian/rules reverse-patches
rm -f $(debbuilt)
rm -f build-stamp install-stamp arrange-stamp
dh_clean
builddir := $(shell pwd)/debian/tmp
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Should be able to set DESTDIR, not have to set all this crap
$(MAKE) prefix=$(builddir)/usr \
sysconfdir=$(builddir)/etc \
localstatedir=$(builddir)/var/lib \
infodir=$(builddir)/usr/share/info \
install
touch install-stamp
saveinstall: install-stamp
tar cf installed.tar install-stamp debian/tmp
disarrange:
debian/rules uninstall
tar xf installed.tar
dh_installdirs
arrange: arrange-stamp
arrange-stamp: install-stamp $(debbuilt)
dh_movefiles
# Make debugging package
cp debian/liborbit-dev/usr/lib/lib*.a debian/liborbit-dbg/usr/lib
set -e && for i in debian/liborbit-dbg/usr/lib/lib*.a; do mv $$i "`dirname $$i`/`basename $$i .a`_g.a"; done
# Prune unwanted directories
rm -rf debian/tmp/usr/include
rm -rf debian/tmp/usr/share
rm -rf debian/tmp/usr/lib
rm -rf debian/tmp/usr/info
touch arrange-stamp
uninstall:
dh_testdir
dh_testroot
dh_clean
rm -rf install-stamp arrange-stamp
%.8: %.pod
pod2man --section=8 --release="GNOME 1.0" --center="Debian GNU/Linux" $< | sed -e 's/debian:://'> $@
%.1: %.pod
pod2man --section=1 --release="GNOME 1.0" --center="Debian GNU/Linux" $< | sed -e 's/debian:://'> $@
libpath=$(shell echo $$PWD/debian/*/usr/lib | sed -e 's/ /:/g')
# Build architecture-independent files here.
binary-indep: arrange-stamp
# Build architecture-dependent files here.
binary-arch: arrange-stamp
# dh_testversion
dh_testdir -a
dh_testroot -a
dh_installdocs -a
dh_installexamples -a
dh_installmenu -a
# dh_installemacsen -a
# dh_installinit -a
dh_installcron -a
dh_installmanpages -pliborbit-dev
rm debian/liborbit-dev/usr/share/man/man3/popt.3
dh_undocumented -a
dh_installchangelogs -a ChangeLog
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
# You may want to make some executables suid here.
dh_suidregister -a
dh_installdeb -a
# dh_makeshlibs -a
LD_LIBRARY_PATH=$(libpath) dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install force-clean
# ---------------------------------------------------------------------------
# various rules to unpack addons and (un)apply patches.
# borrowed from egcs package
patch_dir = debian/patches
apply-patches: patched-stamp
reverse-patches:
@for stamp in none patched-*; do \
case "$$stamp" in none|patched-stamp|patched-\*) continue; esac; \
patch=`echo $$stamp | sed -e 's/patched-//'`; \
echo "trying to revert patch $$patch ..."; \
if [ -x $(patch_dir)/$$patch.dpatch ]; then true; else \
chmod +x $(patch_dir)/$$patch.dpatch; fi; \
if $(patch_dir)/$$patch.dpatch -unpatch; then \
echo "reverted $$patch patch."; \
rm -f $$stamp; \
else \
echo "error in reverting $$patch patch."; \
exit 1; \
fi; \
done
rm -f patched-stamp
patched-%: $(patch_dir)/%.dpatch
@if [ -x $< ]; then true; else chmod +x $<; fi
@if [ -f $@ ]; then \
echo "$* patches already applied."; exit 1; \
fi
$< -patch
@echo "$* patches applied." > $@
patched-stamp: $(foreach p,$(debian_patches),patched-$(p))
@echo -e "\nPatches applied:" >> pxxx
@for i in none $(debian_patches); do \
if [ -r debian/patches/$$i.dpatch ]; then \
echo -e "\n$$i:" >> pxxx; \
sed -n 's/^# *DP: */ /p' debian/patches/$$i.dpatch >> pxxx; \
fi \
done
mv -f pxxx patched-stamp
|