2000-10-19 20:58:30 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# ICU debian/rules that uses debhelper.
|
|
|
|
|
|
|
|
# The Debian packages for ICU are created and maintained by
|
|
|
|
# Yves Arrouye <yves@debian.org>. They are part of Debian GNU/Linux
|
|
|
|
# since the Debian woody release.
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
|
|
# This is the debhelper compatability version to use.
|
2000-10-27 22:30:42 +00:00
|
|
|
export DH_COMPAT=2
|
2001-06-20 23:48:40 +00:00
|
|
|
#firstdir := $(shell sed -n 's/Package: \(.*\)/\1/p' debian/control | head -1)else
|
2000-10-19 20:58:30 +00:00
|
|
|
|
2000-10-26 20:37:42 +00:00
|
|
|
# Where the source for ICU is, where to build
|
2000-10-20 05:28:15 +00:00
|
|
|
srcdir = source
|
2000-11-21 19:39:00 +00:00
|
|
|
builddir = build
|
2000-11-17 05:02:31 +00:00
|
|
|
# How to get to $(srcdir) from $(builddir)
|
2000-11-21 19:39:00 +00:00
|
|
|
builddir_relative_topdir = ..
|
|
|
|
builddir_relative_srcdir = $(builddir_relative_topdir)/$(srcdir)
|
|
|
|
|
|
|
|
# Getting the ICU version numbers, stolen from configure.in (that's okay, I
|
|
|
|
# wrote the configure.in part anyway)
|
|
|
|
|
2001-07-05 23:14:14 +00:00
|
|
|
version := $(shell sed -n -e 's/^[ ]*\#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' $(srcdir)/common/unicode/uversion.h)
|
2001-06-20 23:48:40 +00:00
|
|
|
libversion := $(shell echo $(version) | sed -e 's/\.//' -e 's/^\([^.]*\)$$/\1.0/')
|
|
|
|
major := $(shell echo $(libversion) | sed 's/\..*//')
|
2000-10-20 05:28:15 +00:00
|
|
|
|
|
|
|
# ICU installation directories, w/o the initial slash
|
2000-10-27 22:30:42 +00:00
|
|
|
pkgdatadir = usr/share/icu
|
|
|
|
icudatadir = $(pkgdatadir)/$(version)
|
|
|
|
pkglibdir = usr/lib/icu
|
|
|
|
iculibdir = $(pkglibdir)/$(version)
|
2000-10-24 23:15:48 +00:00
|
|
|
datasrcdir = usr/share/icu/$(version)/data
|
2000-10-19 20:58:30 +00:00
|
|
|
|
|
|
|
# Build flags
|
|
|
|
|
|
|
|
CFLAGS = -O2 # -Wall
|
|
|
|
CXXFLAGS = -O2 # -Wall
|
|
|
|
INSTALL_PROGRAM = /usr/bin/install
|
|
|
|
|
|
|
|
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
|
|
|
CFLAGS += -g
|
|
|
|
CXXFLAGS += -g
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
|
|
|
INSTALL_PROGRAM += -s
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
2000-10-26 20:37:42 +00:00
|
|
|
configure: $(builddir)/configure-stamp
|
|
|
|
$(builddir)/configure-stamp:
|
2000-10-19 20:58:30 +00:00
|
|
|
# Add here commands to configure the package.
|
2000-10-26 20:37:42 +00:00
|
|
|
test -d $(builddir) || mkdir $(builddir)
|
2001-06-20 23:48:40 +00:00
|
|
|
cd $(builddir); CFLAGS='$(CFLAGS)' CXXFLAGS='$(CFLAGS)' INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(SHELL) $(builddir_relative_srcdir)/configure --srcdir=$(builddir_relative_srcdir) --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --with-data-packaging=files --disable-rpath --enable-shared --enable-static --disable-samples
|
2000-10-26 20:37:42 +00:00
|
|
|
touch $@
|
2000-10-19 20:58:30 +00:00
|
|
|
|
2000-11-22 00:46:13 +00:00
|
|
|
build: $(builddir)/configure-stamp debian-files $(builddir)/build-stamp
|
2000-11-21 19:39:00 +00:00
|
|
|
|
2000-11-22 00:46:13 +00:00
|
|
|
# Build some Debian files
|
2001-06-20 23:48:40 +00:00
|
|
|
DEBIAN_FILES=icu.conffiles postinst prerm icu.postinst icu.prerm libicu$(major).postinst
|
2000-11-22 00:46:13 +00:00
|
|
|
|
|
|
|
debian/%: debian/%.in
|
|
|
|
cd $(builddir) \
|
|
|
|
&& CONFIG_FILES=$(builddir_relative_topdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
|
|
|
|
2001-06-20 23:48:40 +00:00
|
|
|
debian/libicu$(major).%: debian/libicu.%
|
2000-11-27 22:37:51 +00:00
|
|
|
cp $< $@
|
|
|
|
|
2000-11-22 00:46:13 +00:00
|
|
|
debian-files: $(addprefix debian/,$(DEBIAN_FILES))
|
|
|
|
|
|
|
|
$(builddir)/build-stamp:
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_testdir
|
|
|
|
|
|
|
|
# Add here commands to compile the package.
|
2000-10-26 20:37:42 +00:00
|
|
|
$(MAKE) -C $(builddir)
|
2000-10-19 20:58:30 +00:00
|
|
|
|
2000-10-26 20:37:42 +00:00
|
|
|
touch $@
|
2000-10-19 20:58:30 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2000-10-26 22:03:22 +00:00
|
|
|
$(RM) $(builddir)/build-stamp $(builddir)/configure-stamp
|
2000-10-19 20:58:30 +00:00
|
|
|
|
|
|
|
# Add here commands to clean up after the build process.
|
2000-10-26 22:03:22 +00:00
|
|
|
-$(MAKE) -C $(builddir) distclean
|
2000-10-28 04:04:26 +00:00
|
|
|
#-$(RM) `find $(builddir)/samples $(builddir)/test -name Makefile -print`
|
|
|
|
-$(RM) `find $(builddir) -name Makefile -print`
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_clean
|
2001-06-20 23:48:40 +00:00
|
|
|
$(RM) $(addprefix debian/,$(DEBIAN_FILES)) debian/control.new
|
2000-10-19 20:58:30 +00:00
|
|
|
|
2001-06-20 23:48:40 +00:00
|
|
|
#if test -d $(builddir) -a $(builddir) != $(srcdir); then rmdir `find $(builddir) -type d -print | sort -r`; fi
|
|
|
|
if test -d $(builddir) -a $(builddir) != $(srcdir); then $(RM) -r $(builddir); fi
|
2000-10-26 20:37:42 +00:00
|
|
|
|
2000-10-19 20:58:30 +00:00
|
|
|
install: build
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2001-11-10 03:06:45 +00:00
|
|
|
dh_clean -k
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_installdirs
|
|
|
|
|
2000-11-17 05:02:31 +00:00
|
|
|
# Add here commands to install the package into debian/tmp
|
|
|
|
$(MAKE) -C $(builddir) install DESTDIR=`pwd`/debian/tmp
|
2000-10-19 20:58:30 +00:00
|
|
|
|
|
|
|
# Build architecture-independent files here.
|
|
|
|
binary-indep: build install
|
2001-11-11 08:19:34 +00:00
|
|
|
#
|
|
|
|
# build icu-doc package by moving files
|
|
|
|
#
|
|
|
|
mv debian/tmp/usr/share/doc/icu debian/tmp/usr/share/doc/icu-doc
|
|
|
|
dh_movefiles -picu-doc \
|
|
|
|
usr/share/doc/icu-doc
|
|
|
|
#
|
|
|
|
# build icu-i18ndata from the source data
|
|
|
|
#
|
|
|
|
test -d debian/icu-i18ndata/$(datasrcdir) || \
|
|
|
|
mkdir -p debian/icu-i18ndata/$(datasrcdir)
|
|
|
|
install -m 644 $(srcdir)/../data/*.txt \
|
|
|
|
$(srcdir)/../data/*.brk \
|
|
|
|
debian/icu-i18ndata/$(datasrcdir)
|
|
|
|
cd debian/icu-i18ndata/$(datasrcdir) && \
|
|
|
|
$(RM) convrtrs.txt
|
|
|
|
#
|
|
|
|
# build icu-data from the source data
|
|
|
|
#
|
|
|
|
test -d debian/icu-data/$(datasrcdir) || \
|
|
|
|
mkdir -p debian/icu-data/$(datasrcdir)
|
|
|
|
install -m 644 $(srcdir)/../data/*.ucm \
|
|
|
|
debian/icu-data/$(datasrcdir)
|
|
|
|
test -d debian/icu-data/$(datasrcdir)/unidata || \
|
|
|
|
mkdir -p debian/icu-data/$(datasrcdir)/unidata
|
|
|
|
install -m 644 $(srcdir)/../data/unidata/*.* \
|
|
|
|
debian/icu-data/$(datasrcdir)/unidata
|
2000-10-19 20:58:30 +00:00
|
|
|
|
|
|
|
# Build architecture-dependent files here.
|
2000-11-21 19:39:00 +00:00
|
|
|
binary-arch: build install
|
2000-10-19 20:58:30 +00:00
|
|
|
# dh_testversion
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
#
|
|
|
|
# build libicu${major} package by moving files from icu-dev
|
|
|
|
#
|
2001-11-19 19:17:39 +00:00
|
|
|
$(RM) debian/tmp/usr/lib/libicuctestfw.*
|
2000-11-17 05:02:31 +00:00
|
|
|
dh_movefiles -plibicu$(major) \
|
2001-12-21 20:10:23 +00:00
|
|
|
usr/lib/*.so.*
|
2001-05-21 23:57:27 +00:00
|
|
|
mkdir debian/libicu$(major)/usr/lib/icu
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
|
|
|
# build icu package by moving files from icu-dev
|
|
|
|
#
|
2001-11-19 19:17:39 +00:00
|
|
|
$(RM) debian/tmp/$(iculibdir)/../Makefile.inc debian/tmp/$(iculibdir)/../current
|
2000-11-17 05:02:31 +00:00
|
|
|
dh_movefiles -picu \
|
2000-10-24 23:15:48 +00:00
|
|
|
etc \
|
2001-11-12 07:02:28 +00:00
|
|
|
usr/bin \
|
2000-10-19 20:58:30 +00:00
|
|
|
usr/sbin \
|
2000-10-25 22:27:24 +00:00
|
|
|
$(icudatadir)/README \
|
2000-10-24 23:15:48 +00:00
|
|
|
$(iculibdir)/*.cnv \
|
|
|
|
$(iculibdir)/u*.dat \
|
|
|
|
$(iculibdir)/tz.dat \
|
2001-11-19 19:17:39 +00:00
|
|
|
$(iculibdir)/Makefile.inc \
|
2000-10-19 20:58:30 +00:00
|
|
|
usr/share/man
|
2001-11-19 19:17:39 +00:00
|
|
|
$(RM) debian/tmp/$(iculibdir)/cnvalias.dat
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
|
|
|
# build icu-locales package by moving files from icu-dev
|
|
|
|
#
|
2000-11-17 05:02:31 +00:00
|
|
|
dh_movefiles -picu-locales \
|
2000-10-27 22:30:42 +00:00
|
|
|
$(iculibdir)/*.res \
|
|
|
|
$(iculibdir)/*.brk
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
2000-11-17 05:02:31 +00:00
|
|
|
# move the rest of the development files
|
|
|
|
# in their package
|
|
|
|
#
|
|
|
|
dh_movefiles usr
|
|
|
|
#
|
2000-10-19 20:58:30 +00:00
|
|
|
# do a bit of cleanup
|
|
|
|
#
|
2001-11-19 19:17:39 +00:00
|
|
|
$(RM) -r debian/tmp/etc debian/tmp/usr/sbin \
|
2000-11-17 05:02:31 +00:00
|
|
|
debian/tmp/usr/share/man
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
|
|
|
# continue to prepare packages
|
|
|
|
#
|
|
|
|
# dh_installdebconf
|
2001-05-21 23:57:27 +00:00
|
|
|
dh_installdocs
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_installexamples $(srcdir)/samples/*
|
2001-11-19 19:17:39 +00:00
|
|
|
find debian/libicu-dev -name CVS -o -name .cvsignore | xargs $(RM) -r
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_installmenu
|
|
|
|
# dh_installemacsen
|
|
|
|
# dh_installpam
|
|
|
|
# dh_installinit
|
|
|
|
dh_installcron
|
|
|
|
dh_installmanpages -picu
|
|
|
|
dh_installinfo
|
2001-12-21 01:46:10 +00:00
|
|
|
dh_undocumented -picu gennorm.8 genprops.8 gentz.8
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_installchangelogs
|
|
|
|
dh_link
|
|
|
|
dh_strip
|
|
|
|
dh_compress
|
|
|
|
dh_fixperms
|
|
|
|
# You may want to make some executables suid here.
|
|
|
|
dh_makeshlibs
|
|
|
|
dh_installdeb
|
|
|
|
# dh_perl
|
2001-06-20 23:48:40 +00:00
|
|
|
dh_shlibdeps -ldebian/libicu$(major)/usr/lib
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_gencontrol -- -Vversion=$(version) -Vmajor=$(major)
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
|
|
|
|
2001-06-20 23:48:40 +00:00
|
|
|
# Automatically update changelog and control
|
|
|
|
update-debian-files:
|
2000-11-21 19:39:00 +00:00
|
|
|
cvers=`sed -n 's/^icu (\([^)]*\)).*/\1/p' debian/changelog | head -1`; if dpkg --compare-versions $$cvers lt $(version)-1; then \
|
|
|
|
dch -v $(version)-1 "Update to ICU version $(version)."; \
|
2001-06-20 23:48:40 +00:00
|
|
|
sed 's/libicu[0-9][0-9]*/libicu$(major)/g' debian/control >debian/control.new && mv debian/control.new debian/control; \
|
2000-11-21 19:39:00 +00:00
|
|
|
fi
|
|
|
|
|
2001-06-20 23:48:40 +00:00
|
|
|
binary: update-debian-files binary-indep binary-arch
|
2000-11-22 00:46:13 +00:00
|
|
|
.PHONY: build clean binary-indep binary-arch binary install debian-files update-changelog
|
2001-06-20 23:48:40 +00:00
|
|
|
|