This should be something simple, but I can't seem to figure out the obvious. However, this is my first try at using rpmbuild.
The requirement is to create an RPM which will install files as below:
Basically 2 separate directory paths and multiple files under each.
Code:
/parentdir/dirA/subdira/subdirb/file1
/parentdir/dirA/subdira/subdirb/file2
/parentdir/dirB/subdirp/subdirq/file3
/parentdir/dirB/subdirp/subdirq/file4
I created the rpmbuild structure under my home directory /home/threezerous as follows
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
My .rpmmacros is as follows
Code:
%_topdir /home/threezerous/rpm
%_tmppath /home/threezerous/rpm/tmp
My spec is as below:
Code:
%define name appname
Name: appname
Version: 1.0
Release: 1
Summary: v1.0 - install jar lib files for appname
Group: groupname
BuildArch: noarch
License: NA
URL: http://xyz.com
#Source0:
BuildRoot: %{_builddir}/${name}-root
#BuildRequires:
#Requires:
%description
%prep
exit 0
%build
tar -cvzf /tmp/dirA.tgz /parentdir/dirA/*
tar -cvzf /tmp/dirB.tgz /parentdir/dirB/*
tar -cvzf /tmp/appname.tgz /tmp/*.tgz
exit 0
%install
tar -xvzf /tmp/dirA.tgz
tar -xvzf /tmp/dirB.tgz
exit 0
%clean
exit 0
%files
%defattr(-,405,405,-)
/parentdir/dirA/subdira
/parentdir/dirB/subdirp
%changelog
* Wed Apr 27 2017 threezerous - 1.0
- Created new spec file for appname RPM
Something wrong definitely in the spec file, since running rpmbuild -bb test.spec from my home dir gives the following error towards the end
error: File not found: /home/threezerous/rpm/BUILDROOT/
Code:
error: File not found: /home/threezerous/rpm/BUILDROOT/appname-1.0-1.x86_64/parentdir/dirA/subdira
error: File not found: /home/threezerous/rpm/BUILDROOT/appname-1.0-1.x86_64/parentdir/dirB/subdirp
Any suggestions/help is much appreciated. Also, I value your time so provided as much info as I could and I have run the actual example above.
Thanks