Skip to content

Instantly share code, notes, and snippets.

@gfreezy
Created December 5, 2011 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfreezy/1433317 to your computer and use it in GitHub Desktop.
Save gfreezy/1433317 to your computer and use it in GitHub Desktop.
emacs package
#!/bin/sh
LC_CTYPE=zh_CN.utf8 /usr/bin/emacs-origin "$@"
ICON_PATH=/usr/share/icons/hicolor
INFO_DIR=/usr/share/info
INFO_FILES=(ada-mode auth autotype calc ccmode cl dbus dired-x ebrowse ede
ediff edt efaq eieio eintr elisp emacs emacs-mime epa erc ert eshell eudc
flymake forms gnus idlwave info mairix-el message mh-e newsticker nxml-mode
org pcl-cvs pgg rcirc reftex remember sasl sc semantic ses sieve smtpmail
speedbar tramp url vip viper widget woman)
post_install() {
gtk-update-icon-cache -q -t -f ${ICON_PATH}
[[ -x usr/bin/update-desktop-database ]] && update-desktop-database -q
for f in ${INFO_FILES[@]}; do
install-info ${INFO_DIR}/$f.gz ${INFO_DIR}/dir 2> /dev/null
done
}
post_upgrade() {
post_install $1
echo "The optional dependencies needs a rebuild."
}
pre_remove() {
gtk-update-icon-cache -q -t -f ${ICON_PATH}
[[ -x usr/bin/update-desktop-database ]] && update-desktop-database -q
for f in ${INFO_FILES[@]}; do
install-info --delete ${INFO_DIR}/$f.gz ${INFO_DIR}/dir 2> /dev/null
done
}
op=$1
shift
$op $*
# Contributor: zhuqin <zhuqin83@gmail.com>
# Contributor: Mic92 <jthalheim@gmail.com>
pkgname=emacs-gtk3-git
pkgver=20111204
pkgrel=1
pkgdesc="Gnu Emacs with gtk3 enabled from Git and use LC_CTYPE=zh_CN.utf8 for prefix when executing Emacs"
url="http://www.gnu.org/software/emacs/emacs.html"
license=('GPL')
depends=('gtk3' 'texinfo' 'hicolor-icon-theme')
makedepends=('git')
optdepends=('alsa-lib'
'desktop-file-utils: provide the desktop entry'
'gconf: for detecting the default system font in gnome'
'ghostscript: for viewing pdf/ps'
'gpm: mouse support on console'
'giflib'
'librsvg'
'libotf: to use opentype fonts'
'libxpm')
arch=('i686' 'x86_64')
provides=('emacs')
conflicts=('emacs' 'emacs-otf' 'emacs-cvs' 'emacs-bzr')
source=('emacs-cn')
md5sums=('b7b4826318c1ac8a12420817c2ce7c07')
install=emacs.install
_gitroot="git://git.savannah.gnu.org/emacs.git"
_gitname="emacs"
build() {
cd $srcdir
msg "Connecting to GIT server...."
if [ -d $_gitname ] ; then
cd $_gitname && git pull origin
msg "The local files are updated."
else
git clone $_gitroot $_gitname
fi
msg "GIT checkout done or server timeout"
msg "Starting make..."
rm -rf $srcdir/$_gitname-build
git clone $srcdir/$_gitname $srcdir/$_gitname-build
cd $srcdir/$_gitname-build
./autogen.sh
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--libexecdir=/usr/lib \
--mandir=/usr/share/man \
--without-sound \
--with-x-toolkit=gtk3
make bootstrap
make -j3
}
package() {
cd $srcdir/$_gitname-build
make DESTDIR=$pkgdir install
# make emacs support chinese input
mv $pkgdir/usr/bin/{emacs,emacs.origin}
mv $srcdir/emacs-cn $pkgdir/usr/bin/emacs
chmod +x $pkgdir/usr/bin/emacs
# remove conflict with ctags packages
mv $pkgdir/usr/bin/{ctags,ctags.emacs}
mv $pkgdir/usr/bin/{etags,etags.emacs}
mv $pkgdir/usr/share/man/man1/{etags.1.gz,etags.emacs.1.gz}
mv $pkgdir/usr/share/man/man1/{ctags.1.gz,ctags.emacs.1.gz}
# fix user/root permissions on usr/share files
find $pkgdir/usr/share/emacs/24* -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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment