Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Oct 2012 09:23:56 +0400
From:      =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0KHQuNCy0LDRh9C10L3QutC+?= <mitya@yandex-team.ru>
To:        Li-Wen Hsu <lwhsu@FreeBSD.org>
Cc:        Chris Rees <utisoft@gmail.com>, python@freebsd.org, Ruslan Mahmatkhanov <cvs-src@yandex.ru>
Subject:   Re: bin/python3 symlink for python3X ports
Message-ID:  <506E6EEC.5030209@yandex-team.ru>
In-Reply-To: <20121001173946.GB4939@FreeBSD.cs.nctu.edu.tw>
References:  <5062AAEA.4000401@FreeBSD.org> <CADLo838ZysqxVHPuj6_M223ohanPWRoqc2mwePNeBYbGa2OfRQ@mail.gmail.com> <5062C5CB.4060109@yandex.ru> <5062C769.6090305@FreeBSD.org> <5062C8CE.701@yandex.ru> <5062E478.8020000@FreeBSD.org> <CAKBkRUxThcF3amNLBazkkdd2s9ce73u_J=q3o2EvpyLhL4GnfQ@mail.gmail.com> <506436DB.90408@FreeBSD.org> <20121001173946.GB4939@FreeBSD.cs.nctu.edu.tw>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On 01.10.2012 21:39, Li-Wen Hsu wrote:
>
> Thanks for working on this, I am looking forward to your patch.
>

Hello,

Please consider the attached patch for python2/python3 symlinks.
As I proposed earlier in this thread, I think it is sane to make these symlinks
for latest python2.X/python3.X versions only (this is what people should use by
default in most cases).

And let people explicitly run older versions if they really need them.

[-- Attachment #2 --]
Index: python27/pkg-plist
===================================================================
--- python27/pkg-plist	(revision 305295)
+++ python27/pkg-plist	(working copy)
@@ -6,8 +6,10 @@
 %%IF_DEFAULT%%bin/pydoc
 bin/pydoc%%PYVER%%
 %%IF_DEFAULT%%bin/python
+bin/python%%PYMAJOR%%
 bin/python%%PYVER%%
 %%IF_DEFAULT%%bin/python-config
+bin/python%%PYMAJOR%%-config
 bin/python%%PYVER%%-config
 %%IF_DEFAULT%%bin/python-shared
 bin/python-shared%%PYVER%%
Index: python27/Makefile
===================================================================
--- python27/Makefile	(revision 305295)
+++ python27/Makefile	(working copy)
@@ -7,7 +7,7 @@
 
 PORTNAME=	python27
 PORTVERSION=	2.7.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	${PYTHON_MASTER_SITES}
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -37,6 +37,7 @@
 PLIST=		${WRKDIR}/PLIST
 PLIST_TEMPLATE?=${PKGDIR}/pkg-plist
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
+		PYMAJOR=${PYTHON_MAJOR_VER} \
 		PYVER_WITHPAT=${PORTVERSION:S/.c/c/}
 EXAMPLESDIR=	${PREFIX}/share/examples/${PYTHON_VERSION}
 DATADIR=	${PREFIX}/share/${PYTHON_VERSION}
@@ -287,6 +288,10 @@
 	done
 .endif
 
+.for file in python python-config
+	cd ${LOCALBASE}/bin && ${LN} -sf ${file:S/python/${PYTHON_VERSION}/} ${file:S/python/python${PYTHON_MAJOR_VER}/}
+.endfor
+
 .if !defined(NOPORTDATA)
 	@${MKDIR} ${DATADIR}
 	@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \
Index: python32/pkg-plist
===================================================================
--- python32/pkg-plist	(revision 305295)
+++ python32/pkg-plist	(working copy)
@@ -5,8 +5,10 @@
 %%IF_DEFAULT%%bin/pydoc3
 bin/pydoc3-%%PYVER%%
 %%IF_DEFAULT%%bin/python
+bin/python%%PYMAJOR%%
 bin/python%%PYVER%%
 %%IF_DEFAULT%%bin/python-config
+bin/python%%PYMAJOR%%-config
 bin/python%%PYVER%%-config
 %%IF_DEFAULT%%bin/python-shared
 bin/python-shared%%PYVER%%
Index: python32/Makefile
===================================================================
--- python32/Makefile	(revision 305295)
+++ python32/Makefile	(working copy)
@@ -7,7 +7,7 @@
 
 PORTNAME=	python32
 PORTVERSION=	3.2.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang python ipv6
 MASTER_SITES=	${PYTHON_MASTER_SITES}
 MASTER_SITE_SUBDIR=	${PYTHON_MASTER_SITE_SUBDIR}
@@ -37,6 +37,7 @@
 
 SHARED_WRKSRC=	${PYTHON_WRKSRC}/portbld.shared
 PLIST_SUB=	PYVER=${PYTHON_VERSION:S/python//} \
+		PYMAJOR=${PYTHON_MAJOR_VER} \
 		PYVER_WITHPAT=${PORTVERSION:S/.rc/rc/} \
 		PYABIVER=${PYABIVER}
 EXAMPLESDIR=	${PREFIX}/share/examples/${PYTHON_VERSION}
@@ -216,6 +217,10 @@
 	done
 .endif
 
+.for file in python python-config
+	cd ${LOCALBASE}/bin && ${LN} -sf ${file:S/python/${PYTHON_VERSION}/} ${file:S/python/python${PYTHON_MAJOR_VER}/}
+.endfor
+
 .if !defined(NOPORTDATA)
 	@${MKDIR} ${DATADIR}
 	@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \

[-- Attachment #3 --]
--- bsd.python.mk.bak	2012-10-04 18:34:34.000000000 +0400
+++ bsd.python.mk	2012-10-05 09:10:17.000000000 +0400
@@ -87,6 +87,9 @@
 #					  in case you want to use an older version as a default.
 #					  default: python2.7
 #
+# PYTHON_MAJOR_VER	- Python version major number. 2 for python-2.x,
+#					  3 for python-3.x and so on.
+#
 # PYTHON_WRKSRC		- The ${WRKSRC} for your python version. Needed for
 #					  extensions like Tkinter, py-gdbm and py-expat, which
 #					  are built from sources contained in the Python
@@ -412,6 +415,8 @@
 	@${FALSE}
 .endif
 
+PYTHON_MAJOR_VER=	${PYTHON_VER:R}
+
 PYTHON_MASTER_SITES=		${MASTER_SITE_PYTHON}
 PYTHON_MASTER_SITE_SUBDIR=	ftp/python/${PYTHON_PORTVERSION:C/rc[0-9]//}
 PYTHON_DISTFILE=		Python-${PYTHON_PORTVERSION:S/.rc/rc/}${EXTRACT_SUFX}
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?506E6EEC.5030209>