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

RPM Package #70

Closed
amjith opened this issue Jan 7, 2015 · 20 comments
Closed

RPM Package #70

amjith opened this issue Jan 7, 2015 · 20 comments

Comments

@amjith
Copy link
Member

amjith commented Jan 7, 2015

@herlo Volunteered to build a Fedora RPM package for pgcli. Thank you for your help!

@Erethon
Copy link
Contributor

Erethon commented Jan 9, 2015

If you need more people working on this, let me know.

@herlo
Copy link

herlo commented Jan 9, 2015

Feel free to start on it, I'm likely going to be a little while before I
can get started.
On Jan 9, 2015 6:31 AM, "Dionysis Grigoropoulos" notifications@github.com
wrote:

If you need more people working on this, let me know.


Reply to this email directly or view it on GitHub
#70 (comment).

@avesus
Copy link

avesus commented Aug 26, 2015

👍

@sobolevn
Copy link

sobolevn commented Oct 7, 2016

@amjith Is this still an issue? I can help on this one.

I have some experience in it: https://github.com/sobolevn/git-secret/blob/master/Makefile#L111

@amjith
Copy link
Member Author

amjith commented Oct 7, 2016

@sobolevn I'd welcome any help. This is not a solved problem. Thank you for your help.

@sobolevn
Copy link

sobolevn commented Oct 8, 2016

Isn't is solved via https://github.com/dbcli/pgcli/blob/master/Vagrantfile#L79 ?
DEVELOP.rst also says that there's a way to create RPM: https://github.com/dbcli/pgcli/blob/master/DEVELOP.rst#building-rpm-and-deb-packages

@amjith
Copy link
Member Author

amjith commented Oct 8, 2016

That didn't work out as I expected. When I created an RPM package it wouldn't install inside a test Centos container. I think there was some problem with assuming that some files existed or hardcoded path.

@amjith
Copy link
Member Author

amjith commented Oct 8, 2016

I should probably remove that file and update the docs.

@sobolevn
Copy link

sobolevn commented Oct 8, 2016

Ok, I have managed to run it. But there's an issue with prompt_toolkit.

Environment

I have used this docker-image: https://hub.docker.com/r/sobolevn/git-secret with fedora-latest tag.

[root@30722cfb4b5b code]# yum install -y python python-devel postgresql postgresql-server postgresql-devel createrepo

Preparation

[root@bc3d887d95d3 code]# gem install fpm
Fetching: fpm-1.6.3.gem (100%)
Successfully installed fpm-1.6.3
Parsing documentation for fpm-1.6.3
Installing ri documentation for fpm-1.6.3
Done installing documentation for fpm after 1 seconds
1 gem installed

Dependencies

[root@30722cfb4b5b pgcli]# pip install .
[root@30722cfb4b5b pgcli]# pip uninstall -y pgcli prompt-toolkit # fixing the prompt-toolkit bug
[root@30722cfb4b5b pgcli]# mkdir repo && cd repo
[root@30722cfb4b5b repo]# pip freeze | xargs -n1 fpm -s python -t rpm --python-pip pip
You are using pip version 8.0.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Created package {:path=>"python-click-6.6-1.noarch.rpm"}
Created package {:path=>"python-configobj-5.0.6-1.noarch.rpm"}
Created package {:path=>"python-humanize-0.5.1-1.noarch.rpm"}
Created package {:path=>"python-iniparse-0.4-1.noarch.rpm"}
Created package {:path=>"python-pgspecial-1.6.0-1.noarch.rpm"}
Created package {:path=>"python-psycopg2-2.6.2-1.x86_64.rpm"}
Created package {:path=>"python-pygments-2.1.3-1.noarch.rpm"}
Created package {:path=>"python-setproctitle-1.1.10-1.x86_64.rpm"}
Created package {:path=>"python-six-1.10.0-1.noarch.rpm"}
Created package {:path=>"python-sqlparse-0.2.1-1.noarch.rpm"}
Created package {:path=>"python-wcwidth-0.1.7-1.noarch.rpm"}

Package creation

