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
|
#!/usr/bin/make -f
#
# debian/rules for vile/xvile
#
# packages
PACKAGES.indep = vile-common
PACKAGES.arch = vile vile-filters xvile
configure = ../../configure --prefix=/usr --mandir='$${prefix}/share/man' \
--with-locale --with-perl --with-cflags=-O2 --with-loadable-filters=all
patches = patches-applied
# install path for upstream make
TMP = $(CURDIR)/debian/tmp
# use debhelper v5
#export DH_COMPAT = 5
# add -g if DEB_BUILD_OPTIONS contains the string "debug" (policy 11.1)
ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),)
debug =
else
debug = -g
endif
.PHONY: all config build install binary clean config-indep config-arch \
build-indep build-arch install-indep install-arch binary-indep \
binary-arch
all: build
config: config-indep config-arch
build: build-indep build-arch
install: install-indep install-arch
binary: binary-indep binary-arch
clean:
dh_testdir
dh_testroot
test -f $(patches) # maintainer sanity check
rm -f stamp-*
rm -rf t
dh_clean
config-indep: $(PACKAGES.indep:%=stamp-config.%)
config-arch: $(PACKAGES.arch:%=stamp-config.%)
build-indep: $(PACKAGES.indep:%=stamp-build.%)
build-arch: $(PACKAGES.arch:%=stamp-build.%)
install-indep: $(PACKAGES.indep:%=stamp-install.%)
install-arch: $(PACKAGES.arch:%=stamp-install.%)
binary-indep: install-indep
ifneq ($(PACKAGES.indep),)
rm -f $(PACKAGES.indep:%=stamp-install.%)
dh_testdir
dh_testroot
dh_installdocs $(PACKAGES.indep:%=-p%)
dh_installman $(PACKAGES.indep:%=-p%)
dh_installexamples $(PACKAGES.indep:%=-p%)
dh_installchangelogs $(PACKAGES.indep:%=-p%) -k CHANGES
dh_compress $(PACKAGES.indep:%=-p%)
dh_fixperms $(PACKAGES.indep:%=-p%)
dh_installdeb $(PACKAGES.indep:%=-p%)
dh_gencontrol $(PACKAGES.indep:%=-p%)
dh_md5sums $(PACKAGES.indep:%=-p%)
dh_builddeb $(PACKAGES.indep:%=-p%)
endif
binary-arch: install-arch
ifneq ($(PACKAGES.arch),)
rm -f $(PACKAGES.arch:%=stamp-install.%)
dh_testdir
dh_testroot
dh_link $(PACKAGES.arch:%=-p%)
dh_installdocs $(PACKAGES.arch:%=-p%)
dh_installmenu $(PACKAGES.arch:%=-p%)
dh_strip $(PACKAGES.arch:%=-p%)
dh_compress $(PACKAGES.arch:%=-p%)
dh_fixperms $(PACKAGES.arch:%=-p%)
dh_installdeb $(PACKAGES.arch:%=-p%)
dh_shlibdeps $(PACKAGES.arch:%=-p%)
dh_gencontrol $(PACKAGES.arch:%=-p%)
dh_md5sums $(PACKAGES.arch:%=-p%)
dh_builddeb $(PACKAGES.arch:%=-p%)
endif
# these all have to be configured, made and built together
stamp-%.vile-common stamp-%.vile-filters: stamp-%.vile
touch $@
stamp-config.vile:
dh_testdir
rm -rf t/vile
mkdir -p t/vile
cd t/vile; $(configure)
touch $@
stamp-config.xvile:
dh_testdir
rm -rf t/xvile
mkdir -p t/xvile
cd t/xvile; $(configure) --with-xpm --with-screen=Xaw
touch $@
stamp-build.vile: stamp-config.vile
dh_testdir
# build in three steps so that filters aren't linked to
# un-needed perl libs
$(MAKE) -C t/vile vile EXTRA_CFLAGS="$(debug)"
$(MAKE) -C t/vile/filters LIBS= EXTRA_CFLAGS="$(debug)"
$(MAKE) -C t/vile all vile-perl-api.doc EXTRA_CFLAGS="$(debug)"
touch $@
stamp-build.xvile: stamp-config.xvile
dh_testdir
$(MAKE) -C t/xvile xvile EXTRA_CFLAGS="$(debug)"
touch $@
stamp-install.vile: stamp-build.vile
dh_testdir
dh_testroot
dh_clean -k -pvile -pvile-filters -pvile-common
$(MAKE) -C t/vile DESTDIR=$(TMP) install
$(MAKE) -C t/vile DESTDIR=$(TMP) bindir='$${datadir}' \
$(TMP)/usr/share/vile/vilemenu.rc \
$(TMP)/usr/share/vile/xshell.sh
rm -f $(TMP)/usr/bin/vile-pager # examples
rm -f $(TMP)/usr/share/man/man1/vile.1 # docs
pod2man $(TMP)/usr/bin/vileget > \
$(TMP)/usr/share/man/man1/vileget.1
mkdir -p $(TMP)/usr/share/lintian/overrides
cp $(CURDIR)/debian/overrides/vile $(TMP)/usr/share/lintian/overrides
dh_movefiles -pvile -pvile-filters -pvile-common
# ensure that all file have been moved from debian/tmp
test `find $(TMP) ! -type d | wc -l` -eq 0
touch $@
stamp-install.xvile: stamp-build.xvile
dh_testdir
dh_testroot
dh_clean -k -pxvile
install -d $(TMP)/usr/bin $(TMP)/etc/X11/app-defaults \
$(TMP)/usr/share/pixmaps
$(MAKE) -C t/xvile DESTDIR=$(TMP) $(TMP)/usr/bin/xvile
install -c -m 644 debian/XVile $(TMP)/etc/X11/app-defaults
install -c -m 644 debian/*.xpm $(TMP)/usr/share/pixmaps
dh_movefiles -pxvile
touch $@
# maintainer targets
patch:
test ! -f $(patches) # already patched
ls debian/patches/* >$(patches)
cat `cat $(patches)` | patch -p1 --no-backup-if-mismatch
unpatch:
test -f $(patches) # not patched
cat `tac $(patches)` | grep -v '^Prereq:' | patch -Rfp1 --no-backup-if-mismatch
-$(RM) $(patches)
|