The diff below will make my life as the de facto protobuf maintainer
easier. The protobuf python sources on pypi always arrive a bit late.
They never are release candidates. Both these make testing annoying.

I thought about merging py-protobuf into protobuf as a subpackage, but
as far as I can tell so far it makes things more complicated rather than
easier. I'll defer wrangling with that to another day.

The version dance is to accommodate the strange naming conventions used
by upstream tags and tarballs for release candidates.

The generated package is identical apart from the new HOMEPAGE in DESCR
and the fact that the LICENSE file is not mentioned in PKG-INFO and
SOURCES.txt; the .pyc files only changed in the header, not in the
bytecode itself (because the header contain a source file timestamp).

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/py-protobuf/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- Makefile    11 Mar 2022 18:52:52 -0000      1.22
+++ Makefile    12 Mar 2022 11:44:57 -0000
@@ -1,8 +1,14 @@
 COMMENT=               Google data interchange format (protocol buffers)
 
-MODPY_EGG_VERSION=     3.19.3
-DISTNAME=              protobuf-${MODPY_EGG_VERSION}
-PKGNAME=               py-${DISTNAME}
+V=                     3.19.3
+MODPY_EGG_VERSION=     ${V:S/-//g}
+TAG=                   v${V:S/rc-/rc/}
+
+DISTNAME=              protobuf-python-$V
+PKGNAME=               py-protobuf-${MODPY_EGG_VERSION}
+REVISION=              0
+
+WRKDIST=               ${WRKDIR}/protobuf-$V/python
 
 CATEGORIES=            devel
 
@@ -11,8 +17,9 @@ PERMIT_PACKAGE=       Yes
 
 MODULES=               lang/python
 
-MODPY_PI=              Yes
-MODPY_PI_DIR=          p/protobuf
+HOMEPAGE=              https://github.com/protocolbuffers/protobuf/
+MASTER_SITES=          
https://github.com/protocolbuffers/protobuf/releases/download/${TAG}/
+
 MODPY_SETUPTOOLS=      Yes
 
 FLAVORS=               python3
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/py-protobuf/distinfo,v
retrieving revision 1.16
diff -u -p -r1.16 distinfo
--- distinfo    18 Jan 2022 19:14:26 -0000      1.16
+++ distinfo    12 Mar 2022 11:43:56 -0000
@@ -1,2 +1,2 @@
-SHA256 (protobuf-3.19.3.tar.gz) = 2XWmMU+/XFJNSYHiQpRzkha1+4HvPBS4b7SwRdZpCQc=
-SIZE (protobuf-3.19.3.tar.gz) = 217652
+SHA256 (protobuf-python-3.19.3.tar.gz) = 
WXDuUn+TYSrmv6R57PB/aA3xBS9KU8l3l9TeUySTnVE=
+SIZE (protobuf-python-3.19.3.tar.gz) = 5125869

Reply via email to