Creating RPM spec file from compiled binary files

限于喜欢 提交于 2019-12-11 05:09:31

问题


Environment is AIX 7.0 RPM Version 3.0.5 . I am very new to Unix world, Please be patient with my ignorance.

We have 3 different types of files to be packaged as RPM.

• Source/binary/*.bainaryfiles (around 160 of them)

• Source/ui/*.mm (No of files 2)

• Source/scripts/*.sh (10 to 20)

These files are compiled for the target server and these are in binary form and we don’t want to compress these files to tar.

When the install happens on the Generated RPM using rpmbuild the .binaryfiles ,.ui and .sh files have to go to different directories on the target server

No build has to happen since its already built.

Can anybody provide me the .spec file sample and the steps. can we run rpmbuild without root access? Can we run the install of the rpm without root access?


回答1:


Here is an example that doesn't have any build section.

Name: special-package
Version: 0.0
Release: 0.1
Summary: This is a special package

Group: Devlopment/Tools
License: Special Proprietary
BuildArch: noarch

%description
This package contains some special stuff

%install
# e.g., on the target server path_to_all_binary_files=/usr/share/special/bin
%{mkdir_p} %{buildroot}%{_path_to_all_binary_files}

# In case of a copy, file permissions will be copied as it is.
# You can also try 'install -m 755 $RPM_SOURCE_DIR/....'
# 'man install' for more information
%{__cp} $RPM_SOURCE_DIR/binary/*.binaryfiles %{buildroot}%{_path_to_all_binary_files}
# Similarly do this for other sets of files 

%files
%{_path_to_binary_files}/*.binaryfiles
%{_path_to_sh_files}/*.sh

%changelog
* Tue Mar 14 2017 Name Surname<name.surname@email.com>
 - First build of the special package

This one is by Fedora, but I think a lot of guidelines apply in general https://fedoraproject.org/wiki/How_to_create_an_RPM_package



来源:https://stackoverflow.com/questions/42773687/creating-rpm-spec-file-from-compiled-binary-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!