-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmksrcpackage.sh
executable file
·37 lines (34 loc) · 1.17 KB
/
mksrcpackage.sh
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
#!/bin/bash
if [ -z "$2" ]; then echo "Syntax: $0 <src-dir> <git-commit/tag>"; exit 1;fi
SDIR="$1"
#VER=`(cd "$SDIR/.git/refs/tags/" && ls -t)|head -n1|sed -e 's/.//'`
VER=$2
PKG=irc-otr-$VER.tar
HDIR=irc-otr-$VER
mkdir "$HDIR" &&\
(cd "$SDIR" && git archive --format=tar --prefix=irc-otr-$VER/ HEAD )>$PKG &&\
(cd "$HDIR" && ln -s ../irssi-headers &&\
echo -e "SET(IRSSIOTR_VERSION $VER)" >tarballdefs.cmake) &&\
tar rhf $PKG "$HDIR" &&\
rm $HDIR/{irssi-headers,tarballdefs.cmake} &&\
rmdir $HDIR &&\
gzip $PKG
PKG=irssi-otr-$VER.tar
HDIR=irssi-otr-$VER
mkdir "$HDIR" &&\
(cd "$SDIR" && git archive --format=tar --prefix=irssi-otr-$VER/ HEAD )>$PKG &&\
(cd "$HDIR" && ln -s ../irssi-headers &&\
echo -e "SET(IRSSIOTR_VERSION $VER)\nSET(BUILDFOR irssi)" >tarballdefs.cmake) &&\
tar rhf $PKG "$HDIR" &&\
rm $HDIR/{irssi-headers,tarballdefs.cmake} &&\
rmdir $HDIR &&\
gzip $PKG
PKG=xchat-otr-$VER.tar
HDIR=xchat-otr-$VER
mkdir "$HDIR" &&\
(cd "$SDIR" && git archive --format=tar --prefix=xchat-otr-$VER/ HEAD )>$PKG &&\
(cd "$HDIR" && echo -e "SET(IRSSIOTR_VERSION $VER)\nSET(BUILDFOR xchat)" >tarballdefs.cmake) &&\
tar rhf $PKG "$HDIR" &&\
rm $HDIR/tarballdefs.cmake &&\
rmdir $HDIR &&\
gzip $PKG