diff --git a/debian/changelog b/debian/changelog index f1f5415..a9b4f58 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +sunpinyin (2.0.3+git20120222-1) unstable; urgency=low + + * Team upload: git snapshot 20120222. + - fix breaks if LDFLAGS in environment contains + multiple words (Closese #646001). + - rm patches merged to upstream: + append-os-environ-toenv.patch + fix-ftbfs-on-sh.patch + remove-10-candidate-words-limitation.patch + - refresh disable-lm-dict-compile.patch. + * Bump stardard version to 3.9.3: no modify needed. + * add libsunpinyin3-dbg and python-sunpinyin packages. + * debian/compat to 9, multiarch it. + * rewrite debian/rules with dh 7 format. + + -- YunQiang Su Fri, 30 Mar 2012 15:31:55 +0800 + sunpinyin (2.0.3-5) unstable; urgency=low * Call dh_makeshlibs with -V, rather than dh_shlibdeps diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..77a8eaf --- /dev/null +++ b/debian/clean @@ -0,0 +1,9 @@ +doc/*.1 + +python/*.pyc +python/importer/*.pyc +config.log +config.h +.sconsign.dblite +configure.conf +sunpinyin-2.0.pc diff --git a/debian/compat b/debian/compat index 7f8f011..ec63514 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/debian/control b/debian/control index c3ffe92..10a37a9 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,9 @@ Priority: optional Maintainer: IME Packaging Team Uploaders: Liang Guo -Build-Depends: debhelper (>= 7.0.50~), scons, libsqlite3-dev, pkg-config, quilt (>= 0.46-8~) -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 9), scons, libsqlite3-dev, pkg-config, + quilt (>= 0.46-8~), python-dev (>= 2.6.6-3~) +Standards-Version: 3.9.3 Section: libs DM-Upload-Allowed: yes Homepage: http://code.google.com/p/sunpinyin @@ -24,12 +25,34 @@ Package: libsunpinyin3 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} Recommends: sunpinyin-data Description: Simplified Chinese Input Method from SUN (runtime) Sunpinyin is a statistical language model (SLM) based input method engine for Simplified Chinese, it features full sentence input. . This package contains the runtime library. + +Package: libsunpinyin3-dbg +Priority: extra +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libsunpinyin3 (= ${binary:Version}) +Section: debug +Description: Simplified Chinese Input Method from SUN (debug) + Sunpinyin is a statistical language model (SLM) based input method + engine for Simplified Chinese, it features full sentence input. + . + This package contains the debug symbols of shared library. + +Package: python-sunpinyin +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, libsunpinyin3 +Section: python +Description: Simplified Chinese Input Method from SUN (python binding) + Sunpinyin is a statistical language model (SLM) based input method + engine for Simplified Chinese, it features full sentence input. + . + This package contains the python binding of sunpinyin. Package: sunpinyin-utils Section: utils diff --git a/debian/libsunpinyin-dev.install b/debian/libsunpinyin-dev.install index 5774e64..7df81cd 100644 --- a/debian/libsunpinyin-dev.install +++ b/debian/libsunpinyin-dev.install @@ -1,3 +1,3 @@ usr/include/* -usr/lib/lib*.so -usr/lib/pkgconfig/* +usr/lib/*/lib*.so +usr/lib/*/pkgconfig/* diff --git a/debian/libsunpinyin3.install b/debian/libsunpinyin3.install index d0dbfd1..3ddde58 100644 --- a/debian/libsunpinyin3.install +++ b/debian/libsunpinyin3.install @@ -1 +1 @@ -usr/lib/lib*.so.* +usr/lib/*/lib*.so.* diff --git a/debian/patches/append-os-environ-toenv.patch b/debian/patches/append-os-environ-toenv.patch deleted file mode 100644 index fbd73ba..0000000 --- a/debian/patches/append-os-environ-toenv.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Mike -Description: force some flags always on in linkflags - - * SConstruct: force some flags always on in linkflags - -Origin: upstream - ---- a/SConstruct -+++ b/SConstruct -@@ -180,12 +180,6 @@ - libdatadir = env['LIBDATADIR'] + '/sunpinyin/data' - headersdir = env['PREFIX'] + '/include/sunpinyin-2.0' - --if GetOS() != 'Darwin': -- env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major]) -- --if GetOption('rpath') is not None and GetOS() != 'Darwin': -- env.Append(LINKFLAGS='-Wl,-R -Wl,%s' % GetOption('rpath')) -- - # pass through environmental variables - envvar = [('CC', 'CC'), - ('CXX', 'CXX'), -@@ -202,6 +196,12 @@ - env.Append(CFLAGS=extra_cflags) - env.Append(CXXFLAGS=extra_cflags) - -+if GetOS() != 'Darwin': -+ env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major]) -+ -+if GetOption('rpath') is not None and GetOS() != 'Darwin': -+ env.Append(LINKFLAGS=['-Wl,-R', '-Wl,%s' % GetOption('rpath')]) -+ - # - #==============================configure================================ - # diff --git a/debian/patches/disable-lm-dict-compile.patch b/debian/patches/disable-lm-dict-compile.patch index 4aa0c27..10645ea 100644 --- a/debian/patches/disable-lm-dict-compile.patch +++ b/debian/patches/disable-lm-dict-compile.patch @@ -1,8 +1,10 @@ Disable LM data and dictionary data compile, these data will be in another package. ---- a/SConstruct -+++ b/SConstruct -@@ -350,12 +350,6 @@ +Index: sunpinyin/SConstruct +=================================================================== +--- sunpinyin.orig/SConstruct 2012-03-30 15:49:08.623210295 +0800 ++++ sunpinyin/SConstruct 2012-03-30 15:49:14.659240221 +0800 +@@ -367,12 +367,6 @@ lib = env.SharedLibrary('sunpinyin-%d.%d' % (abi_major, abi_minor), source=imesource) @@ -15,7 +17,7 @@ if GetOption('clean'): os.environ['TAR'] = env['TAR'] os.environ['MAKE'] = env['MAKE'] -@@ -384,9 +378,7 @@ +@@ -401,9 +395,7 @@ lib_pkgconfig_target = env.Install(libdir+'/pkgconfig', ['sunpinyin-2.0.pc']) diff --git a/debian/patches/fix-ftbfs-on-sh.patch b/debian/patches/fix-ftbfs-on-sh.patch deleted file mode 100644 index 12d1776..0000000 --- a/debian/patches/fix-ftbfs-on-sh.patch +++ /dev/null @@ -1,22 +0,0 @@ -Fix FTBFS on SuperH platform, thanks to Nobuhiro Iwamatsu. ---- a/SConstruct -+++ b/SConstruct -@@ -230,7 +230,7 @@ - || defined(_POWER) || defined(__powerpc__) \ - || defined(__ppc__) || defined(__hpux) || defined(__hppa) \ - || defined(_MIPSEB) || defined(_POWER) \ -- || defined(__s390__) -+ || defined(__s390__) || (defined(__sh__) && defined(__BIG_ENDIAN__)) - # define WORDS_BIGENDIAN 1 - - #elif defined(__i386__) || defined(__i386) \ -@@ -240,7 +240,8 @@ - || defined(__amd64__) || defined(_M_AMD64) \ - || defined(__x86_64) || defined(__x86_64__) \ - || defined(_M_X64) || defined(__bfin__) \ -- || defined(__alpha__) || defined(__ARMEL__) -+ || defined(__alpha__) || defined(__ARMEL__) \ -+ || (defined(__sh__) && defined(__LITTLE_ENDIAN__)) - # undef WORDS_BIGENDIAN - - #else diff --git a/debian/patches/remove-10-candidate-words-limitation.patch b/debian/patches/remove-10-candidate-words-limitation.patch deleted file mode 100644 index ae6b830..0000000 --- a/debian/patches/remove-10-candidate-words-limitation.patch +++ /dev/null @@ -1,15 +0,0 @@ -From: Weng Xuetian -Description: remove 10 candidate words limitation -Origin: vendor, https://github.com/sunpinyin/sunpinyin/commit/ecd26da914d672193149af651d6f01647fde7f88 - ---- a/src/ime-core/imi_view.h -+++ b/src/ime-core/imi_view.h -@@ -188,7 +188,7 @@ - CIMIWinHandler* getWinHandler(void) {return m_pWinHandler;} - - void setHotkeyProfile (CHotkeyProfile *prof) { m_pHotkeyProfile = prof;} -- void setCandiWindowSize (unsigned size) {m_candiWindowSize = size<10? size: 10;} -+ void setCandiWindowSize (unsigned size) {m_candiWindowSize = size;} - CHotkeyProfile* getHotkeyProfile() { return m_pHotkeyProfile; } - unsigned getCandiWindowSize() { return m_candiWindowSize; } - diff --git a/debian/patches/series b/debian/patches/series index 64dd81d..76677a9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,5 +1,2 @@ -append-os-environ-toenv.patch +strndup_in_cxx.patch disable-lm-dict-compile.patch -fix-ftbfs-on-sh.patch -fix-ftbfs-on-mipsel.patch -remove-10-candidate-words-limitation.patch diff --git a/debian/patches/strndup_in_cxx.patch b/debian/patches/strndup_in_cxx.patch new file mode 100644 index 0000000..9088783 --- /dev/null +++ b/debian/patches/strndup_in_cxx.patch @@ -0,0 +1,44 @@ +Index: sunpinyin/src/portability.cpp +=================================================================== +--- sunpinyin.orig/src/portability.cpp 2012-03-30 17:55:51.000000000 +0800 ++++ sunpinyin/src/portability.cpp 2012-03-30 17:59:24.869968967 +0800 +@@ -265,26 +265,4 @@ + return sz; + } + +-#if !defined (HAVE_STRNDUP) +-extern "C" char * +-strndup(const char *s, size_t n) +-{ +- size_t nMost; +- char *p = NULL; +- +- if (!s) +- return NULL; +- +-#ifdef __cplusplus +- nMost = std::min(strlen(s) + 1, n + 1); +-#else +- nMost = min(strlen(s) + 1, n + 1); +-#endif +- p = (char*)malloc(nMost); +- memcpy(p, s, nMost); +- p[nMost - 1] = '\0'; +- +- return p; +-} +-#endif //HAVE_STRNDUP + +Index: sunpinyin/src/portability.h +=================================================================== +--- sunpinyin.orig/src/portability.h 2012-03-30 17:55:51.000000000 +0800 ++++ sunpinyin/src/portability.h 2012-03-30 18:01:23.390556674 +0800 +@@ -326,8 +326,4 @@ + } + #endif + +-#if !defined (HAVE_STRNDUP) +-extern "C" char *strndup(const char *s, size_t n); +-#endif //HAVE_STRNDUP +- + #endif diff --git a/debian/python-sunpinyin.install b/debian/python-sunpinyin.install new file mode 100644 index 0000000..83fc8e7 --- /dev/null +++ b/debian/python-sunpinyin.install @@ -0,0 +1 @@ +python/* /usr/share/pyshared/sunpinyin/ diff --git a/debian/rules b/debian/rules index afb5452..94aef05 100755 --- a/debian/rules +++ b/debian/rules @@ -1,77 +1,35 @@ #!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# -# Modified for sunpinyin package by +export DH_VERBOSE=1 # Liang Guo 2010 +# YunQiang Su , 2012 + +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) SCONS=scons POD2MAN=pod2man PROGS=genpyt idngram_merge slminfo slmseg tslminfo getWordFreq ids2ngram \ mmseg slmbuild slmprune slmthread tslmendian tslmpack -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CXXFLAGS += -g -endif +%: + dh $@ --with python2 -CXXFLAGS += -pipe +override_dh_auto_clean: + dh_auto_clean + scons -c . + rm -rf .sconf_temp -build: build-arch build-indep -build-arch: build-stamp -build-indep: build-stamp -build-stamp: - dh_quilt_patch - -$(SCONS) --prefix=$(DEB_DESTDIR)/usr +override_dh_auto_build: + $(SCONS) --prefix=/usr --libdir=/usr/lib/${DEB_HOST_MULTIARCH}/ --libdatadir=/usr/lib/${DEB_HOST_MULTIARCH} for p in $(PROGS); do $(POD2MAN) --section 1 doc/$$p.pod > doc/$$p.1; done - touch build-stamp + +override_dh_auto_install: + $(SCONS) install --install-sandbox=debian/tmp + for p in $(PROGS); do install -D -m 0755 build/$$p $(CURDIR)/debian/tmp/usr/bin/$$p; done -clean: clean-patched -clean-patched: - dh_testdir - dh_testroot - -$(SCONS) -c - -rm -r config.log config.h \ - .sconf_temp .sconsign.dblite \ - configure.conf sunpinyin-2.0.pc - -for p in $(PROGS); do rm doc/$$p.1; done - dh_quilt_unpatch - dh_clean +override_dh_install: + dh_install --fail-missing + rm -f debian/tmp/python-sunpinyin/usr/share/pyshared/sunpinyin/setup.py -install: install-stamp -install-stamp: build-stamp - dh_testdir - dh_testroot - dh_prep - dh_installdirs - -$(SCONS) install --prefix=$(DEB_DESTDIR)/usr --install-sandbox=debian/tmp - -for p in $(PROGS); do install -D -m 0755 build/$$p $(CURDIR)/debian/tmp/usr/bin/$$p; done - mkdir -p $(CURDIR)/debian/tmp/usr/share/sunpinyin/ - cp -r python $(CURDIR)/debian/tmp/usr/share/sunpinyin/ - dh_install --sourcedir=debian/tmp --fail-missing - touch install-stamp - -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples - dh_installman - dh_link +override_dh_strip: + dh_strip -plibsunpinyin3 --dbg-package=libsunpinyin3-dbg dh_strip - dh_compress - dh_fixperms - dh_makeshlibs -V - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install - diff --git a/debian/sunpinyin-utils.install b/debian/sunpinyin-utils.install index b576c59..1df36c6 100644 --- a/debian/sunpinyin-utils.install +++ b/debian/sunpinyin-utils.install @@ -1,2 +1 @@ -usr/share/sunpinyin/* usr/bin/*