summaryrefslogtreecommitdiff
path: root/community/emacs-nox/PKGBUILD
blob: c474613141a83bf5a8e929e6c9d92a855f233aa4 (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
# $Id: PKGBUILD 67599 2012-03-13 13:43:30Z lcarlier $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Chris Brannon <cmbrannon@cox.net>

pkgname=emacs-nox
pkgver=23.4
pkgrel=1
pkgdesc="The Emacs Editor, without X11 support"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/emacs/emacs.html"
license=('GPL')
replaces=('cedet')
depends=('dbus-core' 'ncurses' 'perl')
provides=('emacs')
conflicts=('emacs' 'emacs-cvs')
options=('docs')
changelog=$pkgname.changelog
install=$pkgname.install
source=(ftp://ftp.gnu.org/gnu/emacs/emacs-${pkgver}.tar.gz)
sha256sums=('b9a2b8434052771f797d2032772eba862ff9aa143029efc72295170607289c18')

build() {
  cd ${srcdir}/emacs-$pkgver

  # gcc 4.5 Workaround: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43904
  CFLAGS="${CFLAGS} -fno-optimize-sibling-calls"\
 ./configure --prefix=/usr --without-x --without-sound

  # we don't want to use /usr/libexec
  sed -i "s|\"/usr/libexec/emacs.*$|\"/usr/lib/emacs/$pkgver\"|g" src/epaths.h
  #  mv newepaths.h src/epaths.h

  make libexecdir=/usr/lib archlibdir=/usr/lib/emacs/${pkgver}
}

package() {
  cd ${srcdir}/emacs-$pkgver

  make prefix=${pkgdir}/usr libexecdir=${pkgdir}/usr/lib \
    archlibdir=${pkgdir}/usr/lib/emacs/${pkgver} install

  # remove conflict with ctags package
  mv ${pkgdir}/usr/bin/{ctags,ctags.emacs}
  mv ${pkgdir}/usr/bin/{etags,etags.emacs}
  mv ${pkgdir}/usr/share/man/man1/{etags.1,etags.emacs.1}
  mv ${pkgdir}/usr/share/man/man1/{ctags.1,ctags.emacs.1}
  # fix all the 777 perms on directories
  find ${pkgdir}/usr/share/emacs/$pkgver -type d -exec chmod 755 {} \;
  # fix user/root permissions on usr/share files
  find ${pkgdir}/usr/share/emacs/$pkgver -exec chown root.root {} \;
  # remove empty files
  rm -rf ${pkgdir}/usr/var
  # remove .desktop file and icons
  rm -rf ${pkgdir}/usr/share/{applications,icons}

  # get rid of the package's info directory, install-info adds entries for us at install-time
  rm ${pkgdir}/usr/share/info/dir
  gzip -9nf ${pkgdir}/usr/share/info/*
}