hello everybody,
i wanna make a small aoftware package using linux redhat 9, but it is failing and failing with errors i solved all of them i think now but it still making errors i don't know why ?!
do anyone did it before who can tell me trusted steps or a hyperlink to a trusted tutorial to do it
and here is the steps i did exactly, tell me what is wrong plzz
Quote:
files in hello-1.0 directory
hello.c:
# <include stdio.h>
main()
{
printf("Hello, World!\n");
}
Makefile:
all: hello
hello: hello.c
gcc -o hello hello.c
clean:
rm -f hello
install: hello
cp hello /usr/bin
README:
(c) Copyright ........
Then, i went back to /root directory and made a tar file of all these files, and gzip it
up.
» # cd /root
» # mkdir hello-1.0
» # cd hello-1.0
» # vi hello.c
» # vi Makefile
» # vi README
» # cd ..
» # tar -zcvf hello-1.0.tar.gz hello-1.0/
Copy the hello-1.0.tar.gz to /usr/src/redhat/SOURCES
» # cp hello-1.0.tar.gz /usr/src/redhat/SOURCES
Create the /usr/src/redhat/SPECS/hello.spec file
» # vi /usr/src/redhat/SPECS/hello.spec
and here is the specs file
Quote:
Summary: Hello, World program
Name: hello
Version: 1.0
Release: 1
Copyright: GPL
Group: Applications/Useless
Source: hello-1.0.tar.gz
Distribution: Useless Linux 1.0
Vendor: eee
Packager: rrrr
%description
This program prints the text "Hello, World!"
%prep
rm -fr $RPM_BUILD_DIR/hello-1.0
tar -zxvf $RPM_SOURCE_DIR/hello-1.0.tar.gz
%build
cd $RPM_BUILD_DIR/hello-1.0
make
%install
cd $RPM_BUILD_DIR/hello-1.0
make install
%files
%doc $RPM_BUILD_DIR/hello-1.0/README
/usr/bin/hello
|
Start the RPM prep stage .
» # rpm -bp /usr/src/redhat/SPECS/hello.spec
» # ls -lR /usr/src/redhat/BUILD
Start the RPM build stage .
» # rpm -bc /usr/src/redhat/SPECS/hello.spec
» # ls -lR /usr/src/redhat/BUILD
Start the RPM install stage .
» # rpm -bi /usr/src/redhat/SPECS/hello.spec
» # ls -lR /usr/src/redhat/BUILD
» # ls -l /usr/bin/hello
» # ls -l /usr/share/doc/hello-1.0
» # hello
Create the binary RPM .
» # rpm -bb /usr/src/redhat/SPECS/hello.spec
» # ls -l /usr/src/redhat/RPMS/i386
» # rpm -qilp /usr/src/redhat/RPMS/i386/hello-1.0-1.i386.rpm
Create the source RPM .
» # rpm -ba /usr/src/redhat/SPECS/hello.spec
» # ls -l /usr/src/redhat/SRPMS
» # rpm -qilp /usr/src/redhat/SRPMS/hello-1.0-1.src.rpm
|
i tried to substitute $RPM_BUILD_DIR/ with the real directory, but also it failed
also i used rpmbuild instead of rpm as i am using redhat 9
THANKS A LOT