Thread: build rpm form a csource rpmbuild returns a error

  1. #1
    Registered User
    Join Date
    Nov 2018
    Location
    Amberg in upper palatinate, Bavaria
    Posts
    66

    Angry build rpm form a csource rpmbuild returns a error

    Buid rpm -packages from Source

    Hallo,

    heretorfore i created my programs with an IDE like codelite, codeblocks , QT-Creator or Anjuta.
    I starded them from the shell, example:
    ./passungen

    But now i want to create a rpm for SUSE LINUX tumbleweed. But i get always an error from
    rpmbuild.

    What i did were these steps:

    1. Create a program with Anjuta
    2 tar up the sources:
    bohrungen.h
    bohrungen.h~
    Getvalwelle.cxx
    Getvalwelle.cxx~
    Getvalwelle.h
    etvalwelle.h~
    Getvalwelle.o
    main.cc
    main.cc~
    main.o
    Makefile
    Makefile.am
    Makefile.in
    passungen
    passungen.h
    passungen.h~
    into passungen-0.1.0.tar.gz

    3.Wrote a spec file named "passungen.spec":
    Code:
    Vendor: Fitje WeshomsJosef Wismeth
    Summary: calculates systems of fits according to DIN ISO 286-1 and DIN ISO-286-2
    Name: passungen
    Version: 0.1
    Release: 1
    License: GPL
    Group: unsorted
    Source: passungen-0.1.0.tar.gz
    %description
    This program allows the user to calculate the measurements of bores and shafts
    and their limiting sizes
    
    
    %prep
    %setup
    
    %build
    make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
    
    %install
    make PREFIX=/usr DESTDIR=%{?buildroot} install
    
    %clean
    rm -rf %{buildroot}
    
    
    %files
    %{_bindir}/passungen
    4.copied the tar "passungen-0.1.0.tar.gz" to /rpmbuild/SOURCES
    5 copied the spec-file into rpmbuild/SPECS
    Thje other directories form rpmbuild BUILD and BUILDROOT were empty.

    After this ichanged in direction /rpmbuild/SPECS and started with rpmbuild -ba passungen.spec using the terminal.


    But i get always following error:
    josef@PC192-168-2-100:~/rpmbuild/SPECS> rpmbuild -ba passungen.spec
    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.noaWE5
    + umask 022
    + cd /home/josef/rpmbuild/BUILD
    + cd /home/josef/rpmbuild/BUILD
    + rm -rf passungen-0.1
    + /usr/bin/gzip -dc /home/josef/rpmbuild/SOURCES/passungen-0.1.0.tar.gz
    + /usr/bin/tar -xvvof -
    -rw-r--r-- josef/users 7558 2019-06-20 18:14 bohrungen.h
    -rw-r--r-- josef/users 7557 2019-06-20 18:12 bohrungen.h~
    -rw-r--r-- josef/users 21711 2019-06-20 18:14 Getvalwelle.cxx
    -rw-r--r-- josef/users 0 2019-06-20 18:13 Getvalwelle.cxx~
    -rw-r--r-- josef/users 2022 2019-06-20 18:14 Getvalwelle.h
    -rw-r--r-- josef/users 0 2019-06-20 18:13 Getvalwelle.h~
    -rw-r--r-- josef/users 1018440 2019-06-20 18:15 Getvalwelle.o
    -rw-r--r-- josef/users 3909 2019-06-20 18:08 main.cc
    -rw-r--r-- josef/users 806 2019-06-20 18:07 main.cc~
    -rw-r--r-- josef/users 153192 2019-06-20 18:15 main.o
    -rw-r--r-- josef/users 22600 2019-06-20 18:15 Makefile
    -rw-r--r-- josef/users 413 2019-06-20 18:13 Makefile.am
    -rw-r--r-- josef/users 23259 2019-06-20 18:14 Makefile.in
    -rwxr-xr-x josef/users 687968 2019-06-20 18:15 passungen
    -rw-r--r-- josef/users 18882 2019-06-20 18:12 passungen.h
    -rw-r--r-- josef/users 0 2019-06-20 18:11 passungen.h~
    + STATUS=0
    + '[' 0 -ne 0 ']'
    + cd passungen-0.1
    /var/tmp/rpm-tmp.noaWE5: line 34: cd: passungen-0.1: No such file or directory
    error: Bad exit status from /var/tmp/rpm-tmp.noaWE5 (%prep)

    The file "/var/tmp/rpm-tmp.noaWE5"
    is this:

    Code:
    RPM_SOURCE_DIR="/home/josef/rpmbuild/SOURCES"
      RPM_BUILD_DIR="/home/josef/rpmbuild/BUILD"
      RPM_OPT_FLAGS="-O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables"
      RPM_ARCH="x86_64"
      RPM_OS="linux"
      export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
      RPM_DOC_DIR="/usr/share/doc/packages"
      export RPM_DOC_DIR
      RPM_PACKAGE_NAME="passungen"
      RPM_PACKAGE_VERSION="0.1"
      RPM_PACKAGE_RELEASE="1"
      export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
      LANG=C
      export LANG
      unset CDPATH DISPLAY ||:
      RPM_BUILD_ROOT="/home/josef/rpmbuild/BUILDROOT/passungen-0.1-1.x86_64"
      export RPM_BUILD_ROOT
      
      PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig"
      export PKG_CONFIG_PATH
      
      set -x
      umask 022
      cd "/home/josef/rpmbuild/BUILD"
    cd '/home/josef/rpmbuild/BUILD'
    rm -rf 'passungen-0.1'
    /usr/bin/gzip -dc '/home/josef/rpmbuild/SOURCES/passungen-0.1.0.tar.gz' | /usr/bin/tar -xvvof - 
    STATUS=$?
    if [ $STATUS -ne 0 ]; then
      exit $STATUS
    fi
    cd 'passungen-0.1'
    /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
    
    exit $?
    What i did wrong, what was my failure(s)?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    + /usr/bin/tar -xvvof -
    -rw-r--r-- josef/users 7558 2019-06-20 18:14 bohrungen.h
    -rw-r--r-- josef/users 7557 2019-06-20 18:12 bohrungen.h~

    Well according to this list, there is no directory called passungen-0.1 in your tar file.

    > cd 'passungen-0.1'
    You could simply have done 'ls' before the cd to verify this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-31-2015, 02:11 PM
  2. DialogBox returns -1. GetLastError returns error 1813.
    By Benji Wiebe in forum Windows Programming
    Replies: 14
    Last Post: 09-26-2011, 10:21 AM
  3. Build error?
    By Poisvated in forum C++ Programming
    Replies: 8
    Last Post: 02-14-2008, 10:58 PM
  4. making a form to what i build
    By aleminio in forum C++ Programming
    Replies: 3
    Last Post: 06-13-2004, 07:06 AM
  5. How to build Multi Form?
    By NightWalker in forum Windows Programming
    Replies: 2
    Last Post: 05-08-2004, 09:08 AM

Tags for this Thread