Giter Site home page Giter Site logo

pex's Introduction

Pex

Pex is a light-weight package manager for PostgreSQL.

Install a package:

pex install plproxy

See available packages:

pex search

It's based on Git and standard Unix tools underneath.

See the man page for the complete usage instructions.

Pex is intended for developers and has support for managing multiple PostgreSQL installations.

Pex has been influenced by Homebrew but is otherwise unrelated.

Build Status

Why Pex

There are many things to like:

  • Light-weight: only trivial run-time dependencies
  • Independent: doesn't matter where packages are hosted
  • Curated: no obsolete, unmaintained, immature, or broken packages
  • Trackable: control when packages change and know where they came from
  • Tested: all package downloads are automatically tested
  • Flexible: supports many installation layouts, can build Debs and RPMs
  • Extensible: fork and add your own in-house packages, no infrastructure required
  • Secure: everything is linked together by cryptographic hashes

Installation

You can just get the pex program directly and install it wherever you want.

The standard installation procedure is:

git clone git://github.com/petere/pex.git
cd pex
sudo make install

This install the pex program and the man page under /usr/local. See the Makefile for more options.

To make a Debian package, run make deb.

After installation, you must run

pex init

just once to fetch the initial package descriptions and set up some internal directories.

Pex has minimal run-time dependencies. You just need a POSIX shell, curl, and git, as well as PostgreSQL, including development headers, and any build dependencies of the packages you want to install.

How it works

Pex uses a repository of package description files (see below) to know where to download a specific package. The package description files are (normally) in a Git repository, by default cloned from https://github.com/petere/pex-packages. So to make changes, use Git tools to make a branch, revert changes, etc. When asked to install a package, Pex downloads, unpacks, builds, and installs the package into the PostgreSQL installation. There are command-line options to choose among multiple PostgreSQL installations.

Pex maintains a small amount of state to keep track of what it has already downloaded or installed. See the man page for the file locations.

If you maintain custom versions of packages or have in-house packages, Pex can support that. Just edit the repository and change the download URLs or add your own packages.

Package description file format

Use pex --repo to see where the package description files are stored. See the man page for details.

The package files are in YAML format. But note that the files are parsed by a shell script, not by a real YAML library, so be gentle. The files must be named packagename.yaml. Here is an example of plsh.yaml:

homepage: https://github.com/petere/plsh
url: https://github.com/petere/plsh/archive/1.20121226.zip
sha1: c85166bc04a3a3731c4acc3f144a0d4779f20010

There are three required fields:

  • homepage: A location that can be opened in a web browser to learn about the package.
  • url: A location that curl can download and either tar or zip can unpack to get the package source.
  • sha1: The SHA1 hash of the downloaded archive.

There is one optional field:

  • aliases: Lists alternative package names. These can be used in commands such as install instead of the canonical package name. If the package provides extensions that differ from the package name, it is recommended that the extension names be listed as aliases. For example, the package plv8 might list

    aliases: plcoffee plls

Use pex audit to check the package file for syntax and other errors. Note that this requires Perl and the YAML module.

pex's People

Contributors

petere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mmccormick

pex's Issues

proj_api.h file not found

I'm trying to install postgis using pex and I'm getting stuck on the error below. Proj is installed from homebrew. /usr/local/include/proj_api.h is available.

---- Making all in topology
clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  -I../liblwgeom -I../libpgcommon  -I/usr/local/Cellar/geos/3.7.1_1/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2     -fPIC -I. -I./ -I/usr/local/Cellar/[email protected]/9.6.11/include/server -I/usr/local/Cellar/[email protected]/9.6.11/include/internal -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -I/usr/local/opt/gettext/include -I/usr/local/opt/openldap/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -I/usr/local/opt/tcl-tk/include  -c -o postgis_topology.o postgis_topology.c
In file included from postgis_topology.c:28:
In file included from ../liblwgeom/liblwgeom_internal.h:48:
../liblwgeom/liblwgeom.h:35:10: fatal error: 'proj_api.h' file not found
#include "proj_api.h"
         ^~~~~~~~~~~~
1 error generated.
make[1]: *** [postgis_topology.o] Error 1
make: *** [all] Error 1

Postgis on mac compile issue with gettext

