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
|
#!/usr/bin/make -f
#
# debian/rules for scim package
# Copyright Ming Hua <minghua@rice.edu>, 2006
#
# This file is distributed under the same license as SCIM.
# uncomment this to turn on verbose mode
#export DH_VERBOSE = 1
# set the platform for configure script, especially useful for cross-compiling
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_HOST_GNU_TYPE), $(DEB_BUILD_GNU_TYPE))
CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE)
else
CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
# for more information, see /usr/share/doc/autotools-dev/README.Debian.gz
# set compiler flags, enable warning and debug
CFLAGS += -W -g
CXXFLAGS += -W -g
# set optimization level
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O
CXXFLAGS += -O
else
CFLAGS += -O0
CXXFLAGS += -O0
endif
clean: clean-patched unpatch
clean-patched:
dh_testdir
dh_testroot
rm -f build-stamp
# only run "make distclean" if a Makefile exists
[ ! -f Makefile ] || $(MAKE) distclean
# remove existent config.{guess,sub} as we use the ones from
# autotools-dev package
rm -f config.guess config.sub
dh_clean
patch: patch-stamp
patch-stamp:
dh_testdir
dpatch apply-all
# fix timestamp skews, note this is still quite hackish and depends on
# which files the 90_relibtoolize patch touches
touch -r config.h.in aclocal.m4 configure.ac
# put information about applied patches in the stamp file
dpatch cat-all -nd >$@
unpatch:
dh_testdir
dpatch deapply-all
rm -rf debian/patched
rm -f patch-stamp
config.status: patch-stamp
dh_testdir
# link config.{guess,sub} from autotools-dev package
ln -sf /usr/share/misc/config.guess config.guess
ln -sf /usr/share/misc/config.sub config.sub
rm -f config.cache
# run configure with all necessary definitions and options
./configure \
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
$(CONFFLAGS) \
--prefix=/usr \
--mandir=/usr/share/man \
--sysconfdir=/etc
build: build-stamp
build-stamp: config.status
dh_testdir
dh_clean
$(MAKE)
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# install im-switch support
install -m 644 -D \
debian/im-switch/scim debian/tmp/etc/X11/xinit/xinput.d/scim
install -m 644 -D \
debian/im-switch/scim-immodule \
debian/tmp/etc/X11/xinit/xinput.d/scim-immodule
# install reportbug script
install -m 755 -D \
debian/scim.script debian/tmp/usr/share/bug/scim/script
# clean up unnecessary static library files for modules
rm debian/tmp/usr/lib/scim-1.0/1.4.0/*/*.la
rm debian/tmp/usr/lib/scim-1.0/1.4.0/*/*.a
rm debian/tmp/usr/lib/gtk-2.0/*/immodules/im-scim.a
rm debian/tmp/usr/lib/gtk-2.0/*/immodules/im-scim.la
# distribute files to different binary packages
dh_install --sourcedir=debian/tmp --fail-missing
touch $@
binary: binary-arch binary-indep
binary-arch: build
dh_testdir
dh_testroot
dh_installchangelogs -a ChangeLog
dh_installdocs -a -X Makefile
dh_installman -a
LD_LIBRARY_PATH=debian/libscim8c2a/usr/lib:$(LD_LIBRARY_PATH) \
dh_gtkmodules -p scim-gtk2-immodule
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_makeshlibs -p libscim8c2a -V "libscim8c2a (>= 1.4.6)"
dh_installdeb -a
dh_shlibdeps -a -l debian/libscim8c2a/usr/lib -L libscim8c2a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary-indep: build
dh_testdir
dh_testroot
dh_installchangelogs -i ChangeLog
dh_installdocs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
.SUFFIXES:
.PHONY: clean build binary binary-arch binary-indep clean-patched patch unpatch
# vim:textwidth=0:
|