在rpm安装期间,我有一个希望安装到/usr/share/ man /man 8的man文件。这是我的地图。
<mapping>
<directory>/usr/share/man/man8</directory>
<documentation>true</documentation> <!-- no difference if I add or remove this -->
<filemode>644</filemode>
<username>root</username>
<groupname>root</groupname>
<directoryIncluded>false</directoryIncluded>
<recurseDirectories>false</recurseDirectories>
<sources>
<source>
<location>${project.build.directory}</location>
<includes>
<include>mymanpage.8</include>
</includes>
</source>
</sources>
</mapping>rpm-maven插件错误,并告诉我mymanpage.8是找不到的。我验证了mymanpage.8在目标目录中。然后,我注意到插件将mymanpage.8.gz复制到target/rpm/rpmtest/buildroot/usr/share/man/man8目录。因此,我假设插件承认它可以gzip这个手册页并完成它,但是由于我的映射特别包括mymanpage.8它抱怨找不到它。我尝试将包含更改为mymanpage.8*,但它仍然给了我相同的文件,没有找到错误。
有人见过这个吗?解决办法是什么?
我想我有一个解决办法,就是将mymanpage.8文件复制到我的安装目录中,然后在postinstall中将其移动到/usr/share/man/man 8。
发布于 2017-05-17 15:34:46
rpm-maven-plugin将工作委托给rpmbuild命令。这个压缩了你的手册页。
您可以使用location标记来指定目录,也可以指定文件。
<mapping>
<directory>/usr/share/man/man8</directory>
<filemode>644</filemode>
<username>root</username>
<groupname>root</groupname>
<directoryIncluded>false</directoryIncluded>
<recurseDirectories>false</recurseDirectories>
<sources>
<source>
<location>${project.build.directory}/mymanpage.8</location>
</source>
</sources>
</mapping>如果您喜欢使用包含,则必须使用通配符模式。
documentation标记不是用于手册,而是用于其他文档,例如changelogs。见rpm-maven-plugin文档。
发布于 2017-11-03 00:12:47
问题可能是手册页是在比包更晚的阶段构建的。因此,当rpm插件试图打包手册页时,它还没有出现。你可以在这里找到生命周期:
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
因此,请确保手册页已经创建,并在包阶段之前进入build目录,例如,在中。
发布于 2020-09-30 16:32:29
在rpm打包之前,有带有".8“扩展的手册页。Rpmbuild强制压缩手册页并用.gz扩展名重命名它们,因此rpm-maven-plugin无法找到扩展名为".8“的文件。第一个解决方案是重命名扩展名为.gz的未压缩文件,如下所示
<mapping>
<directory>/usr/share/man/man8</directory>
<directoryIncluded>false</directoryIncluded><!-- required for CentOS 7 -->
<sources>
<source>
<!-- rpmbuild rename manpages from *.8 to *.8.gz, so we should use <destination> tag to set new name -->
<location>generated-docs/mymanpage.8</location>
<destination>mymanpage.8.gz</destination>
</source>
</sources>
<mapping>现在,rpmbuild不再重命名文件,它适用于CentOS 7(它使用man包处理手册页),但不适用于CentOS 6(使用man包处理手册页),CentOS 6不能打开这样的手册页。
因此,为了修复,手册页需要手动压缩。例如,为了压缩,可以使用资源压缩机 maven插件。
<plugin>
<groupId>com.github.ryanholdren</groupId>
<artifactId>resourcecompressor</artifactId>
<version>2017-06-24</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<directory>generated-docs/</directory>
<filter>\.8$</filter>
<compression>SMALLEST</compression>
</configuration>
</execution>
</executions>
</plugin>现在,rpm-maven-plugin可以配置为使用.gz文件(如果需要可以使用通配符表达式),rpmbuild也不尝试重命名和压缩手册页。
<mapping>
<directory>/usr/share/man/man8</directory>
<directoryIncluded>false</directoryIncluded><!-- required for CentOS 7 -->
<sources>
<source>
<location>generated-docs/</location>
<includes>
<include>*.8.gz</include>
</includes>
</source>
</sources>
</mapping>https://stackoverflow.com/questions/40900668
复制相似问题