Hi,
Patrick Dupre wrote:
I am trying to create a rpm file from a tgz package.
Could you help me?
I have been here
http://fedoraproject.org/wiki/How_to_create_a_GNU_Hello_RPM_package
I run
rpmbuild -ba textext.spec
Here is my file:
Name: textext
Version: 0.4
Release: 1%{?dist}
Summary: The textext for inkscape
License: GPLv3+
URL:
https://pav.iki.fi/software/textext/
Source0:
https://pav.iki.fi/_downloads/textext-0.4.tar.gz
#BuildRequires:
#Requires:
%description
%prep
%autosetup
%build
%configure
%make_build
%install
rm -rf $RPM_BUILD_ROOT
Remove this rm -rf line. It is not needed or desirable.
%make_install
%files
%license add-license-file-here
Unless the package actually has a file named
add-license-file-here, you should remove this line. You'll
get a build error otherwise (once you fix the current
error).
%doc add-docs-here
Same as above.
%changelog
* Fri Feb 9 2018 Patrick Dupre <pdupre(a)gmx.com>
-
Fill in a changelog entry as well. It might be as simple as
'- Initial package'
But I get an error:
rpmbuild -ba textext.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.0cm1Uq
+ umask 022
+ cd /home/pdupre/rpmbuild/BUILD
+ cd /home/pdupre/rpmbuild/BUILD
+ rm -rf textext-0.4
+ /usr/bin/gzip -dc /home/pdupre/rpmbuild/SOURCES/textext-0.4.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd textext-0.4
/var/tmp/rpm-tmp.0cm1Uq: line 38: cd: textext-0.4: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.0cm1Uq (%prep)
If you look at the textext-0.4.tar.gz, you'll see that it
does not place the files in a directory:
$ tar -tvf textext-0.4.tar.gz
-rwxr-x--- pauli/pauli 27225 2008-04-22 17:14 textext.py
-rw------- pauli/pauli 415 2008-01-12 10:48 textext.inx
You'll need to have the %autosetup macro create the
directory for you before it unpacks the tarball. That is
done with the -c option, so your %autosetup line above
should be:
%autosetup -c
Your next errors will be that this tool has no configure or
Makefile, so %configure, %make_build, and %make_install are
all going to fail. You will need to replace them with the
actual steps to build/install the textext package.
I suspect that there is nothing to build, so the %build
section can likely be dropped entirely.
Then in the %install section you'll have to create the
needed directory structure and install the files. And
finally you'll have to list them in the %files section.
You'll really want to read more of the rpm packaging guides
to learn how to do all of those things.
https://fedoraproject.org/wiki/How_to_create_an_RPM_package
might be a good place to start.
--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Talk is cheap because supply exceeds demand.