updated on Tue Jan 17 00:10:10 UTC 2012
[aur-mirror.git] / elvis / PKGBUILD
bloba73b1eece3e5b6c108fa4969bec6376eba8e04ad
1 # Maintainer: Robert Kieffer <rek2w @ A L U M N I DOT V I R G I N I A DOT E D U>
2 # Based on pkgbuild by Rudy Matela <rudy.matela@gmail.com>
3 # Date: 2010-10-11 
5 # compile options
7 # If you want to build the beta (2.2_1) instead of the stable (2.2_0), 
8 # change elvis source and MD5 to:
9 # "ftp://ftp.cs.pdx.edu/pub/elvis/unreleased/almost-2.2_1.tar.gz"
10 # "6959f2f156920db47e4c6324f187e632"
11 # and pkgver="2.2_1"
13 _COMPILEWX11=true               # X11 support built by default
14 _SLACKWARECOLORS=false  # elvis colorscheme from slackware not installed by default - it's boring
17 pkgname=elvis
18 pkgver=2.2_0
19 pkgrel=2
20 url="http://elvis.the-little-red-haired-girl.org/"
21 alt_url="http://elvis.vi-editor.org/"
22 pkgdesc="A vi clone - with X support (if you wish) - stable or beta version"
23 depends=('glibc' 'libx11' 'ncurses' 'fontconfig' 'expat' 'freetype2' 'zlib')
24 source=("ftp://ftp.cs.pdx.edu/pub/elvis/elvis-2.2_0.tar.gz"
25         "http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/editors/elvis/patches/patch-ref.c"
26         "http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/editors/elvis/patches/patch-ae"
27         "ftp://ftp.slackware.com/pub/slackware/slackware-13.0/source/a/elvis/elvis.clr")
28 md5sums=('6831b8df3e4a530395e66c2889783752'
29          '8d9df9aa5edcf8e0b8a2f5d59d1c30c7'
30          '2bec41d9f09542e2ef41de1e6b41727e'
31          'c47a70cb176ebf2eb99b055c4048a560')
32 arch=('i686' 'x86_64')
33 license=('PerlArtistic')
34 replaces=('elvis_patched-withx' 'elvis_slack')
36 _DESKTOPFILE="[Desktop Entry]\\nType=Application\\nVersion=1.0\\nName=Elvis\\nComment=A simple text editor\\nExec=elvis\\nIcon=$pkgname\\nTerminal=true\\nCategories=Editors;Programming;Accessories"
38 build() { 
39         cd $srcdir/elvis-$pkgver
40         if [ $_COMPILEWX11 = "true" ]   
41         then
42                 _X11OPT=" --with-x"
43                 _COMPILEWX11=1
44         else 
45                 _X11OPT=" --with-x=no"
46                 _COMPILEWX11=0
47         fi
48         if [ $_SLACKWARECOLORS = "true" ]
49                 then cp $srcdir/elvis.clr ./data
50         fi
51   cat $srcdir/patch-* > patches
52   patch -p0 <patches
53   echo -e $_DESKTOPFILE > $pkgname.desktop
54   ./configure --prefix=/usr --verbose $_X11OPT
55   sed 's/\<CTAGS\>/ELVTAGS/g; s/ctags\>/elvtags/g; s/ant" elvtags/ant" ctags/' doc/ctags.man >doc/elvtags.man
56   /usr/bin/make || return 1
57   
58         install -d $pkgdir/usr/bin $pkgdir/usr/share/elvis/ $pkgdir/usr/share/man/man1/
59   for i in elvis ref elvtags elvfmt; do
60       install -D -s -m755 $i $pkgdir/usr/bin/
61   done
63   cd $srcdir/elvis-$pkgver/data/
64   cp -r *  $pkgdir/usr/share/elvis/
65   
66   cd $srcdir/elvis-$pkgver/doc/
67   install -D -m644 *.html bugs.txt $pkgdir/usr/share/elvis/
68   for i in elvis ref elvtags elvfmt; do
69       mv $i.man $i.1
70       gzip $i.1
71       install -D -m644 $i.1.gz $pkgdir/usr/share/man/man1/
72   done
73   
74   if (( $_COMPILEWX11 ))        
75         then
76         install -D -m644 $srcdir/elvis-$pkgver/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop
77         install -D -m644 $srcdir/elvis-$pkgver/data/icons/elvis3.xpm $pkgdir/usr/share/pixmaps/$pkgname.xpm
78   fi