geographika / mappyfile

A pure Python MapFile parser for working with MapServer
MIT License
71 stars 20 forks source link

add debian packaging #59

Open tomkralidis opened 6 years ago

tomkralidis commented 6 years ago

As a devops person, I would like to install mappyfile via apt-get so that installations can be reproducible.

Many projects require Debian packaging setup for Ubuntu/Debian environments.

geographika commented 6 years ago

What are the steps involved to do this? I briefly looked at https://askubuntu.com/questions/16446/how-to-get-my-software-into-ubuntu Has OWSLib gone through a similar process? Did it require a mentor etc.

I think @tigerfoot kindly added mappyfile to the OpenSUSE project - see https://github.com/geographika/mappyfile/issues/13 and https://software.opensuse.org/search?utf8=%E2%9C%93&q=mappyfile

tomkralidis commented 6 years ago

@geographika: cc'ing @kalxas here for advice on getting mappyfile onto UbuntuGIS. I think the initial key steps are figuring out mappyfile's dependency tree and covering for upstream packages.

kalxas commented 6 years ago

Hi, thanks for the notification. I will add this on my packaging todo list. Thanks @tigerfoot for taking care of the openSUSE part.

geographika commented 6 years ago

@kalxas - thanks for looking into this - let me know if I need to make any modifications to support this. Out of interest, what is the advantage of adding Python packages to Ubuntu repositories rather than using PyPI?

tomkralidis commented 6 years ago

@geographika: AFAIK some IT environments do not accept pip as a deployment approach.

kalxas commented 6 years ago

Both RPM and Debian packaging is more strict and provide a better integration with the OS, thus more stable than pip.

kalxas commented 6 years ago

I see in setup.py that installing the package requires 3 other packages https://github.com/geographika/mappyfile/blob/master/setup.py#L40 but requirements.txt has more than 3. I guess setup.py includes the absolute minimal?

geographika commented 6 years ago

Yes the libraries in setup.py are the only ones required to use mappyfile. I'll add some comments to the requirements.txt to make this clearer (or clean it up). I presume all dependencies also have to already be packaged for Debian?

kalxas commented 6 years ago

Yes, all the dependencies have to be packaged too.

kalxas commented 6 years ago

Hi all, Initial packages for mappyfile are now available on: https://launchpad.net/~gcpp-kalxas/+archive/ubuntu/ubuntugis/+packages

Testing on Ubuntu Bionic: screenshot_20180818_003709

Here is the error I get: screenshot_20180818_003817

kalxas commented 6 years ago

I realized that I had a previous version of lark-parser, I will update.

geographika commented 6 years ago

@kalxas - thanks for this! What is the process for when I update mappyfile to a new version? Do you have to do something manually to create a new package? Is there anything I can do from my side to make this easier (I have a new release planned in the next few weeks with a command line interface).

kalxas commented 6 years ago

Packages are created and uploaded manually on distributions like openSUSE, Debian and Ubuntu. On every new release, packagers need to handle this process.

kalxas commented 6 years ago

@tigerfoot do you have a working spec file for Mappyfile? I cannot see the project in https://build.opensuse.org/project/show/Application:Geo or the staging area.

kalxas commented 6 years ago

@geographika @tomkralidis packages now available in UbuntuGIS experimental ppa: https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-experimental/+packages Please test.

tigerfoot commented 6 years ago

@kalxas I've one in python, actually it's a refugee in my home https://build.opensuse.org/package/show/home:bruno_friedmann:branches:devel:languages:python/python-mappyfile that should be refreshed in time (next release) and thus be forwarded to d:l:p and then to factory and afterward directly in Leap. Maybe instead of d:l:p project I can use Application:Geo I've to think about it.

kalxas commented 6 years ago

both options look fine to me :)

geographika commented 6 years ago

@kalxas - the following commands work for me (on Lubuntu xenial - an OSGeoLive 11 VM):

sudo add-apt-repository ppa:ubuntugis/ubuntugis-experimental
sudo apt-get update
sudo apt-get install python-mappyfile
sudo apt-get install python3-mappyfile

python -c "import mappyfile;print(mappyfile.__version__)"
python3 -c "import mappyfile;print(mappyfile.__version__)"

I noticed the Python2 version adds an additional dependency - python-functools32 not in setup.py - I resume this is fine?

A couple of questions for you if you have time:

kalxas commented 6 years ago

Hi, This is the dependency chain in debian control file:

Depends: ${misc:Depends},
         ${python:Depends},
         python (>=2.7),
         python-jsonschema,
         python-jsonref,
         python-lark-parser,
         debconf

so this dependency comes from another package.

Regarding your questions:

kalxas commented 6 years ago

https://github.com/OSGeo/OSGeoLive/commit/2df427d7744fc2adc0e9889af7a8f6c80dd9c11b

tomkralidis commented 6 years ago

@kalxas not sure if this comment is relevant to debian packaging:

Installing on Ubuntu 18.04 required python-setuptools (sudo apt-get install python-setuptools)

tigerfoot commented 5 years ago

Mappyfiles on pypi is 0.7.6 and only 0.7.5 version is published here issue reported Booth side of the project should be kept in sync, it's a nightmare otherwise :-)

Also click is now an additionnal requires

kalxas commented 5 years ago

Hi all, New Mappyfile deb package just landed in OSGeoLive ppa: https://launchpad.net/~osgeolive/+archive/ubuntu/nightly/+packages

kalxas commented 5 years ago

Packages now in UbuntuGIS experimental. Please test. https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-experimental/+packages?field.name_filter=&field.status_filter=published&field.series_filter=bionic