ports/opt (3.0): python: fix issue with man-page symlink
commit b514894f5da89906ff578c4de289e282d9c0757d Author: Juergen Daubert <jue@jue.li> Date: Sun Apr 21 11:48:33 2013 +0200 python: fix issue with man-page symlink 0) Problem: Some people have an additional link to the python man-page: is the python footprint mismatch something I can fix or am I missing anything important? NEW lrwxrwxrwx root/root usr/man/man1/python.1.gz -> python2.1.gz 1) the relevant part of Makefile.pre.in: maninstall: altmaninstall -rm -f $(DESTDIR)$(MANDIR)/man1/python2.1 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1) -rm -f $(DESTDIR)$(MANDIR)/man1/python.1 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1) 2) after 'make install' we have the following chain of symlinks: lrwxrwxrwx 1 juergen users 9 Apr 21 09:13 python.1 -> python2.1 lrwxrwxrwx 1 juergen users 11 Apr 21 09:13 python2.1 -> python2.7.1 -rw-r--r-- 1 juergen users 14582 Apr 21 09:12 python2.7.1 3) the compress_manpages function of our pkgmk: compress_manpages() { local FILE DIR TARGET cd $PKG find . -type f -path "*/man/man*/*" | while read FILE; do if [ "$FILE" = "${FILE%%.gz}" ]; then gzip -9 "$FILE" fi done find . -type l -path "*/man/man*/*" | while read FILE; do TARGET=`readlink -n "$FILE"` TARGET="${TARGET##*/}" TARGET="${TARGET%%.gz}.gz" rm -f "$FILE" FILE="${FILE%%.gz}.gz" DIR=`dirname "$FILE"` if [ -e "$DIR/$TARGET" ]; then ln -sf "$TARGET" "$FILE" fi done } 4) How it works: We search for real man-pages in $PKG and compress them, breaking all symlinks to these man-pages, which we repair afterwards. Fixing is done by adding a .gz extension to all targets of the symlinks. However, we do a test if $TARGET exists before we do the actual link, which is not the case if we have chained symlink and we do not process in the right order. For a "normal" collating we have the order python.1 before python2.1, so python2.1.gz does not exits at the time we process python.1 diff --git a/python/.footprint b/python/.footprint index b70d5c3..84fd884 100644 --- a/python/.footprint +++ b/python/.footprint @@ -3854,5 +3854,6 @@ drwxr-xr-x root/root usr/lib/python2.7/xml/sax/ -rw-r--r-- root/root usr/lib/python2.7/zipfile.pyo drwxr-xr-x root/root usr/man/ drwxr-xr-x root/root usr/man/man1/ +lrwxrwxrwx root/root usr/man/man1/python.1.gz -> python2.7.1.gz lrwxrwxrwx root/root usr/man/man1/python2.1.gz -> python2.7.1.gz -rw-r--r-- root/root usr/man/man1/python2.7.1.gz diff --git a/python/Pkgfile b/python/Pkgfile index 709c03e..3603b36 100644 --- a/python/Pkgfile +++ b/python/Pkgfile @@ -5,7 +5,7 @@ name=python version=2.7.4 -release=1 +release=2 source=(http://www.python.org/ftp/$name/$version/Python-$version.tar.xz \ pyconfig.h) @@ -24,6 +24,9 @@ build () { make make -j1 DESTDIR=$PKG install + # fix issue with man-page symlink + ln -sf python2.7.1 $PKG/usr/man/man1/python.1 + ln -sf python2.7 $PKG/usr/bin/python ln -s python2.7 $PKG/usr/lib/python ln -s python2.7 $PKG/usr/include/python
participants (1)
-
crux@crux.nu