user746184
user746184

Reputation: 105

add a new file in existing RPM

I am modifying gnome-shell-3.8.xx.rpm package. I have created several patches for rpm and they are working fine. Now I want to add new source file in rpm but I am not able to find how to do it?

For patches I have followed below approach:

  1. Download source rpm.
  2. install rpm which creates BUILD, BUILDROOT, RPMS, SOURCES SPECES SRPMS directories.
  3. copy my patches in SOURCES directory.
  4. Modify the SPEC file to include my patches
  5. Create new package with rpmbuild -bb SPEC/spec_file command.

Upvotes: 4

Views: 6142

Answers (1)

Satish
Satish

Reputation: 17407

Drop your patch or any other file you want to include (RPM) put all them in SOURCE directory

 ../SOURCES/package-1.0-my.patch
 ../SOURCES/service.init

Add in SPEC file

Source1:  service.init
Patch0: package-1.0-my.patch

Add in %pre section:

%prep
%setup ...
%patch0 -p1
...
...
install -p -D -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/service.init

Build RPM:

rpmbuild -ba ../SPEC/package.spec

Notes: Above Source1 is example you can use your file name instead of service.init and change path to install specific location

Upvotes: 4

Related Questions