forked from lewtds/xvnkb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxvnkb.spec
131 lines (106 loc) · 3.51 KB
/
xvnkb.spec
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
%define name xvnkb
%define version 0.2.8
%define rel 1
%define myprefix /usr/local
Summary: xvnkb - Vietnamese keyboard input for X-Window
Name: %{name}
Version: %{version}
Release: %{rel}
License: GPL
Group: System/Internationalization
URL: http://xvnkb.sourceforge.net/
Source: http://xvnkb.sourceforge.net/%{name}-%{version}.tar.bz2
Prefix: %{myprefix}
BuildRoot: %{_tmppath}/%{name}-buildroot
#Packager: Dao Hai Lam <lam at visc-network dot com>
%description
xvnkb is a Vietnamese keyboard input for X-Window. It provides an
useful way for editing Vietnamese on X-Window environment with
popular input methods and charsets.
xvnkb 0.2.x support UTF-8 Encoding ;). Good news, eh?
%prep
%setup
%build
export CFLAGS="$RPM_OPT_FLAGS"
./configure --use-extstrocke
make
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{myprefix}/{bin,lib,share}
mkdir -p $RPM_BUILD_ROOT%{myprefix}/share/%{name}
install -m 755 %{name} $RPM_BUILD_ROOT%{myprefix}/bin
install -m 755 %{name}.so.%{version} $RPM_BUILD_ROOT%{myprefix}/lib
install -m 755 tools/xvnkb_ctrl $RPM_BUILD_ROOT%{myprefix}/bin
install -m 755 scripts/* $RPM_BUILD_ROOT%{myprefix}/share/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%post
VERSION="%{version}"
OL=`echo $LD_PRELOAD | grep xvnkb.so`
LD="/etc/ld.so.preload"
SO="/lib/xvnkb.so"
XVNKB_CORE="$SO.$VERSION"
unset LD_PRELOAD N
while [ -f $XVNKB_CORE ]; do
if [ "$N" = "" ]; then
N=1
else
N=$((N + 1))
fi
XVNKB_CORE="$SO.$VERSION-$N"
done
cp %{myprefix}/lib/xvnkb.so.$VERSION $XVNKB_CORE
chattr +i $XVNKB_CORE
if [ -f "$LD" ]; then
grep -v xvnkb.so $LD > $LD.xvnkb
/bin/mv -f $LD.xvnkb $LD
fi
echo "$XVNKB_CORE" >> $LD
if [ "$LANG" = "C" ]; then
LANG="en_US"
fi
if [ "`echo $LANG | grep UTF-8`" = "" ]; then
echo "If you want to input Vietnamese Unicode, please run"
echo
echo " # $PREFIX/bin/xvnkb_localeconf.sh $LANG.UTF-8"
echo
echo "and set your LANG to $LANG.UTF-8."
echo "See xvnkb documents at %{myprefix}/share/doc/xvnkb for more information."
fi
if [ "$OL" != "" ]; then
echo -e "\\033[1;31m"
echo "* NOTICE:"
echo "You are using LD_PRELOAD to load xvnkb core. If you set it somewhere else"
echo "(e.g. /etc/profile, /etc/bashrc, ~/.bash_profile, ~/.bashrc, ~/.xinitrc)"
echo "by yourself, please remove it also!"
echo -e "\\033[0;39m"
fi
echo "You can use xvnkb now! If you are using X, please restart your Window Manager."
echo "It will load xvnkb core control automatically for you and affect to all"
echo "applications. Right now, xvnkb core control can affect to new starting"
echo "applications only. Run \"xvnkb\" to control status."
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog README* INSTALL* TODO THANKS COPYING
%doc contrib/profile scripts/*.sh doc/*
%{myprefix}/*/*
%changelog
* Fri Jan 16 2004 Dao Hai Lam <daohailam at yahoo dot com>
- use new installation style
* Sun Nov 16 2003 Dao Hai Lam <daohailam at yahoo dot com>
- use new configure's options
- anti email spam :)
* Wed Oct 15 2003 Nguyen Dai Quy <quy at nguyendai dot org>
- correction for multi-target RPM building.
* Sun Apr 20 2003 Dao Hai Lam <lam at visc-network dot com>
- updated to version 0.2.8
* Sun Mar 2 2003 Dao Hai Lam <lam at visc-network dot com>
- updated to version 0.2.7
* Sun Feb 9 2003 Dao Hai Lam <lam at visc-network dot com>
- updated to version 0.2.6
* Tue Aug 13 2002 Dao Hai Lam <lam at visc-network dot com>
- updated to version 0.2.5
* Thu May 9 2002 Nguyen-Dai Quy <Quy at NguyenDai dot org>
- updated to version 0.2.4
* Mon May 6 2002 Nguyen-Dai Quy <Quy at NguyenDai dot org>
- build RPM for version 0.2.2