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

Debian package support #14

Open
msqr opened this issue Feb 1, 2022 · 2 comments
Open

Debian package support #14

msqr opened this issue Feb 1, 2022 · 2 comments

Comments

@msqr
Copy link
Contributor

msqr commented Feb 1, 2022

I'd like to be able to include this extension in environments where a Debian binary package would be helpful, instead of having to build from source.

I researched a bit how to do this, and got the build working using debhelper in a feature/debian branch. See the debian/README for how I set up the build environment.

I added a deb recipe to the Makefile like this:

deb:
	make clean
	git archive --format tar --prefix=aggs-for-vecs-$(EXTENSION_VERSION)/ feature/debian |gzip >../aggs-for-vecs_$(EXTENSION_VERSION).orig.tar.gz
	pg_buildext updatecontrol
	make -f debian/rules debian/control
	dh clean
	make all
	dpkg-buildpackage -us -uc

You can see it's hard-coded to build from the feature/debian branch at the moment. I think that would eventually change to a tag or perhaps master.

I originally created the debian build files via

dh_make_pgxs -v 1.3.0 -h https://github.com/pjungwir/aggs_for_vecs

This turned the underscores in the project name to dashes, so the build packages are named like postgresql-12-aggs-for-vecs_1.3.0-1_amd64.deb (as Debian package names aren't allowed to have underscores, I think).

In any case, I'm new to building Debian packages like this, so I'm not sure if everything is configured correctly. If you have feedback, or would like me to submit a PR, I'm happy to do that.

@pjungwir
Copy link
Owner

pjungwir commented Feb 1, 2022

I think a deb is a great idea. Just today I was using apt to install first-last-agg on Ubuntu to avoid compiling it on client machines. I don't see anything in that project to build the deb file, and the deb maintainer isn't the same as the extension author. That's too bad: it would have been nice to see their approach re Makefile rules and git branches. Oh well. I think a PR would be nice though. Thanks!

@msqr
Copy link
Contributor Author

msqr commented Feb 1, 2022

Great! I'll submit a PR shortly.

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

No branches or pull requests

2 participants