CentOS 7 - problem encountered with the set up of spec file during creation of RPM package
1
vote
1
answer
1905
views
I'm aiming to translate a Debian package to an RPM package to install it on a CentOS Linux 7 (Red Hat).
I used alien to accomplish it:
alien --to-rpm --scripts --keep-version --generate debian_pkg.deb
. I use the --generate
flag to create a directory for building a package from, because I want to add the runtime dependencies to the spec file. To do so, I add this line: Requires: nodejs tomcat8 java-1.8.0-openjdk java-1.8.0-openjdk-devel
. Then I try to create the package: rpmbuild -ba .spec
, but it ends abruptly with this error:
Processing files:
error: Directory not found: /root/rpmbuild/BUILDROOT//srv
error: Directory not found: /root/rpmbuild/BUILDROOT//srv/tmp
error: File not found: /root/rpmbuild/BUILDROOT//srv/tmp/file.tar.gz
error: File not found: /root/rpmbuild/BUILDROOT//usr/share/doc/frontend/README.Debian
error: File not found: /root/rpmbuild/BUILDROOT//usr/share/doc/frontend/changelog.Debian.gz
error: File not found: /root/rpmbuild/BUILDROOT//usr/share/doc/frontend/copyright
RPM build errors:
Directory not found: /root/rpmbuild/BUILDROOT//srv
Directory not found: /root/rpmbuild/BUILDROOT//srv/tmp
File not found: /root/rpmbuild/BUILDROOT//srv/tmp/file.tar.gz
File not found: /root/rpmbuild/BUILDROOT//usr/share/doc/frontend/README.Debian
File not found: /root/rpmbuild/BUILDROOT//usr/share/doc/frontend/changelog.Debian.gz
File not found: /root/rpmbuild/BUILDROOT//usr/share/doc/frontend/copyright
I searched the internet and found that it's linked to the %install
section and more specifically %{buildroot}
, but I can't get my head around the problem and fix it. Can somebody give me a hand?
Thanks!
**UPDATE**
Here is the spec file in essence:
Buildroot: /home/
Version: 1.0
Release: 849
Distribution: Debian
Group: Converted/misc
Requires: nodejs tomcat8 java-1.8.0-openjdk java-1.8.0-openjdk-devel
%define _rpmdir ../
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%define _unpackaged_files_terminate_build 0
%pre
# some shell script
%post
# some shell script
%install
mkdir -p %{buildroot}/usr/share/doc/
mkdir -p %{buildroot}/usr/share/doc/frontend/
%files
%dir "/srv/"
%dir "/srv/tmp/"
"/srv/tmp/file.tar.gz"
%dir "/usr/"
%dir "/usr/share/"
%dir "/usr/share/doc/"
%dir "/usr/share/doc/frontend/"
"/usr/share/doc/frontend/README.Debian"
"/usr/share/doc/frontend/changelog.Debian.gz"
"/usr/share/doc/frontend/copyright"
Asked by Bastian Nanchen
(113 rep)
Feb 6, 2019, 01:30 PM
Last activity: Feb 6, 2019, 03:59 PM
Last activity: Feb 6, 2019, 03:59 PM