| 1 |
ccheney |
15 |
#!/usr/bin/make -f |
| 2 |
|
|
# -*- makefile -*- |
| 3 |
|
|
# Sample debian/rules that uses debhelper. |
| 4 |
|
|
# GNU copyright 1997 to 1999 by Joey Hess. |
| 5 |
|
|
# |
| 6 |
|
|
# Modified to make a template file for a multi-binary package with separated |
| 7 |
|
|
# build-arch and build-indep targets by Bill Allombert 2001 |
| 8 |
|
|
|
| 9 |
|
|
# Uncomment this to turn on verbose mode. |
| 10 |
|
|
#export DH_VERBOSE=1 |
| 11 |
|
|
|
| 12 |
|
|
# This has to be exported to make some magic below work. |
| 13 |
|
|
export DH_OPTIONS |
| 14 |
|
|
|
| 15 |
|
|
# These are used for cross-compiling and for saving the configure script |
| 16 |
|
|
# from having to guess our platform (since we know it already) |
| 17 |
|
|
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 18 |
|
|
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 19 |
|
|
|
| 20 |
|
|
CFLAGS = -Wall -g |
| 21 |
|
|
|
| 22 |
|
|
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 23 |
|
|
CFLAGS += -O0 |
| 24 |
|
|
else |
| 25 |
|
|
CFLAGS += -O2 |
| 26 |
|
|
endif |
| 27 |
|
|
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 28 |
|
|
INSTALL_PROGRAM += -s |
| 29 |
|
|
endif |
| 30 |
|
|
|
| 31 |
|
|
objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE) |
| 32 |
|
|
|
| 33 |
|
|
-include debian/debiandirs |
| 34 |
|
|
|
| 35 |
|
|
debian/debiandirs: admin/debianrules |
| 36 |
|
|
perl -w admin/debianrules echodirs > debian/debiandirs |
| 37 |
|
|
|
| 38 |
|
|
configure: configure-stamp |
| 39 |
|
|
configure-stamp: |
| 40 |
|
|
dh_testdir |
| 41 |
|
|
|
| 42 |
|
|
# Apply Debian specific patches |
| 43 |
|
|
if test -d $(CURDIR)/debian/patches ;\ |
| 44 |
|
|
then \ |
| 45 |
|
|
for i in $(CURDIR)/debian/patches/*.diff.uu ;\ |
| 46 |
|
|
do \ |
| 47 |
|
|
cd $(CURDIR)/debian/patches ;\ |
| 48 |
|
|
uudecode "$$i" ;\ |
| 49 |
|
|
cd $(CURDIR) ;\ |
| 50 |
|
|
done ;\ |
| 51 |
|
|
patches=$$(find $(CURDIR)/debian/patches -name *.diff | sort);\ |
| 52 |
|
|
fi ;\ |
| 53 |
|
|
if test ! -f patch-stamp; then \ |
| 54 |
|
|
for patch in $$patches ;\ |
| 55 |
|
|
do \ |
| 56 |
|
|
echo APPLYING PATCH\: "$${patch##*/}" ;\ |
| 57 |
|
|
patch -p1 < "$$patch" ;\ |
| 58 |
|
|
done ;\ |
| 59 |
|
|
touch patch-stamp ;\ |
| 60 |
|
|
fi |
| 61 |
|
|
|
| 62 |
|
|
# KDE CVS does not have aclocal.m4 or configure |
| 63 |
|
|
if test ! -f configure; then \ |
| 64 |
|
|
$(MAKE) -f admin/Makefile.common ;\ |
| 65 |
|
|
fi |
| 66 |
|
|
|
| 67 |
|
|
# ensure configure is executable |
| 68 |
|
|
chmod +x configure |
| 69 |
|
|
|
| 70 |
|
|
# make build directory |
| 71 |
|
|
mkdir $(objdir) |
| 72 |
|
|
|
| 73 |
|
|
# run configure with build tree $(objdir) |
| 74 |
|
|
cd $(objdir) && \ |
| 75 |
|
|
../configure $(configkde) --with-alsa --with-arts-alsa |
| 76 |
|
|
|
| 77 |
|
|
touch configure-stamp |
| 78 |
|
|
|
| 79 |
|
|
#Architecture |
| 80 |
|
|
build: build-arch build-indep |
| 81 |
|
|
|
| 82 |
|
|
build-arch: build-arch-stamp |
| 83 |
|
|
build-arch-stamp: configure-stamp |
| 84 |
|
|
dh_testdir |
| 85 |
|
|
|
| 86 |
|
|
cd $(objdir) && \ |
| 87 |
|
|
$(MAKE) |
| 88 |
|
|
|
| 89 |
|
|
# generate manpages |
| 90 |
|
|
#for i in debian/man/*.sgml; do \ |
| 91 |
|
|
docbook-to-man $$i > `dirname $$i`/`basename $$i .sgml`.1 ;\ |
| 92 |
|
|
done |
| 93 |
|
|
|
| 94 |
|
|
touch build-arch-stamp |
| 95 |
|
|
|
| 96 |
|
|
build-indep: build-indep-stamp |
| 97 |
|
|
build-indep-stamp: configure-stamp |
| 98 |
|
|
dh_testdir |
| 99 |
|
|
|
| 100 |
|
|
cd $(objdir) && \ |
| 101 |
|
|
$(MAKE) |
| 102 |
|
|
|
| 103 |
|
|
#cd $(objdir) && \ |
| 104 |
|
|
$(MAKE) apidox |
| 105 |
|
|
|
| 106 |
|
|
touch build-indep-stamp |
| 107 |
|
|
|
| 108 |
|
|
debian-clean: |
| 109 |
|
|
dh_testdir |
| 110 |
|
|
dh_testroot |
| 111 |
|
|
|
| 112 |
|
|
dh_clean |
| 113 |
|
|
|
| 114 |
|
|
clean: |
| 115 |
|
|
dh_testdir |
| 116 |
|
|
dh_testroot |
| 117 |
|
|
rm -f build-arch-stamp build-indep-stamp configure-stamp \ |
| 118 |
|
|
debian/debiandirs |
| 119 |
|
|
|
| 120 |
|
|
# Remove Debian specific patches |
| 121 |
|
|
if test -d $(CURDIR)/debian/patches ;\ |
| 122 |
|
|
then \ |
| 123 |
|
|
patches=$$(find $(CURDIR)/debian/patches -name *.diff | sort -r);\ |
| 124 |
|
|
fi ;\ |
| 125 |
|
|
if test -f patch-stamp; then \ |
| 126 |
|
|
for patch in $$patches ;\ |
| 127 |
|
|
do \ |
| 128 |
|
|
echo REMOVING PATCH\: "$${patch##*/}" ;\ |
| 129 |
|
|
patch -p1 -R < "$$patch" ;\ |
| 130 |
|
|
done ;\ |
| 131 |
|
|
for i in $(CURDIR)/debian/patches/*.diff.uu ;\ |
| 132 |
|
|
do \ |
| 133 |
|
|
rm -f "$${i%%.uu}" ;\ |
| 134 |
|
|
done ;\ |
| 135 |
|
|
rm -f patch-stamp ;\ |
| 136 |
|
|
fi |
| 137 |
|
|
|
| 138 |
|
|
# Remove build tree |
| 139 |
|
|
rm -rf $(objdir) |
| 140 |
|
|
|
| 141 |
|
|
# if Makefile exists run distclean |
| 142 |
|
|
if test -f Makefile; then \ |
| 143 |
|
|
$(MAKE) distclean; \ |
| 144 |
|
|
fi |
| 145 |
|
|
|
| 146 |
|
|
if test -d CVS; then \ |
| 147 |
|
|
$(MAKE) -f admin/Makefile.common cvs-clean ;\ |
| 148 |
|
|
fi |
| 149 |
|
|
|
| 150 |
|
|
dh_clean |
| 151 |
|
|
|
| 152 |
|
|
install: install-arch install-indep |
| 153 |
|
|
|
| 154 |
|
|
install-arch: |
| 155 |
|
|
dh_testdir |
| 156 |
|
|
dh_testroot |
| 157 |
|
|
dh_clean -k -s |
| 158 |
|
|
dh_installdirs -s |
| 159 |
|
|
|
| 160 |
|
|
cd $(objdir) && \ |
| 161 |
|
|
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp |
| 162 |
|
|
|
| 163 |
|
|
dh_install -s --list-missing |
| 164 |
|
|
|
| 165 |
|
|
install-indep: |
| 166 |
|
|
dh_testdir |
| 167 |
|
|
dh_testroot |
| 168 |
|
|
dh_clean -k -i |
| 169 |
|
|
dh_installdirs -i |
| 170 |
|
|
|
| 171 |
|
|
cd $(objdir) && \ |
| 172 |
|
|
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp |
| 173 |
|
|
|
| 174 |
|
|
#cd $(objdir) && \ |
| 175 |
|
|
$(MAKE) install-apidox DESTDIR=$(CURDIR)/debian/tmp |
| 176 |
|
|
|
| 177 |
|
|
dh_install -i --list-missing |
| 178 |
|
|
|
| 179 |
|
|
# Must not depend on anything. This is to be called by |
| 180 |
|
|
# binary-arch/binary-indep |
| 181 |
|
|
# in another 'make' thread. |
| 182 |
|
|
binary-common: |
| 183 |
|
|
dh_testdir |
| 184 |
|
|
dh_testroot |
| 185 |
|
|
dh_installchangelogs |
| 186 |
|
|
dh_installdocs |
| 187 |
|
|
# dh_installexamples |
| 188 |
|
|
dh_installmenu |
| 189 |
|
|
# dh_installdebconf |
| 190 |
|
|
# dh_installlogrotate |
| 191 |
|
|
# dh_installemacsen |
| 192 |
|
|
# dh_installpam |
| 193 |
|
|
dh_installmime |
| 194 |
|
|
# dh_installinit |
| 195 |
|
|
# dh_installcron |
| 196 |
|
|
# dh_installinfo |
| 197 |
|
|
dh_installman |
| 198 |
|
|
dh_link |
| 199 |
|
|
dh_strip |
| 200 |
|
|
dh_compress -X.bz2 -X.css -X.dcl -X.docbook -X-license -X.tag |
| 201 |
|
|
dh_fixperms |
| 202 |
|
|
# dh_perl |
| 203 |
|
|
# dh_python |
| 204 |
|
|
dh_makeshlibs -V |
| 205 |
|
|
dh_installdeb |
| 206 |
|
|
dh_shlibdeps -ldebian/artsbuilder/usr/lib:debian/kscd/usr/lib:debian/libkcddb1/usr/lib:debian/mpeglib/usr/lib:debian/noatun/usr/lib |
| 207 |
|
|
dh_gencontrol |
| 208 |
|
|
dh_md5sums |
| 209 |
|
|
dh_builddeb |
| 210 |
|
|
|
| 211 |
|
|
# Build architecture independant packages using the common target. |
| 212 |
|
|
binary-indep: build-indep install-indep |
| 213 |
|
|
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
| 214 |
|
|
|
| 215 |
|
|
# Build architecture dependant packages using the common target. |
| 216 |
|
|
binary-arch: build-arch install-arch |
| 217 |
|
|
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common |
| 218 |
|
|
|
| 219 |
|
|
binary: binary-arch binary-indep |
| 220 |
|
|
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure |