Skip to content

Commit

Permalink
Major cleanup to make releases possible.
Browse files Browse the repository at this point in the history
This extends build.sh by a release command. tracking.el and lcs.el
were changed to elpa conformance. circe and lui now have separate
marmalade packages. Also, license for a number of packages were
changed to GPLv3 from v2.

Fixes emacs-circe#8
Fixes emacs-circe#23
  • Loading branch information
jorgenschaefer committed Oct 20, 2012
1 parent c5512d1 commit 4542a1a
Show file tree
Hide file tree
Showing 12 changed files with 895 additions and 406 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
/build
/release
340 changes: 0 additions & 340 deletions COPYING

This file was deleted.

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

155 changes: 145 additions & 10 deletions build.sh
@@ -1,22 +1,157 @@
#!/bin/sh

set -e

if [ ! -f "lisp/circe.el" ]
then
echo "Please call this from the Circe main directory" >&2
exit 1
fi

mkdir -p build
cp lisp/*.el build/
generate_autoloads () {
local PACKAGE="$1"
local DEST="$2"
local AUTOLOAD="$DEST/$PACKAGE-autoloads.el"
emacs -q --batch --eval \
"(let ((generated-autoload-file \"$AUTOLOAD\"))
(batch-update-autoloads))" \
"$DEST"
rm "$DEST"/*.el~
}

compile_elisp () {
local DEST="$1"
emacs -q --batch --eval "(add-to-list 'load-path \"$DEST\")" \
-f batch-byte-compile "$DEST"/*.el
}

elisp_version () {
sed -ne 's/^;; *Version: \([0-9.]*\).*/\1/p' "$1"
}

elisp_defvar_version () {
sed -ne 's/(defvar circe-version "\(.*\)"/\1/p' "$1"
}

generate_elpa_readme () {
local LISPFILE="$1"
local README="$2"
cat "$LISPFILE" \
| sed -e '1,/^;;;.*Commentary:.*/d' \
-e '/^;;; Code:/,$d' \
| sed -e '1d' -e '$d' \
-e 's/^;* *//' \
> "$README"
}

if [ "$1" = "release" ]
then
CIRCE_VERSION=$(elisp_version lisp/circe.el)
LUI_VERSION=$(elisp_version lisp/lui.el)
TRACKING_VERSION=$(elisp_version lisp/tracking.el)
LCS_VERSION=$(elisp_version lisp/lcs.el)

CIRCE_DEFVAR_VERSION=$(elisp_defvar_version lisp/circe.el)
if [ "$CIRCE_VERSION" != "$CIRCE_DEFVAR_VERSION" ]
then
echo "Version mismatch!"
echo "circe.el's Version: header says this is version \"$CIRCE_VERSION\""
echo "circe.el's circe-version says this is \"$CIRCE_DEFVAR_VERSION\""
echo "This should match."
exit 1
fi

AUTOLOAD="$(pwd)/build/circe-auto.el"
if ! git diff-index HEAD --quiet --
then
echo "This repository is dirty. Please clean up for a release."
exit 1
fi

emacs -q --batch --eval \
"(let ((generated-autoload-file \"$AUTOLOAD\"))
(batch-update-autoloads))" \
build/
echo "The following versions have been detected:"
echo
echo " Circe $CIRCE_VERSION"
echo " Lui $LUI_VERSION"
echo " tracking $TRACKING_VERSION"
echo " lcs $LCS_VERSION"
echo
echo -n "Tag this as v$CIRCE_VERSION? [y/n] "
read correct
if [ "$correct" != "y" ]
then
echo "Aborting"
exit 1
fi

