| 1 | #!/usr/bin/make -f |
|---|
| 2 | # Based on sample debian/rules that uses debhelper, |
|---|
| 3 | # GPL copyright 1997 to 1999 by Joey Hess. |
|---|
| 4 | # |
|---|
| 5 | # Copyright (C) 2001 Wookey |
|---|
| 6 | # Copyright (C) 2001,2002,2003,2004 Olly Betts |
|---|
| 7 | # |
|---|
| 8 | # This is a multibinary package. You can build any of the binary packages |
|---|
| 9 | # independently, via binary-<package> targets. |
|---|
| 10 | |
|---|
| 11 | # Uncomment this to turn on verbose mode. |
|---|
| 12 | #export DH_VERBOSE=1 |
|---|
| 13 | |
|---|
| 14 | # This is the debhelper compatability version to use. |
|---|
| 15 | export DH_COMPAT=1 |
|---|
| 16 | |
|---|
| 17 | # This has to be exported to make some magic below work. |
|---|
| 18 | export DH_OPTIONS |
|---|
| 19 | |
|---|
| 20 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
|---|
| 21 | CFLAGS += -O0 |
|---|
| 22 | else |
|---|
| 23 | CFLAGS += -O2 |
|---|
| 24 | endif |
|---|
| 25 | ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
|---|
| 26 | STRIP=/bin/echo |
|---|
| 27 | endif |
|---|
| 28 | |
|---|
| 29 | build: build-stamp |
|---|
| 30 | build-stamp: |
|---|
| 31 | dh_testdir |
|---|
| 32 | |
|---|
| 33 | ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-docdir=\$${prefix}/share/doc/survex CFLAGS=$(CFLAGS) STRIP=$(STRIP) |
|---|
| 34 | $(MAKE) |
|---|
| 35 | ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) |
|---|
| 36 | $(MAKE) check |
|---|
| 37 | endif |
|---|
| 38 | touch build-stamp |
|---|
| 39 | |
|---|
| 40 | clean: |
|---|
| 41 | dh_testdir |
|---|
| 42 | dh_testroot |
|---|
| 43 | rm -f build-stamp |
|---|
| 44 | |
|---|
| 45 | -$(MAKE) distclean |
|---|
| 46 | |
|---|
| 47 | dh_clean |
|---|
| 48 | |
|---|
| 49 | install: DH_OPTIONS= |
|---|
| 50 | install: build |
|---|
| 51 | dh_testdir |
|---|
| 52 | dh_testroot |
|---|
| 53 | dh_clean -k |
|---|
| 54 | dh_installdirs |
|---|
| 55 | |
|---|
| 56 | $(MAKE) prefix=`pwd`/debian/tmp/usr install |
|---|
| 57 | install -d debian/tmp/usr/share/vim/addons/ftdetect |
|---|
| 58 | install -d debian/tmp/usr/share/vim/addons/syntax |
|---|
| 59 | install vim/ftdetect/survex.vim debian/tmp/usr/share/vim/addons/ftdetect |
|---|
| 60 | install vim/syntax/survex.vim debian/tmp/usr/share/vim/addons/syntax |
|---|
| 61 | |
|---|
| 62 | dh_movefiles |
|---|
| 63 | |
|---|
| 64 | # This single target is used to build all the packages, all at once, or |
|---|
| 65 | # one at a time. So keep in mind: any options passed to commands here will |
|---|
| 66 | # affect _all_ packages. Anything you want to only affect one package |
|---|
| 67 | # should be put in another target, such as the install target. |
|---|
| 68 | binary-common: build install |
|---|
| 69 | dh_testdir |
|---|
| 70 | dh_testroot |
|---|
| 71 | # dh_installdebconf |
|---|
| 72 | dh_installdocs |
|---|
| 73 | rm -rf debian/tmp/usr/doc |
|---|
| 74 | dh_installexamples |
|---|
| 75 | dh_installmenu |
|---|
| 76 | # dh_installemacsen |
|---|
| 77 | # dh_installmime |
|---|
| 78 | gzip -9 debian/tmp/usr/share/man/man1/* |
|---|
| 79 | dh_installchangelogs |
|---|
| 80 | dh_link |
|---|
| 81 | dh_strip |
|---|
| 82 | dh_compress |
|---|
| 83 | dh_fixperms |
|---|
| 84 | # dh_makeshlibs |
|---|
| 85 | dh_installdeb |
|---|
| 86 | # dh_perl |
|---|
| 87 | dh_shlibdeps |
|---|
| 88 | dh_gencontrol |
|---|
| 89 | dh_md5sums |
|---|
| 90 | dh_builddeb |
|---|
| 91 | |
|---|
| 92 | # Build architecture independant packages using the common target. |
|---|
| 93 | #binary-indep: |
|---|
| 94 | # $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
|---|
| 95 | |
|---|
| 96 | # Build architecture dependant packages using the common target. |
|---|
| 97 | binary-arch: |
|---|
| 98 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
|---|
| 99 | |
|---|
| 100 | # Any other binary targets build just one binary package at a time. |
|---|
| 101 | binary-%: build install |
|---|
| 102 | make -f debian/rules binary-common DH_OPTIONS=-p$* |
|---|
| 103 | |
|---|
| 104 | binary: binary-arch |
|---|
| 105 | .PHONY: build clean binary-indep binary-arch binary install |
|---|