2

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?

  • There is no point in using `rpm`; `tar` is the the right tool for this. Mind you, it doesn't compress anything. Example tar: `cd /some/where; tar -cf Source.tar Source`; example untar: `cd /path/to; tar -xf Source.tar` – Zsigmond Lőrinczy Mar 14 '17 at 04:08
  • The organization cameup with a new ploicy to have all the installable to be built as an RPM. – ArunChand R Kaimal Mar 14 '17 at 15:00
  • You can run `rpmbuild` as regular user. However, you will need root to install the package because the `rpmdb` database is writable by provileged user only. If this is acceptable, I will write up an answer with a spec template you can use. – alvits Mar 14 '17 at 21:52

1 Answers1

4

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

iamauser
  • 11,119
  • 5
  • 34
  • 52