summaryrefslogtreecommitdiff
path: root/~lukeshu/emacs24/PKGBUILD
blob: 00f90b16af03d6dd25ab30ab185cab0a654550b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# $Id: PKGBUILD 137977 2011-09-13 15:26:07Z juergen $
# Maintainer: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: Renchi Raju <renchi@green.tam.uiuc.edu>
pkgname=emacs24-bzr
_majorver=24.0.92
pkgver=106675
pkgrel=4
pkgdesc="The extensible, customizable, self-documenting real-time display editor"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/emacs/emacs.html"
license=('GPL3')
depends=('librsvg' 'gpm' 'giflib' 'libxpm' 'gtk2' 'hicolor-icon-theme' 'gconf' 'desktop-file-utils' 'alsa-lib')
install=emacs.install
source=(emacs.desktop)
md5sums=()

_bzrtrunk=bzr://bzr.savannah.gnu.org/emacs/trunk
_bzrmod=$pkgname

build() {
  cd "$srcdir"
  msg "Connecting to Bazaar server...."

  if [[ -d "$_bzrmod" ]]; then
    cd "$_bzrmod" && bzr --no-plugins pull "$_bzrtrunk" -r "$pkgver"
    msg "The local files are updated."
  else
    bzr --no-plugins branch "$_bzrtrunk" "$_bzrmod" -q -r "$pkgver"
  fi

  msg "Bazaar checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_bzrmod-$_majorver"
  cp -r "$srcdir/$_bzrmod" "$srcdir/$_bzrmod-$_majorver"

  cd "$srcdir"/$pkgname-$_majorver
  ./autogen.sh
  ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \
    --localstatedir=/var --with-x-toolkit=gtk --with-xft
  make
}

package() {
  provides=("emacs=${_majorver}a")

  cd "$srcdir"/$pkgname-$_majorver
  make DESTDIR="$pkgdir" install

  # remove conflict with ctags package
  mv "$pkgdir"/usr/bin/{ctags,ctags.emacs}
  mv "$pkgdir"/usr/share/man/man1/{ctags,ctags.emacs}.1.gz
  # fix all the 777 perms on directories
  find "$pkgdir"/usr/share/emacs/$_majorver -type d -exec chmod 755 {} \;
  # fix user/root permissions on usr/share files
  find "$pkgdir"/usr/share/emacs/$_majorver -exec chown root:root {} \;
  # fix perms on /var/games
  chmod 775 "$pkgdir"/var/games
  chmod 775 "$pkgdir"/var/games/emacs
  chmod 664 "$pkgdir"/var/games/emacs/*
  chown -R root:games "$pkgdir"/var/games

  # fix  FS#9253
  mkdir -p "$pkgdir"/usr/share/pixmaps
  ln -s  $pkgdir../emacs/$_majorver/etc/images/icons/hicolor/48x48/apps/emacs.png "$pkgdir"/usr/share/pixmaps/emacs-icon.png

  # This is done down here to help future-proof the above
  rm "$pkgdir"/usr/bin/emacs
  mv "$pkgdir"/usr/share/man/man1/emacs{,-$_majorver}.1.gz
  for prog in ctags.emacs ebrowse emacsclient etags grep-changelog rcs-checkin; do
    mv "$pkgdir"/usr/bin/$prog{,-$_majorver}
    mv "$pkgdir"/usr/share/man/man1/$prog{,-24}.1.gz
  done
  mv "$pkgdir"/usr/share/applications/emacs{,24}.desktop
  mv "$pkgdir"/usr/share/emacs/site-lisp/subdirs{,.emacs24}.el
  rm "$pkgdir"/usr/share/info/dir
  for file in "$pkgdir"/usr/share/pixmaps/emacs-icon.png `find "$pkgdir"/usr/share/{icons,info} -type f`; do
    mv "$file" "`echo "$file"|sed 's/\..*/-24&/'`"
  done
  ln -s "$_majorver" "$pkgdir"/usr/share/emacs/24
  rm "$pkgdir"/var/games/emacs/*
}