|
楼主 |
发表于 2004-10-3 23:00:36
|
显示全部楼层
这里有一个由压缩包直接创建 rpm/srpm 包的工具,但是它无法知道那些文件、目录应该被打进包里,你需要自己指定:
http://sourceforge.net/project/s ... amp;release_id=7939
下面是一个实际例子:
-------------------------------------------------------
- Summary: Challenging 2D Moto cross Platform Game
- Summary(zh_CN): 富有挑战性的 2D 摩托跨平台游戏
- Name: xmoto
- Version: 0.3.1
- Release: 1mgc
- Source0: http://download.tuxfamily.org/xmoto/xmoto/%{version}/xmoto-%{version}-src.tar.gz
- Source1: xmoto.desktop
- Source2: xmoto.png
- Patch0: xmoto-man.patch
- URL: http://xmoto.sourceforge.net
- Group: Amusements/Games
- Group(zh_CN): 娱乐/游戏
- Packager: Pascal Bleser <[email protected]>, kde <athena_star {at} 163 {dot} com>
- Distribution: Magic Linux 2.1
- License: GPL
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot-%(%{__id_u} -n)
- Requires: SDL, libgcc, libstdc++, libogg, libvorbis, lua, ode
- BuildRequires: gcc-c++, libstdc++, libstdc++-devel
- BuildRequires: SDL_mixer-devel, SDL_ttf-devel
- BuildRequires: curl-devel
- BuildRequires: ode-devel
- BuildRequires: lua-devel >= 5.0
- BuildRequires: libGL-devel
- BuildRequires: libGLU-devel
- BuildRequires: libjpeg-devel
- BuildRequires: libpng-devel
- BuildRequires: bzip2-devel
- BuildRequires: sqlite-devel
- %description
- X-Moto is a challenging 2D moto cross platform game, where physics play an all
- important role in the gameplay. You need to control your bike to its limit, if
- you want to have a chance finishing the more difficult of the challenges.
- %description -l zh_CN
- X-Moto 是一个极富挑战性的 2D 摩托车跨平台游戏。在游戏中,您可以亲历
- 所有重要角色。如果您想有机会完成更高难度的挑战,您必须竭尽全力控制
- 您的摩托车。
- %prep
- %setup -q
- %patch0
- #fix encoding
- sed -i 's/\r//' src/xmscene/Camera.cpp
- sed -i 's/\r//' src/xmscene/Camera.h
- #fix permissions
- chmod 644 src/xmscene/Camera.*
- %build
- export LDFLAGS=-L%{_prefix}/X11R6/%{_lib}
- %configure --with-enable-zoom=1
- %{__make} %{?_smp_mflags}
- %install
- %{__rm} -rf "%{buildroot}"
- %{__make} DESTDIR="%{buildroot}" install
- # Install desktop file and icon
- %{__mkdir_p} "%{buildroot}/usr/share/applications"
- %{__install} -m 0644 "%{SOURCE1}" "%{buildroot}/usr/share/applications/"
- %{__mkdir_p} "%{buildroot}/usr/share/pixmaps"
- %{__install} -m 0644 "%{SOURCE2}" "%{buildroot}/usr/share/pixmaps/"
- # Locale files
- %find_lang %{name} %{name}.lang
- %clean
- %{__rm} -rf %{buildroot} %{_builddir}/%{buildsubdir}
- %files -f %{name}.lang
- %defattr(-,root,root)
- %attr(0644,root,root) %doc AUTHORS ChangeLog COPYING NEWS README
- %{_bindir}
- %{_datadir}/xmoto
- %{_datadir}/applications/xmoto.desktop
- %{_datadir}/pixmaps/xmoto.png
- %{_mandir}
- %changelog
- * Thu Jul 12 2007 kde <athena_star {at} 163 {dot} com> - 0.3.1-1mgc
- - update to release 0.3.1
- * Thu Dec 29 2005 kde <[email protected]> 0.1.10-1mgc
- - update to release 0.1.10
- * Sat Oct 29 2005 kde <[email protected]> 0.1.6-1mgc
- - port to Magic Linux 2.0
- * Thu Oct 13 2005 Pascal Bleser <[email protected]> 0.1.6-1
- - new upstream version
- * Mon Oct 3 2005 Pascal Bleser <[email protected]> 0.1.4-1
- - new package
复制代码
几点注意:
1、要求必须翻译 spec,翻译必须符合 i18n 规范,统一使用 gb18030 编码和 locale;
2、rpm 标准分组信息参见上文;
3、注意例子里的标准构建根和 clean 小节的写法;
4、所有非命令行程序,都必须给出符合 magic 规范的菜单文件,即 desktop 文件:
(a) 提供简、繁体中文菜单,这样就能良好支持繁体中文区的用户,具体就是翻译 desktop 文件
(b) desktop 文件必须使用 utf-8 编码
(c) desktop 文件的分类(Categories)参考系统里其他相似类别的文件,例如:游戏统一写成 Categories=Application;Game;
例如 bzflag.desktop:
- [Desktop Entry]
- Encoding=UTF-8
- Name=BZFlag
- GenericName[zh_CN]=铁甲威龙
- GenericName[zh_TW]=鐵甲威龍
- Comment=A multiplayer 3D tank battle game
- Comment[zh_CN]=一个多人 3D 坦克战斗游戏
- Comment[zh_TW]=一個多人 3D 坦克戰鬥游戲
- Exec=bzflag
- Icon=bzflag.xpm
- Terminal=false
- Categories=Application;Game;
- Type=Application
复制代码
繁体中文有自己的特定用语,有时和简体中文不一样,比如大陆叫“宏”,台湾叫“巨集”,载入“配置”,台湾叫载入“组态”,我们叫“文件”和“文档”,台湾刚好相反,管文件叫文档,管文档叫文件,这个比较麻烦,我也只有一个不完善的繁体--->简体转换脚本,没有反向的。(参见置顶帖)。
[ 本帖最后由 KDE 于 2009-8-29 14:22 编辑 ] |
|