-
Notifications
You must be signed in to change notification settings - Fork 18
/
nsd
executable file
·97 lines (91 loc) · 3.1 KB
/
nsd
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh -x
# scripts for the maintainer (whose initials are 'nsd')
case $1 in
configure)
# rebuild configure and *.in after changing configure.ac
aclocal && autoheader && automake --add-missing && autoconf && ./configure --enable-debug
exit $?
;;
prep)
# configure and make distclean
if $0 configure; then
make clean
if ! make check; then
exit 1
fi
make distclean
rm -rf autom4te.cache
else
exit 1
fi
;;
recompile)
# upload and recompile on each of the sourceforge compile farm servers
TGZ=pwsafe.tgz
if [ -z "$SF_USER" ]; then
SF_USER=`echo $USER|tr -d -`
fi
tar czvf /tmp/$TGZ --exclude '*.o' --exclude pwsafe .
scp /tmp/$TGZ [email protected]:$TGZ
rm /tmp/$TGZ
# some hosts need custom stuff passed in to ./configure and their environment
amd64_linux1_conf="--without-x"
ppc_osx1_conf="--without-readline --with-openssl-dir=/sw"
ppc_osx2_conf="--without-readline"
sparc_solaris1_conf="--without-readline --with-openssl-dir=/usr/local/ssl"
sparc_solaris1_env="LD_LIBRARY_PATH=/usr/local/ssl/lib PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin"
x86_freebsd1_make=gmake
x86_netbsd1_conf="--without-readline --without-x"
x86_netbsd1_make=gmake
x86_openbsd1_make=gmake
x86_solaris1_conf="--with-openssl-dir=/usr/local/ssl"
x86_solaris1_env="LD_LIBRARY_PATH=/usr/local/ssl/lib PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin"
SF_HOSTS="alpha-linux1 amd64-linux1 ppc-osx1 ppc-osx2 sparc-solaris1 x86-freebsd1 x86-linux1 x86-linux2 x86-netbsd1 x86-openbsd1 x86-solaris1"
[ -z "$2" ] || SF_HOSTS="$2"
for host in $SF_HOSTS; do
echo "==== $host ========================================================================="
RSH="ssh [email protected] ssh $host"
DIR=$host
CONF="`echo $host|tr -- - _`_conf"
ENV="`echo $host|tr -- - _`_env"
MAKE="`echo $host|tr -- - _`_make"
if $RSH "rm -rf $DIR \; \
mkdir -p $DIR \; \
gunzip <$TGZ | tar xvf - -C $DIR" ; then
if $RSH "cd $DIR \; ${!ENV-} ./configure ${!CONF-}"; then
$RSH "cd $DIR \; ${!ENV-} ${!MAKE-make} check"
fi
fi
done
;;
compile)
# prep & recompile combined
if $0 prep; then
$0 recompile
exit $?
else
exit 1
fi
;;
release)
# tar up a release
VER=`awk <configure.ac '/^AC_INIT/ { print $2 }' | tr -d '[])'`
TGZ=pwsafe-$VER.tar.gz
DIR=pwsafe-$VER
rm -rf $DIR
( git clone . $DIR )
if ( cd $DIR; ./nsd prep; ); then
tar czvf $TGZ --exclude-vcs $DIR
# and build from the tarball while making the archival copy of pwsafe-$VER
mkdir $DIR/testbuild && \
tar xzvf $TGZ -C $DIR/testbuild && \
( cd $DIR/testbuild/$DIR && ./configure --program-suffix=$VER && make V=0 CXXFLAGS="-Wall -Werror" && strip pwsafe && ln pwsafe pwsafe-$VER; )
exit $?
else
exit 1
fi
;;
*)
echo "Usage $0 (configure|prep|compile|recompile [hosts]|release)"
exit 1
esac