Which dependencies to install for Debian (probably incomplete)
[notion/jeffpc.git] / predist.sh
blob22fed5425b2901b46f839423999705e70cd54de8
1 #!/bin/sh
3 # Prepare a Notion release.
5 # Run this script in a freshly checked out notion directory: never commit the
6 # changes made by this script (but perhaps tag them).
8 # Usage:
10 # ~/dev/releases/notion$ ./predist.sh -snapshot
11 # or
12 # ~/dev/releases/notion-3-20110219$ ./predist.sh
14 if test "$NOTION_REPOS" = ""; then
15 NOTION_REPOS=git://notion.git.sourceforge.net/gitroot/notion
18 do_git_export() {
19 url="$1"
20 project="$2"
22 set -e
24 ! test -f "${project}" || { echo "${project} exists"; exit 1; }
26 git clone "${url}" "${project}"
27 cd "${project}" ; git log > exact-version ; cd ..
28 rm -rf "${project}/.git"
32 ## Versioning
35 pwd=`pwd`
36 dir=`basename "$pwd"`
38 if test "$1" != "-snapshot"; then
39 release=`echo "$dir"|sed 's/^[^-]\+-\([^-]\+-[0-9]\+\(-[0-9]\+\)\?\)$/\1/p; d'`
41 if test "$release" = ""; then
42 echo "Invalid package name $dir. Use the '-snapshot' option to create a snapshot package"
43 exit 1
44 else
45 versdef="#define NOTION_RELEASE \"${release}\""
46 perl -p -i -e "s/^#define NOTION_RELEASE.*/$versdef/" version.h
47 #perl -p -i -e "s/NOTION_RELEASE/$release/" build/ac/configure.ac
49 else
50 release=snapshot-`date +"%Y%m%d"`
51 cd .. ; mv $dir "$dir-$release" ; cd "$dir-$release"
52 dir="$dir-$release"
57 ## Libs
60 getlib() {
61 do_git_export $1 $2
62 rm $2/build/rules.mk $2/system.mk
63 #ln -s ../../build/rules.mk $2/build/rules.mk
64 cat > $2/build/system-inc.mk << EOF
65 TOPDIR := \$(TOPDIR)/..
66 include \$(TOPDIR)/build/system-inc.mk
67 EOF
72 ## Modules
75 getmod() {
76 do_git_export $1 $2
77 sed -i -e "s/TOPDIR=..\/notion/TOPDIR=..\//" $2/Makefile
80 getlib $NOTION_REPOS/libtu libtu
81 getlib $NOTION_REPOS/libextl libextl
82 getmod $NOTION_REPOS/mod_xinerama mod_xinerama
83 getmod $NOTION_REPOS/mod_xrandr mod_xrandr
84 getmod $NOTION_REPOS/mod_xkbevents mod_xkbevents
85 do_git_export $NOTION_REPOS/contrib contrib
88 ## Makefiles
91 mkdist() {
92 perl -n -i -e 'if(s/^#DIST: (.*)/$1/){ print; <>; } else { print; }' "$@"
95 mkdist Makefile system.mk
96 sed -i -e "s/de/de mod_xinerama mod_xrandr mod_xkbevents/" modulelist.mk
97 echo "
98 ifeq (\$(PRELOAD_MODULES),1)
99 X11_LIBS += -lXinerama -lXrandr
100 endif
101 " >> system.mk
104 ## Scripts
107 rm predist.sh
108 chmod a+x install-sh
110 cd ..
111 echo Creating notion-${release}.tar.gz
112 tar --exclude-vcs -czf notion-${release}-src.tar.gz $dir
113 echo Creating notion-${release}.tar.bz2
114 tar --exclude-vcs -cjf notion-${release}-src.tar.bz2 $dir