slackbuilds/e/UNUSED/org-mode/org-mode.SlackBuild
Gwenhael Le Moine 97cfa62adc all these emacs packages can now be found in ELPA or Marmalade
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2012-01-24 15:03:14 +01:00

119 lines
3.5 KiB
Bash
Executable file

#!/bin/sh -x
# variables
BRANCH=master
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
ARCH=${ARCH:-$(uname -m)}
BUILD=${BUILD:-1}
TAG=cyco
TMP=/tmp/$TAG
OUTPUT=/tmp
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
PREFIX=/usr
EMACS=$(basename $(ls /usr/bin/emacs-2*))
EMACS_VERSION=$(echo "$EMACS" | grep -o "[0-9\.]*")
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
if [ ! -e $REPOSITORY ] ; then
git clone http://repo.or.cz/r/org-mode.git $REPOSITORY
else
( cd $REPOSITORY
git pull
)
fi
cp -R $REPOSITORY $TMP/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
sed -i "s|EMACS=emacs|EMACS=$EMACS|" Makefile
sed -i "s|prefix=/usr/local|prefix=$PREFIX|" Makefile
sed -i 's|infodir = $(prefix)/share/info|infodir = $(prefix)/info|' Makefile
make
# installation
sed -i "s|prefix=$PREFIX|prefix=$PKG$PREFIX|" Makefile
# May we have your ATTENTION please:
# next line Emacs' bundled org-mode TO BE REPLACED !!
#sed -i "s|lispdir = \$(prefix)/share/emacs/site-lisp|lispdir = \$(prefix)/share/emacs/$EMACS_VERSION/lisp/org|" Makefile
# you can now resume your normal existence, cảm ơn lắm.
make install
make install-info
rm $PKG$PREFIX/info/dir
# # install contrib
# cp -R contrib/lisp $PKG$PREFIX/share/emacs/site-lisp/org-mode-contrib
# # install org-babel
# cp -R contrib/babel/lisp $PKG$PREFIX/share/emacs/site-lisp/org-mode-contrib/babel
# ( cd $PKG$PREFIX/share/emacs/site-lisp/org-mode-contrib
# emacs -batch -f batch-byte-compile-file *.el
# )
# ( cd $PKG$PREFIX/share/emacs/site-lisp/org-mode-contrib/babel
# emacs -batch -f batch-byte-compile-file *.el
# )
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp -R contrib $PKG$PREFIX/doc/$PRGNAM
# correction
cd $PKG
chown -R root:root *
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
[ -d $PKG/usr/info ] && find $PKG/usr/info -type f -name "*" -exec gzip -9f {} \;
# [ -d $PKG$PREFIX/share/emacs/$EMACS_VERSION/lisp/org ] && \
# find $PKG$PREFIX/share/emacs/$EMACS_VERSION/lisp/org -type f -name "*.el" -exec gzip -9f {} \;
# [ -d $PKG$PREFIX/share/emacs/site-lisp ] && \
# find $PKG$PREFIX/share/emacs/site-lisp -type f -name "*.el" -exec gzip -9f {} \;
# gunzip $PKG/usr/info/dir.gz
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/doinst.sh
cd /usr/info
[ -e dir ] && rm dir
[ -e dir.gz ] && rm dir.gz
[ -e dir.new ] && rm dir.new
for file in \$(ls *.gz | grep -v ".*\-[0-9]\+\.gz")
do
install-info \$file ./dir
done
EOF
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (an Emacs Mode for Notes, Project Planning, and Authoring)
$PRGNAM:
$PRGNAM: Org-mode is for keeping notes, maintaining ToDo lists, doing project
$PRGNAM: planning, and authoring with a fast and effective plain-text system.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://orgmode.org/
EOF
# empaquetage
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz