2013-10-28 22:50:05 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2014-02-05 20:40:34 +01:00
|
|
|
cat <<EOF > clean.sh
|
|
|
|
|
#!/bin/sh
|
2013-10-28 22:50:05 +01:00
|
|
|
find . -name Makefile -exec rm {} \;
|
|
|
|
|
find . -name Makefile.in -exec rm {} \;
|
|
|
|
|
find . -name "*~" -exec rm {} \;
|
|
|
|
|
find . -name config.h -exec rm {} \;
|
2013-12-02 22:54:57 +01:00
|
|
|
find . -name "stamp*" -exec rm {} \;
|
2013-10-28 22:50:05 +01:00
|
|
|
find . -name .deps -exec rm -rf {} \;
|
|
|
|
|
find . -name .libs -exec rm -rf {} \;
|
|
|
|
|
find . -name .o -exec rm -rf {} \;
|
|
|
|
|
find . -name .lo -exec rm -rf {} \;
|
|
|
|
|
|
2014-02-05 20:40:34 +01:00
|
|
|
rm -rf aclocal.m4 libtool man/pcp1.1 configure config.* config autom4te.cache tests/test* tests/v* tests/stresstest/* libpcp/libpcp1.pc
|
|
|
|
|
rm clean.sh
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
chmod 700 clean.sh
|
2013-10-28 22:50:05 +01:00
|
|
|
|
|
|
|
|
# generate the install include file
|
|
|
|
|
(echo "#ifndef _HAVE_PCP"; echo "#define _HAVE_PCP"; echo) > include/pcp.h
|
|
|
|
|
(echo "#ifdef __cplusplus"; echo "extern \"C\" {"; echo "#endif"; echo) >> include/pcp.h
|
2014-02-09 17:49:33 +01:00
|
|
|
echo "#include \"pcp/config.h\"" >> include/pcp.h
|
2013-10-28 22:50:05 +01:00
|
|
|
|
2013-11-07 08:10:31 +01:00
|
|
|
ls include/pcp/*.h | sed 's#include/##' | while read include; do
|
|
|
|
|
echo "#include \"$include\"" >> include/pcp.h
|
2013-10-28 22:50:05 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
(echo "#ifdef __cplusplus"; echo "}"; echo "#endif"; echo) >> include/pcp.h
|
|
|
|
|
(echo; echo "#endif") >> include/pcp.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# generate the version file
|
2013-11-07 08:10:31 +01:00
|
|
|
maj=`egrep "#define PCP_VERSION_MAJOR" include/pcp/version.h | awk '{print $3}'`
|
|
|
|
|
min=`egrep "#define PCP_VERSION_MINOR" include/pcp/version.h | awk '{print $3}'`
|
|
|
|
|
pat=`egrep "#define PCP_VERSION_PATCH" include/pcp/version.h | awk '{print $3}'`
|
2013-11-12 09:05:55 +01:00
|
|
|
echo -n "$maj.$min.$pat" > VERSION
|
2013-10-28 22:50:05 +01:00
|
|
|
|
|
|
|
|
# generate the manpage
|
|
|
|
|
echo "=head1 NAME
|
|
|
|
|
|
|
|
|
|
Pretty Curved Privacy - File encryption using eliptic curve cryptography.
|
|
|
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
|
|
" > man/pcp1.pod
|
|
|
|
|
cat src/usage.txt | sed "s/^/ /g" >> man/pcp1.pod
|
2014-01-30 20:55:23 +01:00
|
|
|
cat man/options.pod >> man/pcp1.pod
|
2013-10-28 22:50:05 +01:00
|
|
|
cat man/pcp.pod >> man/pcp1.pod
|
|
|
|
|
cat man/details.pod >> man/pcp1.pod
|
|
|
|
|
cat man/footer.pod >> man/pcp1.pod
|
|
|
|
|
|
|
|
|
|
pod2man -r "PCP `cat VERSION`" -c "USER CONTRIBUTED DOCUMENTATION" man/pcp1.pod > man/pcp1.1
|
|
|
|
|
|
|
|
|
|
# generate the top level readme
|
|
|
|
|
cat man/pcp.pod man/install.pod man/footer.pod > README.pod
|
|
|
|
|
pod2text README.pod > README.txt
|
|
|
|
|
|
|
|
|
|
# generate usage.h
|
|
|
|
|
(cd src && ./usage.sh)
|
|
|
|
|
|
|
|
|
|
clean=$1
|
|
|
|
|
|
|
|
|
|
touch README
|
|
|
|
|
|
|
|
|
|
if test -z "$clean"; then
|
|
|
|
|
mkdir -p ./config
|
|
|
|
|
|
|
|
|
|
if ! command -v libtool >/dev/null 2>&1; then
|
|
|
|
|
echo "could not find libtool." 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! command -v autoreconf >/dev/null 2>&1; then
|
|
|
|
|
echo "could not find autoreconf." 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
autoreconf --install --force --verbose -I config
|
|
|
|
|
fi
|
|
|
|
|
|
2013-11-12 09:05:55 +01:00
|
|
|
rm -rf README include/pcp/config.h.in~ libpcp/stamp-h1 autom4te.cache
|
2013-11-17 16:53:20 +01:00
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
touch Makefile.in configure */Makefile.in
|