summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2023-03-14 01:56:33 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2023-09-26 20:14:56 +0200
commit05d25fc9a9e60a7ae209405cd2c825c1adc6ecdb (patch)
treeed7aa0fcef9a75c6a620a0f54d1a9143028bbf86
parent5862e5b60f988900143ee0f8516bb9eab3ced710 (diff)
Move packaging related files to its own directory
Instead of using the main build command now a Python package is explicitly created and extracted, and the Debian package is generated from that extracted package to be able to adjust some things (like copying a "setup.py" file used only for packaging without having to include it in the main sources). Unfortunately not everything can be done under the "packaging" directory, as the "__pycache__" and "egg-info" directories are created in the source directory when the Python package is created. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--.gitignore5
-rw-r--r--recording/packaging/Makefile (renamed from recording/Makefile)18
-rw-r--r--recording/packaging/setup.py (renamed from recording/setup.py)0
3 files changed, 19 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 5ed425da0..fe43b147e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,7 +38,6 @@
/.fleet
# Recording server packages
-/recording/deb_dist
-/recording/dist/
-/recording/nextcloud-talk-recording-*.tar.gz
+/recording/packaging/nextcloud-talk-recording-*
+/recording/src/nextcloud/talk/recording/__pycache__/
/recording/src/nextcloud_talk_recording.egg-info/
diff --git a/recording/Makefile b/recording/packaging/Makefile
index 4774e0a30..534d5ec5c 100644
--- a/recording/Makefile
+++ b/recording/packaging/Makefile
@@ -17,9 +17,25 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+NEXTCLOUD_TALK_RECORDING_VERSION := $(shell cd ../src && python3 -c "from nextcloud.talk.recording import __version__; print(__version__)")
+
build-package-deb:
python3 -m pip install "setuptools >= 61.0"
+
+ # Build a source Python package
+ python3 -m build --sdist --outdir . ../
+
+ # Extract source Python package
+ tar --extract --gzip --file nextcloud-talk-recording-$(NEXTCLOUD_TALK_RECORDING_VERSION).tar.gz
+
+ # Add extra files needed to create Debian packages:
+ # - setup.py: legacy setup file needed for stdeb (also needed in the
+ # regenerated Python package, as stdeb is invoked through it to create the
+ # source Debian package).
+ cp setup.py nextcloud-talk-recording-$(NEXTCLOUD_TALK_RECORDING_VERSION)/
+
+ # Build a source Debian package and then, from it, a binary Debian package
# Since the 60.0.0 release, Setuptools includes a local, vendored copy of
# distutils; this copy does not seem to work with stdeb, so it needs to be
# disabled with "SETUPTOOLS_USE_DISTUTILS=stdlib".
- SETUPTOOLS_USE_DISTUTILS=stdlib python3 setup.py --command-packages=stdeb.command bdist_deb
+ cd nextcloud-talk-recording-$(NEXTCLOUD_TALK_RECORDING_VERSION)/ && SETUPTOOLS_USE_DISTUTILS=stdlib python3 setup.py --command-packages=stdeb.command sdist_dsc bdist_deb
diff --git a/recording/setup.py b/recording/packaging/setup.py
index d55878a2e..d55878a2e 100644
--- a/recording/setup.py
+++ b/recording/packaging/setup.py