I have been reading through different walk-throughs for creating a SPEC file that will enable an RPM builder/engineer to make the files relocatable, but I am not clear on a couple of details, so I am hoping I can get some guidance on how to handle the changes necessary to make it happen.
Where do I add the Prefix: tag, between lines 13 and 15, or is anywhere acceptable?
If I make the /usr files relocatable, do I update the lines under the %files section to reflect the Prefix: tag somehow in their paths?
To what do I change the lines to make it reflect accordingly?
I know that I can use the
Code: Select all
rpm -i --prefix /usr=/opt/usr --prefix /etc=/opt/etc relocate_files.rpm
Code: Select all
1 Name: relocat_files
2 Version: 1.0.0
3 Release: 1%{?dist}
4 Summary: To enable learning about creating a simple RPM that distributes files; with a relocatable/changeable FS-prefix.
5
6 Group: System Environment/Base
7 License: GPL
8 URL: none
9 Source0: relocat_files-1.0.0.tar.gz
10
11
12 BuildArch: noarch
13 BuildRoot: %{_tmppath}/%{name}-buildroot
14
15 %description
16 To enable learning about creating a simple RPM that distributes files; as predecessor with relocatable files as the next (this) evolution of the RPM into relocat_files.rpm.
17
18
19 %prep
20 %setup -q
21
22
23
24 %install
25 mkdir -p "$RPM_BUILD_ROOT"
26 cp -R * "$RPM_BUILD_ROOT"
27
28
29 %files
30 %defattr(-,root,root,-)
31 /etc/wsf.etc
32 /usr/bin/wsf.bin
33 /usr/sbin/wsf.sbin
34
35
36
37 %changelog