wok view vim-tiny/receipt @ rev 25671

Up optipng (0.7.8), osip (5.3.1), pcre2 (10.43), tor (0.4.7.16), unbound (1.19.1), vim (9.1.0135)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 25 19:17:19 2024 +0000 (2 months ago)
parents 54dc13c9ffd0
children
line source
1 # SliTaz package receipt.
3 PACKAGE="vim-tiny"
4 VERSION="9.1.0135"
5 basever=${VERSION%.*}
6 basever=${basever/./}
7 CATEGORY="editors"
8 TAGS="text-editor"
9 SHORT_DESC="Advanced text editor without GUI."
10 MAINTAINER="erjo@slitaz.org"
11 LICENSE="other"
12 WEB_SITE="https://www.vim.org/"
14 SOURCE="vim"
15 TARBALL="$SOURCE-$VERSION.tar.gz"
16 WGET_URL="https://github.com/$SOURCE/$SOURCE/archive/v$VERSION.tar.gz"
18 DEPENDS="ncurses"
19 BUILD_DEPENDS="ncurses-dev"
21 CONFIG_FILES="/etc/vim/vimrc"
23 # What is the latest version available today?
24 current_version()
25 {
26 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
27 sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
28 }
30 # Rules to configure and make the package.
31 compile_rules()
32 {
33 export LDFLAGS="$LDFLAGS -ltinfo"
35 # define the place for the global vimrc file (set to /etc/vim/vimrc)
36 # (patch from Arch Linux PKGBUILD)
37 sed -i 's|^.*\(#define SYS_VIMRC_FILE\).*$|\1 "/etc/vim/vimrc"|' \
38 $src/src/feature.h
40 # 9.0.0133 unrecognised:
41 # --disable-athena-check
43 ./configure \
44 --prefix=/usr \
45 --cache-file=$PWD/config.cache \
46 --infodir=/usr/share/info \
47 --with-features=tiny \
48 --with-x=no \
49 --disable-gui \
50 --enable-multibyte \
51 --with-vim-name=$PACKAGE \
52 --disable-acl \
53 --disable-motif-check \
54 --mandir=/usr/share/man \
55 $CONFIGURE_ARGS &&
56 make \
57 VIMRCLOC=/etc/vim \
58 VIMRUNTIMEDIR=/usr/share/vim/vim$basever\
59 MAKE="make -e" &&
60 make DESTDIR=$DESTDIR install
62 mkdir -p $DESTDIR/etc/vim
63 cp -a $src/runtime/vimrc_example.vim $DESTDIR/etc/vim/vimrc
65 rm -rf $DESTDIR/usr/share/applications
66 }
68 # Rules to gen a SliTaz package suitable for Tazpkg.
69 genpkg_rules()
70 {
71 mkdir -p $fs/etc
72 mkdir -p $fs/usr/bin
73 mkdir -p $fs/usr/share/vim/vim$basever
75 cp -a $install/etc/vim $fs/etc
76 cp -a $install/usr/bin/vim-tiny $fs/usr/bin
77 cp -a $install/usr/share/vim/vim$basever/defaults.vim \
78 $fs/usr/share/vim/vim$basever
79 }
81 post_install()
82 {
83 cmd=$(readlink "$1/bin/vi")
84 if [ "$cmd" != '/usr/bin/vim-tiny' ]
85 then
86 echo ''
87 echo "**** Actual VI link : $cmd"
88 echo ''
89 echo -n 'Do you want vim-tiny for /bin/vi (y/N) ? : '
90 read -t 30 anser
91 if [ "$anser" = 'y' ]
92 then
93 echo ''
94 action 'Removing vi link to make a new one pointing to /usr/bin/vim-tiny...'
95 rm "$1/bin/vi" &&
96 ln -sf /usr/bin/vim-tiny "$1/bin/vi"
97 status
98 else
99 echo ''
100 echo "Leaving /bin/vi to : $cmd"
101 fi
102 fi
103 }
105 post_remove()
106 {
107 # restore previous symbolic link
108 ln -sf /bin/busybox "$1/bin/vi"
109 }