-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To avoid having to deal with the setup.py install vagueries when installing python for Debian packaging, let pybuild take care of the building and installing of python. Rewrite debian/rules to make use of debhelper for as much as possible and minimize hackery. Also remove Debian-packaging-specific hacks in Makefile.in The recipe we are now following is to install everything in debian/tmp (instead of straight into the debian/<package>/ directories), and divide the resulting files up over the packages using debian/<package.install> files. Try to clean up some Lintin errors and warnings in the process. Note that we are still using distutils in the setup.py files and calling "python setup.py install" which are both deprecated. Only this combination appears to not be hit by pypa/pip#10978 so just leaving as is. Also introduces: * testing on both Focal and Jammy * fix intermittent test failure in build process
- Loading branch information
1 parent
e2a52a3
commit b096ac3
Showing
18 changed files
with
91 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9 | ||
11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
usr/lib/libspud* | ||
usr/include/spud* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
usr/lib/python3*/dist-packages/dxdiff* | ||
usr/bin/dxdiff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/python3*/dist-packages/libspud* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,139 +1,22 @@ | ||
#!/usr/bin/make -f | ||
|
||
PACKAGE_NAME=spud-diamond | ||
MODULE_NAME=diamond | ||
DEB_UPSTREAM_VERSION=1.0 | ||
|
||
PYVERS=$(shell py3versions -dv) | ||
|
||
# These are used for cross-compiling and for saving the configure script | ||
# from having to guess our platform (since we know it already) | ||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | ||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | ||
|
||
|
||
config.status: configure | ||
dh_testdir | ||
# Add here commands to configure the package. | ||
|
||
ifneq "$(wildcard /usr/share/misc/config.sub)" "" | ||
cp -f /usr/share/misc/config.sub config.sub | ||
endif | ||
ifneq "$(wildcard /usr/share/misc/config.guess)" "" | ||
cp -f /usr/share/misc/config.guess config.guess | ||
endif | ||
./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" | ||
|
||
build-libspud: build-libspud-stamp | ||
build-libspud-stamp: | ||
touch $@ | ||
|
||
build-libspud: config.status | ||
dh_testdir | ||
|
||
# Add here commands to compile the package. | ||
$(MAKE) libspud.la | ||
#docbook-to-man debian/fluidity.sgml > fluidity.1 | ||
$(MAKE) doc | ||
|
||
|
||
build-spud-diamond: build-spud-diamond-stamp | ||
build-spud-diamond-stamp: $(PYVERS:%=build-python%) | ||
touch $@ | ||
build-python%: config.status | ||
# Force setuptools, but reset sys.argv[0] to 'setup.py' because setup.py files expect that. | ||
cd diamond;python$* -c "import setuptools,sys;f='setup.py';sys.argv[0]=f;exec(open(f,'r').read(),{'__file__':f,'__name__':'__main__'})" build | ||
touch $@ | ||
clean: | ||
dh_testdir | ||
dh_testroot | ||
rm -f *-stamp | ||
rm -rf dist build | ||
-find -name '*.py[co]' | xargs rm -f | ||
$(MAKE) clean || true | ||
# find . -name *.pyc -exec rm {} \; | ||
dh_clean | ||
|
||
install-libspud: build-libspud install-prereq | ||
$(MAKE) install-libspud DESTDIR=$(CURDIR)/debian/libspud-dev | ||
rm -f $(CURDIR)/debian/libspud-dev/usr/include/tiny*h | ||
|
||
install-spudtools: install-prereq | ||
$(MAKE) install-spudtools DESTDIR=$(CURDIR)/debian/spudtools | ||
|
||
install-spud-diamond: build-spud-diamond install-prereq $(PYVERS:%=install-python%) | ||
dh_install | ||
install-prereq: | ||
dh_testdir | ||
dh_testroot | ||
dh_clean -k | ||
dh_installdirs -a | ||
|
||
install-python%: | ||
# Force setuptools, but reset sys.argv[0] to 'setup.py' because setup.py files expect that. | ||
cd diamond;python$* -c "import setuptools,sys;f='setup.py';sys.argv[0]=f;exec(open(f,'r').read(),{'__file__':f,'__name__':'__main__'})" install --prefix=/usr --no-compile --single-version-externally-managed --root=$(CURDIR)/debian/${PACKAGE_NAME} | ||
if [ -d debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}.egg-info ]; then \ | ||
mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages ; \ | ||
mv debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}.egg-info debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}.egg-info ; \ | ||
elif [ -d debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info ]; then \ | ||
mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages ; \ | ||
mv debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info debian/${PACKAGE_NAME}/usr/lib/python$*/dist-packages/${MODULE_NAME}.egg-info ; \ | ||
else \ | ||
echo "Failed to locate python egg, was it built correctly?" && exit 1 ; \ | ||
fi | ||
|
||
install-pyspud: | ||
$(MAKE) install-pyspud DESTDIR=$(CURDIR)/debian/python3-spud BUILDING_DEBIAN=yes | ||
|
||
install-dxdiff: | ||
$(MAKE) install-dxdiff DESTDIR=$(CURDIR)/debian/python3-dxdiff | ||
|
||
binary-arch: build-libspud install-libspud install-spudtools install-pyspud | ||
dh_testdir | ||
dh_testroot | ||
dh_installchangelogs | ||
dh_installdocs | ||
dh_installexamples | ||
# dh_install | ||
# dh_installmenu | ||
# dh_installdebconf | ||
# dh_installlogrotate | ||
# dh_installemacsen | ||
# dh_installpam | ||
# dh_installmime | ||
dh_python3 | ||
# dh_installinit | ||
# dh_installcron | ||
# dh_installinfo | ||
dh_installman | ||
dh_link | ||
dh_strip | ||
dh_compress | ||
dh_fixperms | ||
# dh_perl | ||
dh_makeshlibs | ||
dh_installdeb | ||
dh_shlibdeps | ||
dh_gencontrol | ||
dh_md5sums | ||
dh_builddeb | ||
|
||
binary-indep: build-spud-diamond install-spud-diamond build-libspud install-libspud install-spudtools install-dxdiff | ||
dh_testdir -i | ||
dh_testroot -i | ||
dh_python3 -i | ||
dh_installdocs -i | ||
dh_installdirs -i | ||
dh_installexamples -i | ||
dh_strip -i | ||
dh_compress -i -X.py | ||
dh_fixperms -i | ||
dh_installdeb -i | ||
dh_gencontrol -i | ||
dh_md5sums -i | ||
dh_builddeb -i | ||
|
||
binary: binary-indep binary-arch | ||
|
||
|
||
.PHONY: build clean binary-indep binary-arch binary-spud-diamond binary-libspud install configure | ||
#export DH_VERBOSE=1 | ||
export BUILDING_DEBIAN=yes | ||
PYTHON_DIRS=diamond dxdiff python | ||
|
||
# standard rule | ||
%: | ||
dh $@ --with=python3 | ||
|
||
# instead of calling make/make default to build | ||
# call "make libspud.la" separately and use pybuild for building the python packages | ||
override_dh_auto_build: | ||
dh_auto_build -- libspud.la | ||
for i in $(PYTHON_DIRS); do PYBUILD_NAME=$$i; dh_auto_build --buildsystem=pybuild --sourcedir=$$i; done | ||
|
||
# instead of a single "make install" into debian/tmp | ||
# only use makefile for install-libspud and install-spudtools | ||
# and use pybuild to install python packages | ||
override_dh_auto_install: | ||
make install-libspud install-spudtools DESTDIR=debian/tmp/ | ||
for i in $(PYTHON_DIRS); do PYBUILD_NAME=$$i; dh_auto_install --buildsystem=pybuild --sourcedir=$$i; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
usr/lib/python3*/dist-packages/diamond* | ||
usr/bin/diamond | ||
usr/share/diamond* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
usr/bin/spud* | ||
usr/share/spud* |
Oops, something went wrong.