At this point due to some kind of bug (possibly jordansissel/fpm#65) I had to comment out the line # 'prompt_toolkit>=1.0.0,<1.1.0',. Another option is to provide all the deps by hand with --no-auto-depends flag. I will also create a separate bug report for it.

[root@30722cfb4b5b repo]# fpm -s python -t rpm --after-install ../post-install --after-remove ../post-remove -d python-devel -d postgresql-devel -d python2-prompt_toolkit --python-pip pip ../setup.py
Created package {:path=>"python-pgcli-1.2.0-1.noarch.rpm"}

Creating repo

I was just following the steps from http://stackoverflow.com/questions/13876875/how-to-make-rpm-auto-install-dependencies I have also provided these options to disable caching: metadata_expire=1 mirrorlist_expire=1

[root@30722cfb4b5b repo]# createrepo .
Spawning worker 0 with 6 pkgs
Spawning worker 1 with 6 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

Package information

[root@30722cfb4b5b repo]# rpm -qip python-pgcli-1.2.0-1.noarch.rpm
Name : python-pgcli
Version : 1.2.0
Release : 1
Architecture: noarch
Install Date: (not installed)
Group : default
Size : 391133
License : LICENSE.txt
Signature : (none)
Source RPM : python-pgcli-1.2.0-1.src.rpm
Build Date : Sat Oct 8 10:01:23 2016
Build Host : 30722cfb4b5b
Relocations : /
Packager : @30722cfb4b5b
Vendor : none
URL : http://pgcli.com
Summary : CLI for Postgres Database. With auto-completion and syntax highlighting.
Description :
CLI for Postgres Database. With auto-completion and syntax highlighting.

Checking for deps

[root@30722cfb4b5b repo]# rpm -qRp python-pgcli-1.2.0-1.noarch.rpm
/bin/sh
/bin/sh
postgresql-devel
python-click >= 4.1
python-configobj >= 5.0.6
python-devel
python-humanize >= 0.5.1
python-pgspecial >= 1.6.0
python-psycopg2 >= 2.5.4
python-pygments >= 2.0
python-setproctitle >= 1.1.9
python-sqlparse >= 0.2.0
python-sqlparse < 0.3.0
python-wcwidth >= 0.1.6
python2-prompt_toolkit
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1

Testing

[root@30722cfb4b5b repo]# yum install python-pgcli
Redirecting to '/usr/bin/dnf install python-pgcli' (see 'man yum2dnf')

My Awesome Repo 3.0 MB/s | 6.9 kB 00:00
Dependencies resolved.
...

Running:

[root@30722cfb4b5b repo]# pgcli
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

@amjith
Copy link
Member Author

amjith commented Oct 21, 2016

Sorry about the delayed response. I've run into issues with psycopg2 when I generated an rpm with the fpm package.

Something about the python-dev package and not having the right requirement for it.

@jhermann
Copy link

Try pip install --user -U pip before you call fpm (you need pip>8 for proper PyPI handling). At least on Xenial creating a DEB shows no problems, and creates this for dependencies:

Depends: python-pgspecial (>= 1.8.0), python-click (>= 4.1), python-pygments (>= 2.0),
 python-prompt-toolkit (>= 1.0.10), python-prompt-toolkit (<< 1.1.0), python-psycopg2 (>= 2.5.4),
 python-sqlparse (<< 0.3.0), python-sqlparse (>= 0.2.2), python-configobj (>= 5.0.6),
 python-humanize (>= 0.5.1), python-wcwidth (>= 0.1.6), python-setproctitle (>= 1.1.9)

@sammcj
Copy link

sammcj commented Jul 19, 2017

Any update on this?

We'd really like to have it properly packaged for os-wide version control and for deployment to servers that we don't want to install pip on.

I made a quick and dirty package for CentOS 7 using fpm

fpm -s python -t rpm --python-pip pip pgcli

python-pgcli-1.7.0-1.noarch.rpm.zip

And for Debian 8/9:

fpm -s python -t deb --python-pip pip pgcli

python-pgcli_1.7.0_all.deb.zip

@meeuw
Copy link
Contributor

meeuw commented Jul 19, 2017

@sammcj I've search at https://bugzilla.redhat.com/ but there's no request for it (yet). I'll have a look if I can use the mysql package as a template for a pgcli package.

Maybe I can combine this with my attempt to get mycli in EPEL (CentOS repository).

@sammcj
Copy link

sammcj commented Jul 19, 2017 via email

@sobolevn
Copy link

Or bintray

@meeuw
Copy link
Contributor

meeuw commented Jul 22, 2017

Thanks, those are great suggestions, but I'm using the .spec files from the RPMs which are already in Fedora so I think I should keep it at RedHat. Fedora has COPR where everyone can host/build RPMs, I'm already using that for a EPEL mycli repository.

@amjith
Copy link
Member Author

amjith commented Dec 14, 2017

@meeuw Is this now addressed? Can we close this?

@meeuw
Copy link
Contributor

meeuw commented Dec 17, 2017

nope, haven't finished this

@chicks-net
Copy link

Does anyone want help landing this? Is there any partial work to land?

A friend pointed out your request for assistance on your main page. I've spent most of the last few months doing packaging a python application. I'm happy to help if help is still desired.

@meeuw
Copy link
Contributor

meeuw commented Jun 13, 2019

Hi @chicks-net! Thanks for offering your help!
I've submitted it as a package for Fedora but it isn't accepted (and I don't see any progress). I need a supporter from Red Hat / Fedora to be accepted as a packager.
https://bugzilla.redhat.com/show_bug.cgi?id=1570551

I'm not sure for what OS you'd like to have a package but I have created copr packages here:
https://copr.fedorainfracloud.org/coprs/meeuw/pgcli/

@amjith amjith closed this as completed Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants