Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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 #

    - 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...

  2. #2
    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)



    %setup -q

    #make %{?_smp_mflags}

    rm -rf $RPM_BUILD_ROOT
    #make install DESTDIR=$RPM_BUILD_ROOT
    install -d -m 755 ./MyPackage

    rm -rf $RPM_BUILD_ROOT


  3. #3
    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?


  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts