| 1 |
#!/usr/bin/make -f |
| 2 |
# Sample debian/rules that uses debhelper. |
| 3 |
# GNU copyright 1997 to 1999 by Joey Hess. |
| 4 |
|
| 5 |
# Uncomment this to turn on verbose mode. |
| 6 |
#export DH_VERBOSE=1 |
| 7 |
|
| 8 |
DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 9 |
|
| 10 |
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
| 11 |
CFLAGS += -g |
| 12 |
endif |
| 13 |
|
| 14 |
CHANGED_FILES_LIST = debian/savedfiles.lst |
| 15 |
CHANGED_FILES_ARCHIVE = debian/savedfiles.cpio |
| 16 |
|
| 17 |
%: |
| 18 |
dh $@ --with autoreconf |
| 19 |
|
| 20 |
override_dh_autoreconf: |
| 21 |
if [ ! -f "$(CHANGED_FILES_ARCHIVE)" -a -f Makefile.in ]; then \ |
| 22 |
cpio -o < $(CHANGED_FILES_LIST) > $(CHANGED_FILES_ARCHIVE); \ |
| 23 |
fi |
| 24 |
dh_autoreconf |
| 25 |
|
| 26 |
override_dh_autoreconf_clean: |
| 27 |
dh_autoreconf_clean |
| 28 |
if [ -f "$(CHANGED_FILES_ARCHIVE)" ]; then \ |
| 29 |
cpio -idu < $(CHANGED_FILES_ARCHIVE) && \ |
| 30 |
rm -f $(CHANGED_FILES_ARCHIVE); \ |
| 31 |
fi |
| 32 |
|
| 33 |
# An ugly workaround because those files are included in the tarball |
| 34 |
override_dh_clean: |
| 35 |
dh_clean -X autom4te.cache |
| 36 |
|
| 37 |
|
| 38 |
override_dh_auto_build: |
| 39 |
$(MAKE) all |
| 40 |
cat dahdi.rules xpp/xpp.rules >debian/dahdi.udev |
| 41 |
|
| 42 |
override_dh_auto_clean: |
| 43 |
ifeq ($(wildcard Makefile),) |
| 44 |
$(MAKE) -f Makefile.legacy clean |
| 45 |
else |
| 46 |
$(MAKE) clean |
| 47 |
endif |
| 48 |
|
| 49 |
override_dh_auto_configure: |
| 50 |
dh_auto_configure |
| 51 |
|
| 52 |
override_dh_auto_install: |
| 53 |
# also run the 'config' target, in addition to the 'install' target: |
| 54 |
dh_auto_install -- config |
| 55 |
rm $(CURDIR)/debian/tmp/usr/share/dahdi/span_config.d/50-asterisk |
| 56 |
rm $(CURDIR)/debian/tmp/usr/lib/*/libtonezone.la |
| 57 |
rm -rf $(CURDIR)/debian/tmp/etc/dahdi |
| 58 |
rm -rf $(CURDIR)/debian/tmp/etc/udev/rules.d |