~ubuntu-branches/ubuntu/raring/sunpinyin/raring

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): YunQiang Su
  • Date: 2012-03-30 15:31:55 UTC
  • mfrom: (1.1.3) (1.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20120330153155-qgls77sogzgtg9zp
Tags: 2.0.3+git20120222-1
* 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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
# Sample debian/rules that uses debhelper.
3
 
# GNU copyright 1997 to 1999 by Joey Hess.
4
 
#
5
 
# Modified for sunpinyin package by 
 
2
export DH_VERBOSE=1
6
3
# Liang Guo <bluestonechina@gmail.com> 2010
 
4
# YunQiang Su <wzssyqa@gmail.com>, 2012
 
5
 
 
6
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
7
7
 
8
8
SCONS=scons 
9
9
POD2MAN=pod2man
10
10
PROGS=genpyt idngram_merge slminfo slmseg tslminfo getWordFreq ids2ngram \
11
11
      mmseg slmbuild slmprune slmthread tslmendian tslmpack
12
12
 
13
 
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
14
 
  CXXFLAGS += -g
15
 
endif
16
 
 
17
 
CXXFLAGS += -pipe
18
 
 
19
 
build: build-arch build-indep
20
 
build-arch: build-stamp
21
 
build-indep: build-stamp
22
 
build-stamp: 
23
 
        dh_quilt_patch
24
 
        -$(SCONS)  --prefix=$(DEB_DESTDIR)/usr 
 
13
%:
 
14
        dh $@ --with python2
 
15
 
 
16
override_dh_auto_clean:
 
17
        dh_auto_clean
 
18
        scons -c .
 
19
        rm -rf .sconf_temp
 
20
 
 
21
override_dh_auto_build:
 
22
        $(SCONS)  --prefix=/usr --libdir=/usr/lib/${DEB_HOST_MULTIARCH}/ --libdatadir=/usr/lib/${DEB_HOST_MULTIARCH}
25
23
        for p in $(PROGS); do $(POD2MAN) --section 1 doc/$$p.pod > doc/$$p.1; done
26
 
        touch build-stamp
27
 
 
28
 
clean: clean-patched 
29
 
clean-patched:
30
 
        dh_testdir
31
 
        dh_testroot
32
 
        -$(SCONS) -c
33
 
        -rm -r config.log config.h      \
34
 
                .sconf_temp .sconsign.dblite \
35
 
                configure.conf sunpinyin-2.0.pc
36
 
        -for p in $(PROGS); do rm doc/$$p.1; done
37
 
        dh_quilt_unpatch
38
 
        dh_clean 
39
 
 
40
 
install: install-stamp
41
 
install-stamp: build-stamp
42
 
        dh_testdir
43
 
        dh_testroot
44
 
        dh_prep
45
 
        dh_installdirs
46
 
        -$(SCONS) install --prefix=$(DEB_DESTDIR)/usr --install-sandbox=debian/tmp
47
 
        -for p in $(PROGS); do install -D -m 0755 build/$$p $(CURDIR)/debian/tmp/usr/bin/$$p; done
48
 
        mkdir -p $(CURDIR)/debian/tmp/usr/share/sunpinyin/
49
 
        cp -r python $(CURDIR)/debian/tmp/usr/share/sunpinyin/
50
 
        dh_install --sourcedir=debian/tmp --fail-missing
51
 
        touch install-stamp
52
 
 
53
 
binary-arch: build install
54
 
        dh_testdir
55
 
        dh_testroot
56
 
        dh_installchangelogs
57
 
        dh_installdocs 
58
 
        dh_installexamples
59
 
        dh_installman
60
 
        dh_link
 
24
        
 
25
override_dh_auto_install:
 
26
        $(SCONS) install --install-sandbox=debian/tmp
 
27
        for p in $(PROGS); do install -D -m 0755 build/$$p $(CURDIR)/debian/tmp/usr/bin/$$p; done
 
28
 
 
29
override_dh_install:
 
30
        dh_install --fail-missing
 
31
        rm -f debian/tmp/python-sunpinyin/usr/share/pyshared/sunpinyin/setup.py
 
32
 
 
33
override_dh_strip:
 
34
        dh_strip -plibsunpinyin3 --dbg-package=libsunpinyin3-dbg
61
35
        dh_strip
62
 
        dh_compress
63
 
        dh_fixperms
64
 
        dh_makeshlibs -V
65
 
        dh_installdeb
66
 
        dh_shlibdeps 
67
 
        dh_gencontrol
68
 
        dh_md5sums
69
 
        dh_builddeb
70
 
 
71
 
# Build architecture-independent files here.
72
 
binary-indep: build install
73
 
# We have nothing to do by default.
74
 
 
75
 
binary: binary-indep binary-arch
76
 
.PHONY: build clean binary-indep binary-arch binary install
77