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.
|
|
|
|
export DH_COMPAT=1
|
|
|
|
|
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-10-26 20:37:42 +00:00
|
|
|
builddir = build
|
2000-10-20 05:28:15 +00:00
|
|
|
|
|
|
|
# ICU installation directories, w/o the initial slash
|
|
|
|
icudatadir = usr/share/icu/$(version)
|
2000-10-24 23:15:48 +00:00
|
|
|
iculibdir = usr/lib/icu/$(version)
|
|
|
|
datasrcdir = usr/share/icu/$(version)/data
|
2000-10-19 20:58:30 +00:00
|
|
|
|
|
|
|
# shared library versions, option 1
|
|
|
|
version:=$(shell sed -n 's/^[ ]*\#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' $(srcdir)/common/unicode/utypes.h)
|
|
|
|
major:=$(shell echo $(version) | sed -e 's/\.//' -e 's/\..*//')
|
|
|
|
|
|
|
|
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
|
|
|
|
#version=`ls src/.libs/lib*.so.* | \
|
|
|
|
# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
|
|
|
|
#major=`ls src/.libs/lib*.so.* | \
|
|
|
|
# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
|
|
|
|
|
|
|
|
# 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
|
|
|
dh_testdir
|
|
|
|
# Add here commands to configure the package.
|
2000-10-26 20:37:42 +00:00
|
|
|
test -d $(builddir) || mkdir $(builddir)
|
|
|
|
cd build; CFLAGS='$(CFLAGS)' CXXFLAGS='$(CFLAGS)' INSTALL_PROGRAM='$(INSTALL_PROGRAM)' ../$(srcdir)/configure --srcdir=../$(srcdir) --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --with-data-packaging=files --disable-rpath --enable-shared --enable-static --disable-samples
|
|
|
|
touch $@
|
2000-10-19 20:58:30 +00:00
|
|
|
|
2000-10-26 20:37:42 +00:00
|
|
|
build: $(builddir)/configure-stamp $(builddir)/build-stamp
|
|
|
|
$(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
|
|
|
|
-$(RM) `find $(builddir)/samples $(builddir)/test -name Makefile`
|
|
|
|
$(RM) $(addprefix debian/,$(DEBIAN_FILES))
|
2000-10-19 20:58:30 +00:00
|
|
|
dh_clean
|
|
|
|
|
2000-10-26 22:03:22 +00:00
|
|
|
test $(builddir) != $(srcdir) && rmdir `find $(builddir) -type d -print`
|
2000-10-26 20:37:42 +00:00
|
|
|
|
2000-10-19 20:58:30 +00:00
|
|
|
install: build
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_clean -k
|
|
|
|
dh_installdirs
|
|
|
|
|
|
|
|
# Add here commands to install the package into debian/tmp.
|
2000-10-26 20:37:42 +00:00
|
|
|
$(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
|
|
|
|
# We have nothing to do by default.
|
|
|
|
|
|
|
|
# Build some Debian files
|
|
|
|
debian/%: debian/%.in
|
|
|
|
cd source \
|
2000-10-20 05:28:15 +00:00
|
|
|
&& CONFIG_FILES=../$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
2000-10-19 20:58:30 +00:00
|
|
|
|
2000-10-24 23:16:40 +00:00
|
|
|
DEBIAN_FILES = icu.conffiles icu.postinst icu.prerm
|
|
|
|
|
2000-10-19 20:58:30 +00:00
|
|
|
# Build architecture-dependent files here.
|
2000-10-24 23:16:40 +00:00
|
|
|
binary-arch: build install $(addprefix debian/,$(DEBIAN_FILES))
|
2000-10-19 20:58:30 +00:00
|
|
|
# dh_testversion
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
rm debian/tmp/usr/sbin/gentest
|
|
|
|
#
|
|
|
|
# build libicu${major} package by moving files from icu-dev
|
|
|
|
#
|
|
|
|
dh_movefiles -plibicu$(major) \
|
|
|
|
usr/lib/libicuuc.so.* \
|
|
|
|
usr/lib/libicui18n.so.* \
|
|
|
|
usr/lib/libicutoolutil.so.* \
|
|
|
|
usr/lib/libustdio.so.*
|
|
|
|
#
|
|
|
|
# build icu package by moving files from icu-dev
|
|
|
|
#
|
|
|
|
dh_movefiles -picu \
|
2000-10-24 23:15:48 +00:00
|
|
|
etc \
|
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 \
|
2000-10-19 20:58:30 +00:00
|
|
|
usr/share/man
|
2000-10-24 23:15:48 +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
|
|
|
|
#
|
|
|
|
dh_movefiles -picu-locales \
|
2000-10-24 23:15:48 +00:00
|
|
|
$(iculibdir)
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
|
|
|
# build icu-data from the source data
|
|
|
|
#
|
2000-10-20 05:28:15 +00:00
|
|
|
test -d debian/icu-data/$(datasrcdir) || \
|
|
|
|
mkdir -p debian/icu-data/$(datasrcdir)
|
2000-10-19 20:58:30 +00:00
|
|
|
install -m 644 $(srcdir)/../data/ucname.txt \
|
|
|
|
$(srcdir)/../data/*.ucm \
|
2000-10-20 05:28:15 +00:00
|
|
|
debian/icu-data/$(datasrcdir)
|
|
|
|
test -d debian/icu-data/$(datasrcdir)/unidata || \
|
|
|
|
mkdir -p debian/icu-data/$(datasrcdir)/unidata
|
2000-10-19 20:58:30 +00:00
|
|
|
install -m 644 $(srcdir)/../data/unidata/*.* \
|
2000-10-20 05:28:15 +00:00
|
|
|
debian/icu-data/$(datasrcdir)/unidata
|
|
|
|
unidatafile=`(cd $(srcdir)/../data; ls UnicodeData*.txt)`; cd debian/icu-data/$(datasrcdir) && ln -s unidata/UnicodeData.txt $$unidatafile
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
|
|
|
# build icu-i18ndata from the source data
|
|
|
|
#
|
2000-10-20 05:28:15 +00:00
|
|
|
test -d debian/icu-i18ndata/$(datasrcdir) || \
|
|
|
|
mkdir -p debian/icu-i18ndata/$(datasrcdir)
|
2000-10-19 20:58:30 +00:00
|
|
|
install -m 644 $(srcdir)/../data/*.txt \
|
|
|
|
$(srcdir)/../data/*.brk \
|
2000-10-20 05:28:15 +00:00
|
|
|
debian/icu-i18ndata/$(datasrcdir)
|
|
|
|
cd debian/icu-i18ndata/$(datasrcdir) && \
|
2000-10-26 22:03:22 +00:00
|
|
|
$(RM) convrtrs.txt UnicodeData*.txt ucname.txt
|
2000-10-19 20:58:30 +00:00
|
|
|
#
|
|
|
|
# do a bit of cleanup
|
|
|
|
#
|
2000-10-24 23:15:48 +00:00
|
|
|
rm -rf debian/tmp/etc debian/tmp/usr/sbin \
|
2000-10-25 16:39:25 +00:00
|
|
|
debian/tmp/$(iculibdir) \
|
2000-10-19 20:58:30 +00:00
|
|
|
debian/tmp/usr/share/man
|
|
|
|
#
|
|
|
|
# continue to prepare packages
|
|
|
|
#
|
|
|
|
# dh_installdebconf
|
|
|
|
dh_installdocs docs
|
|
|
|
dh_installexamples $(srcdir)/samples/*
|
|
|
|
dh_installmenu
|
|
|
|
# dh_installemacsen
|
|
|
|
# dh_installpam
|
|
|
|
# dh_installinit
|
|
|
|
dh_installcron
|
|
|
|
dh_installmanpages -picu
|
|
|
|
dh_installinfo
|
|
|
|
dh_undocumented -picu genccode.8 gencmn.8 gennames.8 \
|
|
|
|
genprops.8 gentz.8 pkgdata.8
|
|
|
|
dh_installchangelogs
|
|
|
|
dh_link
|
|
|
|
dh_strip
|
|
|
|
dh_compress
|
|
|
|
dh_fixperms
|
|
|
|
# CVS fixup
|
|
|
|
if test -d CVS; then find debian/tmp -name CVS -print | xargs rm -r; fi
|
|
|
|
# You may want to make some executables suid here.
|
|
|
|
dh_suidregister
|
|
|
|
dh_makeshlibs
|
|
|
|
dh_installdeb
|
|
|
|
# dh_perl
|
|
|
|
dh_shlibdeps && \
|
|
|
|
sed 's/ libicu16[^,]*,//' debian/libicu$(major).substvars >debian/libicu$(major).substvars.new && mv debian/libicu$(major).substvars.new debian/libicu$(major).substvars
|
|
|
|
dh_gencontrol -- -Vversion=$(version) -Vmajor=$(major)
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
|
|
|
|
|
|
|
binary: binary-indep binary-arch
|
|
|
|
.PHONY: build clean binary-indep binary-arch binary install
|