By default, Postgis will try to compile with gettext support. This creates a problem on macs (at least on mavericks). Whilst OS X provides the gettext library, it is incomplete and missing certain dylibs. As a result, Postgis' .configure will try to compile with gettext support and fail.

There are two ways around this:

  1. Remove gettext support for a default install (possibly also providing a flag --with-gettext for those who need it). This requires a change to the recipe (or can we add compilation flags to pex install ?).
  2. Install gettext via homebrew followed by brew link --force gettext. One should unlink gettext after building postgis as this will conflict with the standard OS X library (as per homebrew's caveats).

Option 1 is probably better. From Postgis' installation reference:

--with-gettext=no
By default PostGIS will try to detect gettext support and compile with it, however if you run into
incompatibility issues that cause breakage of loader, you can disable it entirely with this command. Refer to ticket http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by configuring with this. NOTE: that you aren't missing much by turning this off. This is used for international help/label support for the GUI loader which is not yet documented and still experimental.

I'm not sure how to implement such a change to pex's postgis recipe, so I can't provide a PR. Either way, leaving this issue here in case people run into trouble.

joao.

use of undeclared identifier 'FALSE'

I installed [email protected] and pex via homebrew on macOS Mojave 10.14.5, but when I try to install ip4r package โ€” I get about 20 errors like this:

./ip4r_funcs.h:74:16: error: use of undeclared identifier 'FALSE'
        return FALSE;
               ^

Other errors differ only in filename or constant (TRUE/FALSE).

pex uninstall?

Is there any way to uninstall an extension, say if I want to downgrade to an older version?

Install specific/older versions

It would be nice to be able to install specific versions of the extensions.

For example with the following syntax for the .yml package description:

homepage: http://postgis.net/
latest_version: 2.2.2
versions:
  - 2.2.2:
    url: http://download.osgeo.org/postgis/source/postgis-2.2.2.tar.gz
    sha1: f82fa96c4c73e8a94091b51f2e528a8146b03597
  - 2.2.1:
    url: http://download.osgeo.org/postgis/source/postgis-2.2.1.tar.gz
    sha1: 615f86c34ed4431383432d34f4b6d558c71fb94f

The default would be to use the latest available version when installing. To override you would do:

pex install [email protected]

With above syntax it would be easy to install multiple packages at different versions:

Add "caveats" to pex info

Similar to homebrew it would be nice to have some "caveats" info regarding the installation of an extension.

For example I was unable to install postgis as my brew package gettext wasn't linked (it's keg-only). This would be a great addition to a caveats section.

I'm imagining an output like this when running pex info postgis:

name: postgis
homepage: http://postgis.net/
url: http://download.osgeo.org/postgis/source/postgis-2.2.2.tar.gz
status: installed
caveats:
- If you're getting an error similar to fatal error: 'libintl.h' file not found you may have to install gettext with homebrew and link it with brew link gettext.

Postgis and XCode 8

Hi,

Pex is unable to build Postgis on OSX 10.11.6 with the latest XCode 8.
It complains about not finding libxml2. Homebrew provides this, though not linked by default. Forcing a link creates a different error during the build.
Looking around, this seems to be related with issues with the recently released XCode 8 and libxml2 (of the top of my head, xcode is linking to libraries that used to be there in previous versions but are no longer available).
Is there anything that can be done on the pex side?

Joao.

pex install plv8 fails on MacOS Catalina

pex install plv8 results in the following message, please help

"$errmsg" is not exported by the Digest::SHA module
Can't continue after import errors at /usr/local/bin/shasum line 24.
BEGIN failed--compilation aborted at /usr/local/bin/shasum line 24.
/usr/local/bin/pex: line 647: [: =: unary operator expected
==> Downloading plv8 from https://github.com/plv8/plv8/archive/v2.1.0.tar.gz
-=O=- # # # #
"$errmsg" is not exported by the Digest::SHA module
Can't continue after import errors at /usr/local/bin/shasum line 24.
BEGIN failed--compilation aborted at /usr/local/bin/shasum line 24.
pex: SHA1 mismatch
Expected: aec2068e3826bddd3dff197f78e04bef9d5c2387
Actual:

pex init won't work

> pex init
fatal: unable to connect to github.com:
github.com[0: 140.82.121.4]: errno=Operation timed out

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.