Results 1 to 3 of 3
Hi, I just got Michael Jang's RHCE book and am working through some procedures in it. I've run
into a snag in the section that talks about creating an rpm ...
- 11-11-2011 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 10
problem using rpmbuild
Hi, I just got Michael Jang's RHCE book and am working through some procedures in it. I've run
into a snag in the section that talks about creating an rpm package.
Here's what I've done;
- installed rpmdevtools
# yum install rpmdevtools
- created the rpmbuild directory tree;
# cd
# rpmdev-setuptree
- created a "payload" text file;
# vi ./MyPackage-1.0/mypackage.txt
# ls #
/root/MyPackage-1.0/mypackage.txt
- created a tarball;
# tar czf mypackage.tar.gz ./MyPackage-1.0
- moved the tarball into SOURCES;
# cp mypackage.tar.gz ./rpmbuild/SOURCES
- created a template spec file;
# rpmdev-newspec
- modified the spec file
# cp ~/newpackage.spec ./RPMBUILD/specs/mypackage.spec
(see following post for cut-n-paste)
- ran rpmbuild;
# rpmbuild -bs mypackage.spec
this resulted in an rpm file, no complaints that I saw. I copied the rpm file to another
machine running Fedora 14, and was able to "rpm -i" it. However, what it did was to simply load
the tarball into ./rpmbuild/SOURCES. What I wanted it to do was to extract the tarball into the
working directory and untar it. So my spec file is not right.
Next post will contain the spec file...
- 11-11-2011 #2Just Joined!
- Join Date
- Nov 2011
- Posts
- 10
Name: MyPackage
Version: 1.0
Release: 1%{?dist}
Summary: just a bunch of crap!
Group: none
License: none
URL: none
Source0: mypackage.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#BuildRequires:
#Requires:
%description
%prep
%setup -q
%build
%configure
#make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
#make install DESTDIR=$RPM_BUILD_ROOT
install -d -m 755 ./MyPackage
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc
- 11-11-2011 #3Just Joined!
- Join Date
- Nov 2011
- Posts
- 10
So, I'm clearly over my head w.r.t. spec files. What I've found online is all oriented towards packages containing source code to be compiled etc, not simply installing a text file to a particular directory.
Can someone get me started on fixing the spec file?
thanx


Reply With Quote