在 Windows 下从 ANT 脚本创建 RPM 包 [英] Create RPM package from ANT script under Windows

查看:26
本文介绍了在 Windows 下从 ANT 脚本创建 RPM 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从在 Windows 计算机上运行的 ANT 脚本创建 RPM 包.此包必须包含构建的结果类以及一些其他附加资源.

I need to create an RPM package from an ANT script that runs on a Windows computer. This package must contain the result classes from the build plus some other, additional resources.

我想应该有一些程序可以从命令行调用来创建这个包.

I guess there should be some program somewhere that can be invoked from the command line to create this package.

我想在windows下做这个的原因是我们有一个脚本可以为几个不同的平台构建安装程序,而且所有东西都已经为windows配置好了,所以我想避免将所有东西迁移到linux的痛苦.

The reason why I want to do this under windows is that we have a script that builds installers for several different platforms, and everything is already configured for windows so I want to avoid the pain of migrating everything to linux.

你知道这是如何实现的吗?

Do you know how could this be achieved?

我使用了一台单独的 Linux 机器来做到这一点.我使用 scp 任务复制所有文件,然后使用 ssh 任务远程执行 rpm 命令.如果此任务返回成功代码,我将使用 scp 复制生成的 rpm.

I've used a separate Linux machine to do this. I copy all files using the scp task, then execute the rpm command remotely using the ssh task. If this task returns a success code, I copy the resulting rpm back with scp.

推荐答案

我不知道有任何软件包可以做到这一点,但这可能只是我的无知.

I'm not aware of any packages to do this, but that could just be my ignorance speaking.

两个建议:

设置 Linux 机器(单独的 PC 或虚拟机)并通过脚本远程安装 rpm(参见 ssh/scp/samba).这让我觉得这是一种避免完全构建环境迁移的安全方法.

Set up a Linux machine (separate PC or virtual machine) and kit the rpm remotely via scripts (see ssh/scp/samba). This strikes me as a safe approach that avoids full build environment migration.

一种更冒险的方法是使用 Java 编写您自己的 RPM 文件.RPM 文件格式 似乎是一个标题,后跟许多标准存档格式之一.需要对存档内容进行一些分析,因此这种方法在短期内可能会非常耗时(尽管它可能会加快构建速度).

A more adventurous approach would be to write your own RPM files using Java. The RPM file format seems to be a header followed by one of a number of standard archive formats. Some analysis of the archive contents would be needed, so this approach might be quite time consuming in the short term (though it would probably result in faster builds).

这篇关于在 Windows 下从 ANT 脚本创建 RPM 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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