Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing rpm-devel dependency #70

Closed
junaruga opened this issue Sep 20, 2017 · 4 comments · Fixed by #78
Closed

Removing rpm-devel dependency #70

junaruga opened this issue Sep 20, 2017 · 4 comments · Fixed by #78
Assignees
Milestone

Comments

@junaruga
Copy link
Collaborator

junaruga commented Sep 20, 2017

From https://pagure.io/koji/issue/458#comment-467020

Right now rpm-devel is required to build the RPM Python binding.
to use /usr/lib64/pkgconfig/rpm.pc as a RPM's default behavior.

But maybe it is possible not to use this file.

if not, just print some warning and let installation continue?

Implement this.

@junaruga junaruga self-assigned this Sep 20, 2017
@junaruga
Copy link
Collaborator Author

junaruga commented Sep 21, 2017

This was kind of bug.
setup.py checking parent directory's rpm.pc from pkgconfig command in setup.py.
https://github.com/rpm-software-management/rpm/blob/rpm-4.14.x/python/setup.py.in#L25

But in rpm-py-installer's install process, there is no rpm.pc in the parent directory.

If pkgconfig could not find rpm.pc in the parent directory, it check library path, as a result,
/usr/lib64/pkgconfig/rpm.pc in rpm-devel package was needed.
So, the solution is creating from rpm.pc.in to rpm.pc manually in the install process.

@junaruga junaruga added the bug label Sep 21, 2017
@junaruga
Copy link
Collaborator Author

Change env name from SETUP_PY_OPTM to RPM_PY_OPTM.

And the logic is something like

if RPM_PY_OPTM == true:
  try with optimized mode.
    failed => try without optimized mode.
if RPM_PY_OPTM == false:
   try without optimized mode

@junaruga junaruga removed the bug label Sep 21, 2017
@junaruga
Copy link
Collaborator Author

junaruga commented Sep 22, 2017

Several ways to achieve it.
First of all, it is possible to install without rpm-devel after researching.
rpm-libs and (rpm-build-libs or dnf (yum) download plugin) are still needed.

rpm-libs and rpm-build-libs were installed as a default, when I checked CentOS and Fedora container.

However using rpm.pc in rpm-devel is more reliable than creating rpm.pc manually to predicting target condition.

So, I would try below logic to install.

  1. Check if rpm-devel is installed. rpm -q rpm-devel.
    1-1. If rpm-devel is installed, use it.
    1-2. If rpm-devel is not installed, move on step 2.

  2. Check if rpm-build-libs is installed. rpm -q rpm-build-libs.
    2-1. If rpm-build-libs is installed, use it for the so files later.
    Move on to step 3.

  3. Check current system is working by dnf or yum.

  4. Check if the download plugin (feature) is available.

$ dnf download rpm-devel

Ref: On f25 fedora container.

[root@c60ce1284772 /]# dnf download rpm-devel
No such command: download. Please use /usr/bin/dnf --help
It could be a DNF plugin command, try: "dnf install 'dnf-command(download)'"
[root@c60ce1284772 /]# echo $?
1

or

$ yum install --downloadonly --downloaddir=. rpm-devel

This yum download plugin is installed on CentOS6, and CentOS7 container as a default.

  1. Continuing
    4-1. If the download plugin is installed, download rpm-devel, and extract and use rpm-devel.
    4-2. If the download plugin is not installed, move on step 5.

  2. Manually create rpm.pc.
    Prepare header files from the source directory lib copying from rpm/lib to rpm/include.
    Prepare library so files copying from rpm-libs or rpm-build-libs's directory to source directory rpm/*/.lib.
    Build and install it.
    5.1. If the install is succeeded, the install process is done.
    5.2. If the install is failed, the rpm-py-installer, output warning to install rpm-devel or dnf(yum) download plugin, or ask users to report the upstream project (this project).

@junaruga junaruga added this to the v0.5.0 milestone Sep 30, 2017
@junaruga
Copy link
Collaborator Author

This issue is going to be fixed and released on next minor version release v0.5.0.
I am working on https://github.com/junaruga/rpm-py-installer/tree/feature/remove-rpm-devel-dependency branch now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant