LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1537|回复: 4

自行編譯包裝stardict

[复制链接]
发表于 2005-7-15 10:01:11 | 显示全部楼层 |阅读模式
要將StarDict包成rpm遇到了幾個問題

(1)gconftool-2在/opt/gnome/bin/下面,但root的PATH?K不包含這個路?

(2)編譯時還需要scrollkeeper這個工具

另外說明一下,若是自己由原始碼安裝stardict,或安裝自己編譯的rpm,就不用去找libstdc++.so.6了

出現這種需求應該是stardict網站上rpm的包裝者使用了較新版本的gcc?砭幾g(?應該是吧?)

包裝的方法如下

(1)先將stardict-2.4.4.tar.bz2載回?恚旁/usr/src/packages/SOURCES/下

(2)解開stardict-2.4.4.tar.bz2取出其中的stardict.spec(複製到例如/home/abc/stardict下),修改如下(有中文註解處)

%define release 1.suse(表示此版本for SuSE)
%define prefix /usr
%define name stardict
%define version 2.4.4


Summary: StarDict dictionary
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Vendor: GNOME
URL: http://stardict.sourceforge.net
Group: Applications/System
Source0: %{name}-%{version}.tar.bz2
Packager: Hu Zheng <huzheng_001@163.com>
BuildRoot: %{_builddir}/%{name}-%{version}-root

BuildRequires: libgnomeui-devel >= 2.2.0


Requires: libgnome >= 2.2.0
Requires: libgnomeui >= 2.2.0
Requires: libbonobo >= 2.2.0
Requires: bonobo-activation >= 2.2.0

Docdir: %{prefix}/share/doc

%description
StarDict is a Cross-Platform and international dictionary written in Gtk2.
It has powerful features such as "Glob-style pattern matching," "Scan
seletion word," "Fuzzy search," etc.

%prep
%setup

%build

%configure --disable-schemas-install
make

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-, root, root)
%{_bindir}/stardict
%{_datadir}/applications/stardict.desktop
%{_datadir}/stardict
%{_datadir}/locale/*/LC_MESSAGES/stardict.mo
%{_datadir}/idl
%{_libdir}/bonobo/servers/*.server
%{_datadir}/pixmaps/stardict.png
%{_sysconfdir}/gconf/schemas/*.schemas
%{_datadir}/omf
%doc %{_datadir}/man/man1/stardict.1*
%doc %{_datadir}/gnome/help/stardict


%post
GCONF_CONFIG_SOURCE=`/opt/gnome/bin/gconftool-2 --get-default-source` /opt/gnome/bin/gconftool-2 --makefile-install-rule (指定絕對路?) %{_sysconfdir}/gconf/schemas/stardict.schemas >/dev/null
if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update; fi

%postun
if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update; fi

%changelog
* Sun Nov 28 2004 Hu Zheng <huzheng_001@163.com> 2.4.4
- Public release of StarDict 2.4.4.

* Thu Feb 19 2004 Hu Zheng <huzheng_001@163.com> 2.4.3
- Public release of StarDict 2.4.3.

* Sat Nov 15 2003 Hu Zheng <huzheng_001@163.com> 2.4.2
- Public release of StarDict 2.4.2.

* Sun Sep 28 2003 Hu Zheng <huzheng_001@163.com> 2.4.1
- Public release of StarDict 2.4.1.

* Thu Aug 28 2003 Hu Zheng <huzheng_001@163.com> 2.4.0
- Public release of StarDict 2.4.0.

* Sat Jun 28 2003 Hu Zheng <huzheng_001@163.com> 2.2.1
- Public release of StarDict 2.2.1.

* Sun Jun 01 2003 Hu Zheng <huzheng_001@163.com> 2.2.0
- Public release of StarDict 2.2.0.

* Sun May 18 2003 Hu Zheng <huzheng_001@163.com> 2.1.0
- Public release of StarDict 2.1.0.

* Fri May 02 2003 Hu Zheng <huzheng_001@163.com> 2.0.0
- Public release of StarDict 2.0.0.

* Wed Apr 9 2003 Hu Zheng <huzheng_001@163.com> 2.0.0-pre2
- Second public preview release of StarDict 2.

* Sun Mar 30 2003 Hu Zheng <huzheng_001@163.com> 2.0.0-pre1
- First public preview release of StarDict 2.

(3)開始

#PATH="$PATH:/opt/gnome/bin" (將/opt/gnome/bin加入到root的路?街)

#cd /home/abc/stardict (切換到stardict.spec所在目錄)

#rpmbuild -ba stardict.spec

大功告成了

你可以在/usr/src/packages/RPMS/i586下面看到stardict-2.4.4-1.suse.i586.rpm

#cd /usr/src/packages/RPMS/i586

#rpm -ivh stardict*.rpm

(4)字典則視個人需求到StarDict網站下載,可以直接下載rpm



以上為個人經驗,大家參考一下
发表于 2005-7-20 16:56:29 | 显示全部楼层
感谢chen242, 按照您的方法我已经成功的安装了stardict-2.4.4,非常感谢!!!
回复 支持 反对

使用道具 举报

发表于 2005-7-21 14:41:27 | 显示全部楼层
好文,顶一下。
回复 支持 反对

使用道具 举报

发表于 2006-11-28 16:04:21 | 显示全部楼层
11R6/include  -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_ SOURCE=2 -MT stardict.o -MD -MP -MF ".deps/stardict.Tpo[color="Red"]" -c -o stardict.o stardi ct.cpp; \
then mv -f ".deps/stardict.Tpo" ".deps/stardict.Po"; else rm -f ".deps/stardict. Tpo"; exit 1; fi
skin.h:11: error: extra qualification ‘_Skin_cursor::’ on member ‘_Skin_cursor’
skin.h:12: error: extra qualification ‘_Skin_cursor::’ on member ‘_Skin_cursor’
stardict.cpp: In function ‘gint client_die_cb(GnomeClient*, void*)’:
stardict.cpp:1434: warning: control reaches end of non-void function
make[3]: *** [stardict.o] Error 1
make[3]: Leaving directory `/usr/src/packages/BUILD/stardict-2.4.4/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/packages/BUILD/stardict-2.4.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/stardict-2.4.4'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.61903 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.61903 (%build)
suse:/home/stardict-2.4.4 #
  (2)編譯時還需要scrollkeeper這個工具[color="Red"]这个我没有。在哪找,如何用
回复 支持 反对

使用道具 举报

发表于 2006-11-29 10:44:03 | 显示全部楼层
貌似stardict主页上就有直接可以用的rpm包。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表