rm build/*.el~
echo
echo -n "Running git tag v$CIRCE_VERSION ... "
git tag "v$CIRCE_VERSION"
echo "ok."

emacs -q --batch --eval "(add-to-list 'load-path \"`pwd`/build/\")" \
-f batch-byte-compile build/*.el
mkdir -p release

# Main release
echo -n "Creating circe-$CIRCE_VERSION.tar.gz ... "
DEST="$(pwd)/release/circe-$CIRCE_VERSION/"
mkdir -p "$DEST"
cp -r LICENSE README.md lisp/ "$DEST"
generate_autoloads "circe" "$DEST/lisp/" 2>/dev/null
compile_elisp "$DEST/lisp" 2>/dev/null
tar -C release/ -c "circe-$CIRCE_VERSION" \
| gzip -9 > "release/circe-$CIRCE_VERSION.tar.gz"
rm -rf "$DEST"
echo "ok."

# Circe for elpa
echo -n "Creating circe-$CIRCE_VERSION.tar for elpa ... "
DEST="$(pwd)/release/circe-$CIRCE_VERSION/"
mkdir -p "$DEST"
cp -r LICENSE lisp/* "$DEST"
generate_elpa_readme "$DEST/circe.el" "$DEST/README"
generate_autoloads "circe" "$DEST" 2>/dev/null
compile_elisp "$DEST" 2>/dev/null
tar -C release/ -c "circe-$CIRCE_VERSION" \
> "release/circe-$CIRCE_VERSION.tar"
rm -rf "$DEST"
echo "ok."

# Lui for elpa
echo -n "Creating lui-$LUI_VERSION.tar for elpa ... "
DEST="$(pwd)/release/lui-$LUI_VERSION/"
mkdir -p "$DEST"
cp -r LICENSE lisp/* "$DEST"
generate_elpa_readme "$DEST/lui.el" "$DEST/README"
generate_autoloads "lui" "$DEST" 2>/dev/null
compile_elisp "$DEST" 2>/dev/null
tar -C release/ -c "lui-$CIRCE_VERSION" \
> "release/lui-$CIRCE_VERSION.tar"
rm -rf "$DEST"
echo "ok."

# tracking for elpa
echo -n "Creating tracking.el for elpa ... "
cp lisp/tracking.el release/
echo "ok."

# lcs for elpa
echo -n "Creating lcs.el for elpa ... "
cp lisp/lcs.el release/
echo "ok."

echo
echo "All done. Now, recheck things and then do this:"
echo
echo "- Push the version tag with: git push --tags"
echo "- Upload release/circe-$CIRCE_VERSION.tar.gz to"
echo " https://github.com/jorgenschaefer/circe/downloads"
echo "- Upload the release/*.tar and release/*.el files to"
echo " http://marmalade-repo.org/"
elif [ "$1" = "build" ] || [ "$1" = "" ]
then
rm -rf build/
mkdir -p build/
cp lisp/*.el build/
generate_autoloads $(pwd)/build/
compile_elisp $(pwd)/build/
echo
echo "Compiled files can be found in build/"
fi
28 changes: 15 additions & 13 deletions lisp/circe.el
Expand Up @@ -2,37 +2,39 @@

;; Copyright (C) 2005 - 2012 Jorgen Schaefer

;; Version: 0
;; Version: 1.1
;; Keywords: IRC, chat
;; Author: Jorgen Schaefer <forcer@forcix.cx>
;; URL: https://github.com/jorgenschaefer/circe

;; This file is part of Circe.

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 2
;; of the License, or (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
;; 02110-1301 USA
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This is yet another IRC client for Emacs. It is not as small as
;; rcirc, and not as bulky as ERC.
;; Circe is a Client for IRC in Emacs. It integrates well with the rest
;; of the editor, using standard Emacs key bindings and indicating
;; activity in channels in the status bar so it stays out of your way
;; unless you want to use it.

;; It owns a lot to both clients (primarily ERC, which I used for a
;; long time, and helped to develop). Thanks to the authors of both.
;; Complexity-wise, it is somewhere between rcirc (very minimal) and ERC
;; (very complex).

;; To use, run M-x circe
;; Once installed, you should be able to simple use M-x circe to
;; connect to IRC. See the wiki on the project homepage for a more
;; elaboration configuration options.

;;; Code:

Expand Down
21 changes: 15 additions & 6 deletions lisp/lcs.el
Expand Up @@ -2,9 +2,12 @@

;; Copyright (c) 2002-2003 by Alex Shinn, All rights reserved.
;; Copyright (c) 2002-2003 by Shiro Kawai, All rights reserved.
;; Copyright (c) 2006 by Jorgen Schaefer, All rights reserved.
;; Copyright (c) 2006, 2012 by Jorgen Schaefer, All rights reserved.

;; This file is part of Circe.
;; Version: 1.0
;; Authors: Alex Shinn, Shiro Kawai
;; Maintainer: Jorgen Schaefer <forcer@forcix.cx>
;; URL: https://github.com/jorgenschaefer/circe

;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -35,10 +38,16 @@

;;; Commentary:

;; This code is more or less a literal translation of (part of)
;; Gauche's util/lcs.scm module to Emacs Lisp. It's useful to get an
;; unified diff of two lists. See `lcs-unified-diff' for a useful
;; function to be called.
;; lcs.el is a library for other Emacs Lisp programs not useful by
;; itself.

;; This library provides functions to find the Longest Common Sequence
;; (LCS) of two sequences. This is used to create a unified diff of to
;; two lists. See `lcs-unified-diff' for a useful function to be
;; called.

;; The code is more or less a literal translation of (part of)
;; Gauche's util/lcs.scm module to Emacs Lisp.

;;; Code:

Expand Down
2 changes: 1 addition & 1 deletion lisp/lui-autopaste.el
Expand Up @@ -4,7 +4,7 @@

;; Author: Jorgen Schaefer <forcer@forcix.cx>

;; This file is part of Circe.
;; This file is part of Lui.

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
Expand Down
16 changes: 8 additions & 8 deletions lisp/lui-format.el
Expand Up @@ -4,20 +4,20 @@

;; Author: Jorgen Schaefer <forcer@forcix.cx>

;; This file is part of Circe.
;; This file is part of Lui.

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

Expand Down
2 changes: 1 addition & 1 deletion lisp/lui-irc-colors.el
Expand Up @@ -4,7 +4,7 @@

;; Author: Jorgen Schaefer <forcer@forcix.cx>

;; This file is part of Circe.
;; This file is part of Lui.

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion lisp/lui-logging.el
Expand Up @@ -4,7 +4,7 @@

;; Author: Jorgen Schaefer <forcer@forcix.cx>

;; This file is part of Circe.
;; This file is part of Lui.

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
Expand Down
27 changes: 14 additions & 13 deletions lisp/lui.el
Expand Up @@ -2,31 +2,32 @@

;; Copyright (C) 2005 - 2012 Jorgen Schaefer

;; Version: 1.1
;; Author: Jorgen Schaefer <forcer@forcix.cx>
;; URL: https://github.com/jorgenschaefer/circe

;; This file is part of Circe.

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 2
;; of the License, or (at your option) any later version.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
;; 02110-1301 USA
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Lui-mode is a major mode that provides a user interface for
;; applications. The user interface is quite trivial - consisting of
;; an input line, a prompt, and some output area - but Lui includes a
;; lot of options, like time stamps, filling, etc.
;; Lui is a library for other Emacs Lisp programs and not useful by
;; itself.

;; This major mode provides a user interface for applications. The
;; user interface is quite simple, consisting of an input line, a
;; prompt, and some output area, but Lui includes a lot of common
;; options, such as time stamps, filling, colorization, etc.

;; Application programs should create modes derived from lui-mode.

Expand Down

0 comments on commit 4542a1a

Please sign in to comment.