wok-current annotate vim/receipt @ rev 24055
Add current_version for most github hosted softwares
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jun 08 08:46:05 2021 +0000 (2021-06-08) |
parents | e77ae4711268 |
children | ac8ca9758df1 |
rev | line source |
---|---|
erjo@250 | 1 # SliTaz package receipt. |
erjo@250 | 2 |
erjo@250 | 3 PACKAGE="vim" |
Hans-G?nter@23724 | 4 VERSION="8.2.0664" |
pascal@18559 | 5 CATEGORY="editors" |
Hans-G?nter@22104 | 6 TAGS="text-editor" |
Hans-G?nter@22104 | 7 SHORT_DESC="Advanced text editor." |
erjo@784 | 8 MAINTAINER="erjo@slitaz.org" |
pascal@15363 | 9 LICENSE="other" |
Hans-G?nter@22104 | 10 WEB_SITE="https://www.vim.org/" |
Hans-G?nter@22104 | 11 |
Hans-G?nter@22104 | 12 TARBALL="$PACKAGE-$VERSION.tar.gz" |
Hans-G?nter@22104 | 13 WGET_URL="https://github.com/$PACKAGE/$PACKAGE/archive/v$VERSION.tar.gz" |
Hans-G?nter@22104 | 14 |
Hans-G?nter@22104 | 15 DEPENDS="acl diffutils ncurses" |
Hans-G?nter@22104 | 16 BUILD_DEPENDS="acl-dev diffutils ncurses-dev" |
Hans-G?nter@22104 | 17 |
mallory@6286 | 18 CONFIG_FILES="/etc/vim/vimrc" |
pascal@13276 | 19 |
pascal@24055 | 20 current_version() |
pascal@24055 | 21 { |
pascal@24055 | 22 wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \ |
pascal@24055 | 23 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q' |
pascal@24055 | 24 } |
pascal@24055 | 25 |
erjo@250 | 26 # Rules to configure and make the package. |
erjo@250 | 27 compile_rules() |
erjo@250 | 28 { |
pascal@17716 | 29 export LDFLAGS="$LDFLAGS -ltinfo" |
manuelfloresv@9417 | 30 |
manuelfloresv@9417 | 31 # define the place for the global vimrc file (set to /etc/vim/vimrc) |
manuelfloresv@9417 | 32 # (patch from Arch Linux PKGBUILD) |
Hans-G?nter@23724 | 33 sed -i 's|^.*\(#define SYS_VIMRC_FILE\).*$|\1 "/etc/vim/vimrc"|' \ |
Hans-G?nter@23724 | 34 $src/src/feature.h |
al@18741 | 35 |
Hans-G?nter@22104 | 36 ./configure \ |
Hans-G?nter@22104 | 37 --prefix=/usr \ |
Hans-G?nter@22104 | 38 --cache-file=$PWD/config.cache \ |
Hans-G?nter@22104 | 39 --infodir=/usr/share/info \ |
Hans-G?nter@22104 | 40 --with-features=normal \ |
Hans-G?nter@22104 | 41 --with-x=no \ |
Hans-G?nter@22104 | 42 --disable-gui \ |
Hans-G?nter@22104 | 43 --enable-multibyte \ |
Hans-G?nter@22104 | 44 --disable-motif-check \ |
Hans-G?nter@22104 | 45 --disable-athena-check \ |
Hans-G?nter@22104 | 46 --mandir=/usr/share/man \ |
Hans-G?nter@22104 | 47 $CONFIGURE_ARGS && |
al@18741 | 48 |
Hans-G?nter@22104 | 49 make \ |
Hans-G?nter@22104 | 50 VIMRCLOC=/etc/vim \ |
Hans-G?nter@23724 | 51 VIMRUNTIMEDIR=/usr/share/vim/vim82 \ |
Hans-G?nter@22104 | 52 MAKE="make -e" && |
slaxemulator@8751 | 53 make DESTDIR=$DESTDIR install |
Hans-G?nter@22104 | 54 |
slaxemulator@8751 | 55 mkdir -p $DESTDIR/etc/vim |
Hans-G?nter@23724 | 56 cp -a $src/runtime/vimrc_example.vim $DESTDIR/etc/vim/vimrc |
erjo@250 | 57 } |
erjo@250 | 58 |
erjo@250 | 59 # Rules to gen a SliTaz package suitable for Tazpkg. |
erjo@250 | 60 genpkg_rules() |
erjo@250 | 61 { |
Hans-G?nter@22104 | 62 mkdir -p $fs/usr/share |
Hans-G?nter@22104 | 63 mkdir -p $fs/etc |
Hans-G?nter@22104 | 64 |
Hans-G?nter@22104 | 65 cp -a $install/usr/bin $fs/usr |
Hans-G?nter@22104 | 66 cp -a $install/usr/share/vim $fs/usr/share |
Hans-G?nter@22104 | 67 cp -a $install/etc/vim $fs/etc |
erjo@2927 | 68 } |
erjo@250 | 69 |
erjo@250 | 70 post_install() |
erjo@250 | 71 { |
al@18741 | 72 cmd=$(readlink "$1/bin/vi") |
Hans-G?nter@22104 | 73 if [ "$cmd" != '/usr/bin/vim' ] |
Hans-G?nter@22104 | 74 then |
al@18741 | 75 echo '' |
al@18741 | 76 echo "**** Actual VI link : $cmd" |
al@18741 | 77 echo '' |
al@18741 | 78 echo -n 'Do you want vim for /bin/vi (y/N) ? : '; read -t 30 anser |
Hans-G?nter@22104 | 79 if [ "$anser" = 'y' ] |
Hans-G?nter@22104 | 80 then |
al@18741 | 81 echo '' |
al@18741 | 82 echo -n 'Removing vi link to make a new one pointing on /usr/bin/vim...' |
al@18741 | 83 rm "$1/bin/vi" && ln -sf /usr/bin/vim "$1/bin/vi" |
al@18741 | 84 status |
Hans-G?nter@22104 | 85 else |
al@18741 | 86 echo '' |
al@18741 | 87 echo "Leaving /bin/vi to : $cmd" |
al@18741 | 88 fi |
al@18741 | 89 fi |
erjo@250 | 90 } |
erjo@250 | 91 |
erjo@2531 | 92 post_remove() |
erjo@2531 | 93 { |
erjo@2531 | 94 # restore previous symlink |
pascal@18730 | 95 ln -sf /bin/busybox "$1/bin/vi" |
erjo@2531 | 96 } |