wok view vim/receipt @ rev 25686

Use System category for pm-suspend entry
author Stanislas Leduc <shann@slitaz.org>
date Sat Apr 06 12:03:22 2024 +0200 (7 months ago)
parents 5fb9c98c2c90
children 506058500799
line source
1 # SliTaz package receipt.
3 PACKAGE="vim"
4 VERSION="9.1.0135"
5 basever=${VERSION%.*}
6 basever=${basever/./}
7 CATEGORY="editors"
8 TAGS="text-editor"
9 SHORT_DESC="Advanced text editor."
10 MAINTAINER="erjo@slitaz.org"
11 LICENSE="other"
12 WEB_SITE="https://www.vim.org/"
14 TARBALL="$PACKAGE-$VERSION.tar.gz"
15 WGET_URL="https://github.com/$PACKAGE/$PACKAGE/archive/v$VERSION.tar.gz"
17 DEPENDS="acl diffutils ncurses"
18 BUILD_DEPENDS="acl-dev diffutils ncurses-dev"
20 CONFIG_FILES="/etc/vim/vimrc"
22 # What is the latest version available today?
23 current_version()
24 {
25 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
26 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
27 }
29 # Rules to configure and make the package.
30 compile_rules()
31 {
32 export LDFLAGS="$LDFLAGS -ltinfo"
34 # define the place for the global vimrc file (set to /etc/vim/vimrc)
35 # (patch from Arch Linux PKGBUILD)
36 sed -i 's|^.*\(#define SYS_VIMRC_FILE\).*$|\1 "/etc/vim/vimrc"|' \
37 $src/src/feature.h
39 # 9.0.0133 unrecognised:
40 # --disable-athena-check
42 ./configure \
43 --prefix=/usr \
44 --cache-file=$PWD/config.cache \
45 --infodir=/usr/share/info \
46 --with-features=normal \
47 --with-x=no \
48 --disable-gui \
49 --enable-multibyte \
50 --disable-motif-check \
51 --mandir=/usr/share/man \
52 $CONFIGURE_ARGS &&
54 make \
55 VIMRCLOC=/etc/vim \
56 VIMRUNTIMEDIR=/usr/share/vim/vim$basever\
57 MAKE="make -e" &&
58 make install \
59 DESTDIR=$DESTDIR
61 mkdir -p $DESTDIR/etc/vim
62 cp -a $src/runtime/vimrc_example.vim $DESTDIR/etc/vim/vimrc
64 for i in GenericName Keywords
65 do
66 l="$(grep $i= $DESTDIR/usr/share/applications/vim.desktop)"
67 sed -i "/$i=/d;s|$i\[de].*|$l\n&|" $DESTDIR/usr/share/applications/vim.desktop
68 done
69 }
71 # Rules to gen a SliTaz package suitable for Tazpkg.
72 genpkg_rules()
73 {
74 mkdir -p $fs/usr/share
75 mkdir -p $fs/etc
77 cp -a $install/usr/bin $fs/usr
78 cp -a $install/usr/share/vim $fs/usr/share
79 cp -a $install/etc/vim $fs/etc
80 }
82 post_install()
83 {
84 cmd=$(readlink "$1/bin/vi")
85 if [ "$cmd" != '/usr/bin/vim' ]
86 then
87 echo ''
88 echo "**** Actual VI link : $cmd"
89 echo ''
90 echo -n 'Do you want vim for /bin/vi (y/N) ? : '
91 read -t 30 anser
92 if [ "$anser" = 'y' ]
93 then
94 echo ''
95 echo -n 'Removing vi link to make a new one pointing to /usr/bin/vim...'
96 rm "$1/bin/vi" &&
97 ln -sf /usr/bin/vim "$1/bin/vi"
98 status
99 else
100 echo ''
101 echo "Leaving /bin/vi to : $cmd"
102 fi
103 fi
104 }
106 post_remove()
107 {
108 # restore previous symbolic link
109 ln -sf /bin/busybox "$1/bin/vi"
110 }