forked from hime-ime/hime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-deb
193 lines (193 loc) · 5.63 KB
/
gen-deb
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/sh
rm -fr debian
patch -p1 < $0
chmod 755 debian/rules
sed -i "s#9-9#`cat VERSION.hime | sed -e 's/.pre/~pre/' -e 's/$/-0/'`#" debian/changelog
exec dpkg-buildpackage -b
--- a/debian/changelog
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+hime (9-9) experimental; urgency=low
+
+ * New snapshot.
+
+ -- Kan-Ru Chen <koster@debian.org> Mon, 28 Feb 2011 18:07:18 +0800
--- a/debian/ckqt.sh
+++ b/debian/ckqt.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+[ ! -e debian/hime/usr/lib/qt4/plugins/inputmethods/im-hime.so ] && sed -i 's/, hime-qt4-immodule//' debian/hime/DEBIAN/control
+[ ! -e debian/hime/usr/lib/qt3/plugins/inputmethods/im-hime.so ] && sed -i 's/, hime-qt3-immodule//' debian/hime/DEBIAN/control
+[ ! -e debian/hime/usr/lib/hime/chewing-module.so ] && sed -i 's/, libchewing3//' debian/hime/DEBIAN/control
+if [ ! -e debian/hime/usr/lib/hime/anthy-module.so ]; then
+ grep -v 'Suggests: kasumi' debian/hime/DEBIAN/control | sed 's/, anthy//' > debian/hime/DEBIAN/control.in
+ mv debian/hime/DEBIAN/control.in debian/hime/DEBIAN/control
+fi
+if [ -d debian/hime/usr/lib/gtk-3.0/immodules ]; then
+ mkdir -p debian/hime/usr/lib/gtk-3.0/3.0.0
+ mv debian/hime/usr/lib/gtk-3.0/immodules debian/hime/usr/lib/gtk-3.0/3.0.0/
+fi
+mkdir -p debian/hime/usr/lib/gtk-2.0/2.10.0
+mv debian/hime/usr/lib/gtk-2.0/immodules debian/hime/usr/lib/gtk-2.0/2.10.0/
+/usr/lib/libgtk2.0-0/gtk-query-immodules-2.0 debian/hime/usr/lib/gtk-2.0/2.10.0/immodules/im-hime.so | grep hime | tail -n 1 >> debian/hime/usr/lib/gtk-2.0/2.10.0/immodule-files.d/hime.immodules
+true
--- a/debian/compat
+++ b/debian/compat
@@ -0,0 +1 @@
+7
--- a/debian/control
+++ b/debian/control
@@ -0,0 +1,24 @@
+Source: hime
+Section: utils
+Priority: optional
+Maintainer: Kan-Ru Chen <koster@debian.org>
+Build-Depends: debhelper (>= 7.0.50~), libgtk2.0-dev (>= 2.10.0), libxtst-dev, dpkg | libgtk-3-dev | libqt4-dev | libqt3-mt-dev | libanthy-dev | libchewing3-dev
+Standards-Version: 3.9.1
+
+Package: hime
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: im-switch | im-config, anthy, libchewing3
+Suggests: kasumi
+Conflicts: hime-dev, hime-qt4-immodule, hime-qt3-immodule
+Replaces: hime-dev, hime-qt4-immodule, hime-qt3-immodule
+Provides: hime-dev, hime-qt4-immodule, hime-qt3-immodule
+Description: an GTK+ based input method platform for Chinese users
+ Hime is an input method platform, which supports GTK+/QT immodule and XIM.
+ Hime is focused mainly on Traditional Chinese. However, it is also very useful
+ for Simplified Chinese, Japanese, and many other languages.
+ .
+ Input method table format of hime is almost as same as those of xcin and scim.
+ .
+ This package contains an GTK+ immodule. If you want to use QT immodule, please
+ install hime-qt3-immodule package.
--- a/debian/hime.immodules
+++ b/debian/hime.immodules
@@ -0,0 +1 @@
+"/usr/lib/gtk-2.0/2.10.0/immodules/im-hime.so"
--- a/debian/im-switch/hime
+++ b/debian/im-switch/hime
@@ -0,0 +1,15 @@
+XIM=hime
+XIM_PROGRAM=/usr/bin/hime
+XIM_ARGS=
+GTK_IM_MODULE=hime
+if [ ! -e /usr/lib/qt3/plugins/inputmethods/im-hime.so ]; then
+ QT_IM_MODULE=xim
+else
+ QT_IM_MODULE=hime
+fi
+if [ ! -e /usr/lib/qt4/plugins/inputmethods/im-hime.so ]; then
+ QT4_IM_MODULE=xim
+else
+ QT4_IM_MODULE=hime
+fi
+DEPENDS=
--- a/debian/install
+++ b/debian/install
@@ -0,0 +1,4 @@
+im-client/hime-im-client.h usr/include
+im-client/hime-im-client-attr.h usr/include
+debian/im-switch/hime etc/X11/xinit/xinput.d
+debian/hime.immodules usr/lib/gtk-2.0/2.10.0/immodule-files.d
--- a/debian/links
+++ b/debian/links
@@ -0,0 +1,5 @@
+usr/share/man/man1/hime-phoa2d.1.gz usr/share/man/man1/hime-phod2a.1.gz
+usr/share/man/man1/hime-sim2trad.1.gz usr/share/man/man1/hime-trad2sim.1.gz
+usr/share/man/man1/hime-tsa2d32.1.gz usr/share/man/man1/hime-tsd2a.1.gz
+usr/share/man/man1/hime-tsa2d32.1.gz usr/share/man/man1/hime-tsd2a32.1.gz
+usr/share/man/man1/hime-tsa2d32.1.gz usr/share/man/man1/hime-tsin2gtab-phrase.1.gz
--- a/debian/postinst
+++ b/debian/postinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+# postinst script for hime
+
+set -e
+
+ua_inst () {
+ update-alternatives \
+ --install /etc/X11/xinit/xinput.d/$1 xinput-$1 \
+ /etc/X11/xinit/xinput.d/$2 $3 ;
+}
+
+case "$1" in
+ configure)
+ # Set up default
+ ua_inst all_ALL hime 0
+ ua_inst zh_CN hime 30
+ ua_inst zh_TW hime 50
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- a/debian/prerm
+++ b/debian/prerm
@@ -0,0 +1,28 @@
+#!/bin/sh
+# prerm script for hime
+
+set -e
+
+ua_remove () {
+ update-alternatives \
+ --remove xinput-$1 \
+ /etc/X11/xinit/xinput.d/$2 ;
+}
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ ua_remove all_ALL hime
+ ua_remove zh_CN hime
+ ua_remove zh_TW hime
+ ;;
+ failed-upgrade)
+ ;;
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- a/debian/rules
+++ b/debian/rules
@@ -0,0 +1,23 @@
+#!/usr/bin/make -f
+%:
+ dh $@
+
+override_dh_auto_configure:
+ sed -i 's~/usr/lib/~/usr/share/~' qt-im/Makefile
+ sed -i 's~/usr/$$(LIB)/~/usr/share/~' qt4-im/Makefile
+ sed -i 's~lib64~lib64foo~' configure
+ ./configure --prefix=/usr --use_i18n=Y --use_qt3=Y
+
+override_dh_auto_clean:
+ $(MAKE) clean
+ sed -i 's~/usr/share/~/usr/lib/~' qt-im/Makefile
+ sed -i 's~/usr/share/~/usr/$$(LIB)/~' qt4-im/Makefile
+ sed -i 's~lib64foo~lib64~' configure
+ dh_clean
+
+override_dh_shlibdeps:
+ dh_shlibdeps --exclude=im-hime.so --exclude=anthy-module.so --exclude=chewing-module.so
+
+override_dh_gencontrol:
+ dh_gencontrol
+ sh debian/ckqt.sh