Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have found on the internet "Building a simple RPM on Linux (RedHat) using rpm build"

I have build the RPM but when I install it I get the following error
"
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)


Im not allwed to install at the root but how can I change it to install in my home directory?
Please see the code.
dir -p ~/rpmbuild/{SPEC,SOURCES}.

Copy some example content to your your dummy RPM files (these are needed when using the SPEC file later on in this example): 
cp /etc/profile ~/rpmbuild/SOURCES/dummy.file
cp /etc/shells ~/rpmbuild/SOURCES/dummy.another.file.

Paste following into ~/rpmbuild/SPEC/dummyrpmfile.spec:
Summary:        A dummy RPM. Creates file /etc/dummy/file.
Name:           dummyrpmfile
Version:        0.1
Release:        1
Vendor:         Super User
Packager:       Super User
License:        GPL
Group:          System Environment/Base
BuildArch:      noarch
Source0:        dummy.file
Source1:        dummy.another.file
Prefix:         /etc/dummy    

%description
A dummy RPM. Creates file /etc/dummy/file. And also directory /etc/dummy.
Very cool package. You should install this. Oh, yes, and it also makes
/etc/dummy/another.file too.

%install
# create directory /etc/dummy
%{__install} -d -m0755 %{buildroot}/etc/dummy
# and copy the file from SOURCES/file to <buildroot>/etc/dummy
%{__install} -m 0644 %{SOURCE0} %{buildroot}/etc/dummy/file
%{__install} -m 0644 %{SOURCE1} %{buildroot}/etc/dummy/another.file

%files
/etc/dummy/file
/etc/dummy/another.file


Then run cd ~/rpmbuild && rpmbuild -ba SPEC/dummyrpmfile.spec


Thanks
Merh

What I have tried:

I have tried as I have described above.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900