AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

rpm -q --specfile does not work with rpm.rte 4.9.1.3

  • 1.  rpm -q --specfile does not work with rpm.rte 4.9.1.3

    Posted Mon August 28, 2017 06:00 AM

    Originally posted by: dab_w


    Hi,

    I'm having a problem with a specific RPM command using the Toolbox version of RPM. Error is "No such file or directory" but it doesn't even try to access the file. The original rpm.rte (3.x) isn't affected.

    Some background: This command is required to build a python module package with "python setup.py bdist_rpm" but the problem can be reproduced with any specfile.


    # lslpp -l rpm.rte
      Fileset                      Level  State      Description         
      ----------------------------------------------------------------------------
    Path: /usr/lib/objrepos
      rpm.rte                    4.9.1.3  COMMITTED  RPM Package Manager
    
    Path: /etc/objrepos
      rpm.rte                    4.9.1.3  COMMITTED  RPM Package Manager
    
    # rpm -q --specfile rsync-3.1.2-2.spec
    rpm: rsync-3.1.2-2.spec: No such file or directory
    
    # file rsync-3.1.2-2.spec
    rsync-3.1.2-2.spec: commands text
    
    # /usr/sbin/rpm_share -q --specfile rsync-3.1.2-2.spec
    rpm: rsync-3.1.2-2.spec: No such file or directory
    
    # /usr/opt/freeware/bin/rpm -q --specfile rsync-3.1.2-2.spec
    rpm: rsync-3.1.2-2.spec: No such file or directory
    
    # truss -ft kopen /usr/opt/freeware/bin/rpm -q --specfile rsync-3.1.2-2.spec
    11993314: 99025035: kopen("/opt/freeware/lib/rpm/rpmpopt-4.9.1.3", O_RDONLY|O_LARGEFILE) = 3
    11993314: 99025035: kopen("/opt/freeware/etc/popt", O_RDONLY|O_LARGEFILE) Err#2  ENOENT
    11993314: 99025035: kopen("/etc/popt", O_RDONLY|O_LARGEFILE) Err#2  ENOENT
    11993314: 99025035: kopen("/root/.popt", O_RDONLY|O_LARGEFILE) Err#2  ENOENT
    rpm: rsync-3.1.2-2.spec: No such file or directory
    



  • 2.  Re: rpm -q --specfile does not work with rpm.rte 4.9.1.3

    Posted Mon August 28, 2017 11:23 AM

    Originally posted by: sangameshm


    Hi,

    Looks like their should be an missing rpmspec binary as part of rpm.rte which does parses the spec files.

    Could you please also let us know what rpm command is failing when you run "python setup.py bdist_rpm".

    bdist_rpm looks to be in house developed python package ?

     

    Thanks,

    Sangamesh



  • 3.  Re: rpm -q --specfile does not work with rpm.rte 4.9.1.3

    Posted Mon August 28, 2017 11:57 AM

    Originally posted by: dab_w


    Hi,

    bdist_rpm is part of python distutils (see https://docs.python.org/2/distutils/builtdist.html#creating-rpm-packages) which I am using to create an RPM package of some in house developed python module.

    As can be seen from https://github.com/python/cpython/blob/master/Lib/distutils/command/bdist_rpm.py#L341 it creates a specfile and then parses it with rpm, which leads to the error.

    As said before this can be reproduced with every specfile. Anyway this is a reproducer for the problem with python:

    # ls -la
    total 16
    drwxr-xr-x    2 root     system          256 Aug 28 17:52 .
    drwx------   14 root     system         4096 Aug 28 17:48 ..
    -rw-r--r--    1 root     system           62 Aug 28 17:50 setup.py
    #
    # cat setup.py
    from distutils.core import setup, Extension
    setup(name='foo')
    #
    # python setup.py bdist_rpm
    running bdist_rpm
    creating build
    creating build/bdist.aix-7.1
    creating build/bdist.aix-7.1/rpm
    creating build/bdist.aix-7.1/rpm/SOURCES
    creating build/bdist.aix-7.1/rpm/SPECS
    creating build/bdist.aix-7.1/rpm/BUILD
    creating build/bdist.aix-7.1/rpm/RPMS
    creating build/bdist.aix-7.1/rpm/SRPMS
    writing 'build/bdist.aix-7.1/rpm/SPECS/foo.spec'
    running sdist
    running check
    warning: check: missing required meta-data: version, url
    
    warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied
    
    warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)
    
    warning: sdist: standard file not found: should have one of README, README.txt
    
    writing manifest file 'MANIFEST'
    creating foo-0.0.0
    making hard links in foo-0.0.0...
    hard linking setup.py -> foo-0.0.0
    creating dist
    Creating tar archive
    removing 'foo-0.0.0' (and everything under it)
    copying dist/foo-0.0.0.tar.gz -> build/bdist.aix-7.1/rpm/SOURCES
    building RPMs
    rpm: build/bdist.aix-7.1/rpm/SPECS/foo.spec: No such file or directory
    error: Failed to execute: "rpm -q --qf '%{name}-%{version}-%{release}.src.rpm %{arch}/%{name}-%{version}-%{release}.%{arch}.rpm\\n' --specfile 'build/bdist.aix-7.1/rpm/SPECS/foo.spec'"
    #
    # cat build/bdist.aix-7.1/rpm/SPECS/foo.spec
    %define name foo
    %define version 0.0.0
    %define unmangled_version 0.0.0
    %define release 1
    
    Summary: UNKNOWN
    Name: %{name}
    Version: %{version}
    Release: %{release}
    Source0: %{name}-%{unmangled_version}.tar.gz
    License: UNKNOWN
    Group: Development/Libraries
    BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
    Prefix: %{_prefix}
    BuildArch: noarch
    Vendor: UNKNOWN <UNKNOWN>
    
    %description
    UNKNOWN
    
    %prep
    %setup -n %{name}-%{unmangled_version}
    
    %build
    python setup.py build
    
    %install
    python setup.py install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
    
    %clean
    rm -rf $RPM_BUILD_ROOT
    
    %files -f INSTALLED_FILES
    %defattr(-,root,root)
    

    Thanks,

    Daniel



  • 4.  Re: rpm -q --specfile does not work with rpm.rte 4.9.1.3

    Posted Tue August 29, 2017 04:15 AM

    Originally posted by: dab_w


    Hi Sangamesh,

    your assumption about the missing rpmspec binary seems to be the key point.

    The binary is missing inside rpm.rte:

    # lslpp -l rpm.rte
      Fileset                      Level  State      Description         
      ----------------------------------------------------------------------------
    Path: /usr/lib/objrepos
      rpm.rte                    4.9.1.3  COMMITTED  RPM Package Manager
    
    Path: /etc/objrepos
      rpm.rte                    4.9.1.3  COMMITTED  RPM Package Manager
    
    # lslpp -f rpm.rte | grep spec
                            /usr/opt/freeware/man/man8/rpmspec.8
    

    The rpm fileset of rpm includes a symlink, but also lacks the binary:

    # rpm -ql rpm | grep spec
    /opt/freeware/doc/rpm-4.9.1.3/spec
    /opt/freeware/man/man8/rpmspec.8
    /usr/bin/rpmspec
    
    # ls -l /usr/bin/rpmspec
    lrwxrwxrwx    1 root     system           30 Aug 29 08:48 /usr/bin/rpmspec -> ../../opt/freeware/bin/rpmspec
    
    # ls -l /opt/freeware/bin/rpmspec     
    ls: 0653-341 The file /opt/freeware/bin/rpmspec does not exist.
    

    Thanks

    Daniel



  • 5.  Re: rpm -q --specfile does not work with rpm.rte 4.9.1.3

    Posted Fri September 15, 2017 07:19 AM

    Originally posted by: sangameshm


    Hi Daniel,

     

    Yes, we confirmed that the issue is because of missing binary.

    We are working on it and and upload the updated rpm.rte package to include missing binaries.

    Thanks for pointing this issue.

     

    Thanks,

    Sangamesh