我正在尝试在 Windows 上使用 RPM Maven 插件构建一个 RPM,以便在 Linux 机器上部署。
OS of machine that's building RPM: Windows 7 Enterprise, Cygwin 2.5.1
OS of VM installing RPM: CentOS 7
我运行了 mvn clean install 命令,构建成功。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 48.273s
[INFO] Finished at: Sun Apr 24 21:08:51 BST 2016
[INFO] Final Memory: 10M/157M
[INFO] ------------------------------------------------------------------------
但是,当我将其 scp 到服务器并运行 yum install -y Core1337-1.0-1.noarch.rpm
我收到以下错误:
Transaction check error: package Core1337-1.0-1.noarch is
intended for a different operating system
以下是从插件的 Pom.XML 文件中截取的 XML。
<modelVersion>4.0.0</modelVersion>
<groupId>com.core</groupId>
<artifactId>Core1337</artifactId>
<packaging>rpm</packaging>
<version>1.0</version>
<name>Core Libz</name>
<properties>
<targetOS>i386-linux</targetOS>
<rpm-base>opt</rpm-base>
<rpm-path>app</rpm-path>
<base-dir>core</base-dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
</dependencies>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1.5</version>
<extensions>true</extensions>
<configuration>
<license>GPL (c) 2005, SWWDC</license>
<distribution>eSQuireDistro</distribution>
<group>eSQuireDevel</group>
<requires>
<require>at</require>
<require>wget</require>
<require>tree</require>
<require>cronie</require>
<require>openssh-server</require>
</requires>
<mappings>
<mapping>
<directory>/${rpm-base}/${rpm-path}/${base-dir}/python</directory>
<filemode>744</filemode>
<username>root</username>
<groupname>root</groupname>
<configuration>false</configuration>
<directoryIncluded>true</directoryIncluded>
<recurseDirectories>true</recurseDirectories>
<dependency />
<sources>
<source>
<location>src/main/python</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/${rpm-base}/${rpm-path}/${base-dir}/scripts</directory>
<filemode>744</filemode>
<username>root</username>
<groupname>root</groupname>
<configuration>false</configuration>
<directoryIncluded>true</directoryIncluded>
<recurseDirectories>true</recurseDirectories>
<dependency />
<sources>
<source>
<location>src/main/scripts</location>
</source>
</sources>
</mapping>
</mappings>
<preinstallScriptlet>
<script>/bin/logger "installing"</script>
</preinstallScriptlet>
<postinstallScriptlet>
<script>/bin/logger "uninstalling"</script>
</postinstallScriptlet>
</configuration>
</plugin>
</plugins>
这是生成的 SPEC 文件:
%define __jar_repack 0
Name: Core1337
Version: 1.0
Release: 1
Summary: Core Libz
License: GPL (c) 2005, SWWDC
Distribution: eSQuireDistro
Group: eSQuireDevel
Requires: at
Requires: wget
Requires: tree
Requires: cronie
Requires: openssh-server
autoprov: yes
autoreq: yes
BuildArch: noarch
BuildRoot: /cygdrive/C/Users/ala/workspace/alan/Core/target/rpm/Core1337/buildroot
%description
%install
if [ -d $RPM_BUILD_ROOT ];
then
mv /cygdrive/C/Users/ala/workspace/alan/Core/target/rpm/Core1337/tmp-buildroot/* $RPM_BUILD_ROOT
else
mv /cygdrive/C/Users/ala/workspace/alan/Core/target/rpm/Core1337/tmp-buildroot $RPM_BUILD_ROOT
fi
%files
%attr(744,root,root) "/opt/esquire/core/python/"
%attr(744,root,root) "/opt/esquire/core/scripts/"
%pre
/bin/logger "installing"
%post
/bin/logger "uninstalling"
如何配置插件以使用 linux header 构建 RPM?非常感谢任何帮助!
最佳答案
在 Windows 上构建 RPMS 以在 Linux 机器上部署可能很复杂。我建议在将部署它的同一操作系统上构建 RPMS。
关于linux - 在 Windows 上为 Linux CentOS 构建 RPM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36828777/
我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0
这似乎非常适得其反,因为太多的gem会在window上破裂。我一直在处理很多mysql和ruby-mysqlgem问题(gem本身发生段错误,一个名为UnixSocket的类显然在Windows机器上不能正常工作,等等)。我只是在浪费时间吗?我应该转向不同的脚本语言吗? 最佳答案 我在Windows上使用Ruby的经验很少,但是当我开始使用Ruby时,我是在Windows上,我的总体印象是它不是Windows原生系统。因此,在主要使用Windows多年之后,开始使用Ruby促使我切换回原来的系统Unix,这次是Linux。Rub
在编写Ruby(客户端脚本)时,我看到了三种构建更长字符串的方法,包括行尾,所有这些对我来说“闻起来”有点难看。有没有更干净、更好的方法?变量递增。ifrender_quote?quote="NowthatthereistheTec-9,acrappyspraygunfromSouthMiami."quote+="ThisgunisadvertisedasthemostpopularguninAmericancrime.Doyoubelievethatshit?"quote+="Itactuallysaysthatinthelittlebookthatcomeswithit:themo
之前在培训新生的时候,windows环境下配置opencv环境一直教的都是网上主流的vsstudio配置属性表,但是这个似乎对新生来说难度略高(虽然个人觉得完全是他们自己的问题),加之暑假之后对cmake实在是爱不释手,且这样配置确实十分简单(其实都不需要配置),故斗胆妄言vscode下配置CV之法。其实极为简单,图比较多所以很长。如果你看此文还配不好,你应该思考一下是不是自己的问题。闲话少说,直接开始。0.CMkae简介有的人到大二了都不知道cmake是什么,我不说是谁。CMake是一个开源免费并且跨平台的构建工具,可以用简单的语句来描述所有平台的编译过程。它能够根据当前所在平台输出对应的m
深度学习部署:Windows安装pycocotools报错解决方法1.pycocotools库的简介2.pycocotools安装的坑3.解决办法更多Ai资讯:公主号AiCharm本系列是作者在跑一些深度学习实例时,遇到的各种各样的问题及解决办法,希望能够帮助到大家。ERROR:Commanderroredoutwithexitstatus1:'D:\Anaconda3\python.exe'-u-c'importsys,setuptools,tokenize;sys.argv[0]='"'"'C:\\Users\\46653\\AppData\\Local\\Temp\\pip-instal
我正在尝试在配备ARMv7处理器的SynologyDS215j上安装ruby2.2.4或2.3.0。我用了optware-ng安装gcc、make、openssl、openssl-dev和zlib。我根据README中的说明安装了rbenv(版本1.0.0-19-g29b4da7)和ruby-build插件。.这些是随optware-ng安装的软件包及其版本binutils-2.25.1-1gcc-5.3.0-6gconv-modules-2.21-3glibc-opt-2.21-4libc-dev-2.21-1libgmp-6.0.0a-1libmpc-1.0.2-1libm
我在目录“C:\DocumentsandSettings\test.exe”中有一个文件,但是当我用单引号编写命令时`C:\DocumentsandSettings\test.exe(我无法在此框中显示),用于在Ruby中执行命令,我无法这样做,我收到的错误是找不到文件或目录。我尝试用“//”和“\”替换“\”,但似乎没有任何效果。我也使用过系统、IO.popen和exec命令,但所有的努力都是徒劳的。exec命令还使程序退出,这是我不想发生的。提前致谢。 最佳答案 反引号环境就像双引号,所以反斜杠用于转义。此外,Ruby会将空格解
关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭8年前。Improvethisquestion我们有以下(以及更多)系统,我们将数据从一个应用推送/拉取到另一个:托管CRM(InsideSales.com)Asterisk电话系统(内部)横幅广告系统(openx,我们托管)潜在客户生成系统(自行开发)电子商务商店(spree,我们托管)工作板(本土)一些工作网站抓取+入站工作提要电子邮件传送系统(如Mailchimp,自主开发)事件管理系统(如eventbrite,自主开发)仪表板系统(大量图表和
在我的mac上安装几个东西时遇到这个问题,我认为这个问题来自将我的豹子升级到雪豹。我认为这个问题也与macports有关。/usr/local/lib/libz.1.dylib,filewasbuiltfori386whichisnotthearchitecturebeinglinked(x86_64)有什么想法吗?更新更具体地说,这发生在安装nokogirigem时日志看起来像:xslt_stylesheet.c:127:warning:passingargument1of‘Nokogiri_wrap_xml_document’withdifferentwidthduetoproto
Linux操作系统——网络配置与SSH远程安装完VMware与系统后,需要进行网络配置。第一个目标为进行SSH连接,可以从本机到VMware进行文件传送,首先需要进行网络配置。1.下载远程软件首先需要先下载安装一款远程软件:FinalShell或者xhell7FinalShellxhell7FinalShell下载:Windows下载http://www.hostbuf.com/downloads/finalshell_install.exemacOS下载http://www.hostbuf.com/downloads/finalshell_install.pkg2.配置CentOS网络安装好