如何使用Redline RPM Java库创建RPM包? [英] How to create a RPM package with Redline RPM Java library?

查看:191
本文介绍了如何使用Redline RPM Java库创建RPM包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的Java游戏(目前打包为JARs + JNLP文件)创建一个RPM包。我使用Ant作为构建工具。我不能使用依赖于平台的工具,因为使用我的源代码的少数开发人员使用多个操作系统,不一定是GNU Linux。

I would like to create a RPM package for my Java game (currently packaged as JARs + JNLP file). I use Ant as a build tool. I cannot use platform-dependent tools as the few developers who use my source code use several operating systems, not necessarily GNU Linux unlike me.

起初,我尝试使用 JDIC 但它的源代码多年来一直没有维护,我不得不修改大量的东西只是为了让它重新编译。而且,它只是调用本机RPM工具。然后,我找到了 RPM Ant任务,但它使用了引擎盖下的原生RPM工具也是如此。之后,我找到了 RPM Maven插件,但我不想切换到另一个版本工具现在只是为了创建一个RPM包。

At first, I tried to use JDIC but its source code hasn't been maintained for years and I had to modify tons of things just to make it compile anew. Moreover, it just calls the native RPM tools under the hood. Then, I found RPM Ant task but it uses the native RPM tools under the hood too. After that, I found RPM Maven plugin but I don't want to switch to another build tool now just to create a RPM package.

最后,我发现Redline RPM纯Java库有一个Ant任务,有一个例子这里。我仍然不明白如何使用它。我理解一些基本字段(组,版本,发布,名称)的作用,我知道我必须使用依赖来表示我的游戏至少需要Java 1.7但我不知道如何处理我的JAR,在哪里放置桌面快捷方式的.desktop文件以及在哪里放置调用主类来运行我的游戏的bash脚本。作为第一步,我想创建一个二进制包。我找到了另一个使用此库的示例此处 。我是否还必须提供卸载脚本?我应该使用postinstall脚本将.desktop文件复制到桌面目录中吗?我应该为第三方库使用tarfileset吗?我知道把JAR放到几个RPM中会更好,但我想在做更精细但更干净的事情之前做一些简单的事情。

Finally, I found Redline RPM pure Java library which has an Ant task, there is an example here. I still don't understand how to use it. I understand the role of a few basic fields (group, version, release, name), I know that I have to use "depends" to indicate that my game requires at least Java 1.7 but I don't know what to do with my JARs, where to put the .desktop file for the desktop shortcut and where to put the bash script that calls the main class to run my game. As a first step, I'd like to create a binary package. I have found another example using this library here. Do I have to provide an uninstall script too? Should I use a postinstall script to copy the .desktop file into the desktop directory? Should I use a tarfileset for the third party libraries? I know it would be better to put the JARs into several RPMs but I want to succeed in doing something simple before doing more elaborated but cleaner things.

推荐答案

我解决了我的问题这里。我只需要添加一个简短的脚本来运行应用程序。

I solved my problem here. I just have to add a short script to run the application.

PS:顺便说一下,我现在使用自己的工具(在引擎盖下使用Redline RPM),它是完全记录的,开源的(在GPL下)并且也适用于DEB,APP和EXE(通过NSIS),它被称为 Java Native Deployment Toolkit

P.S: By the way, I now use my own tool (which uses Redline RPM under the hood), it's fully documented, open source (under GPL) and works for DEB, APP and EXE (via NSIS) too, it's called Java Native Deployment Toolkit.

这篇关于如何使用Redline RPM Java库创建RPM包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