1#!/bin/sh
2# $NetBSD: prepare-import.sh,v 1.2 2010/12/03 21:38:49 plunky Exp $
3
4# Extract the new tarball and rename the libevent-X.Y.Z directory
5# to dist.  Run this script and check for additional files and
6# directories to prune, only relevant content is included.
7#
8# lib/ is built as SUBDIR from lib/Makefile, and
9# the regression tests are used from tests/lib/libevent
10#
11# Use the following template to import
12#  cvs import src/external/bsd/file/dist LIBEVENT libevent-X-Y-Z-stable
13#
14# don't forget to bump the lib/shlib_version and commit the include/ files
15#
16
17set -e
18
19if [ -f dist/configure ]; then
20    mkdir -p tmp
21    cd tmp
22    ../dist/configure
23    make event-config.h
24    mv config.h ../include		# not needed for 2.*
25    mv event-config.h ../include
26    cd ..
27    rm -Rf tmp
28
29    echo "Removing unwanted distfiles .."
30    cd dist
31    rm -Rf Doxyfile Makefile.am Makefile.in WIN32-Code WIN32-Prj \
32	aclocal.m4 autogen.sh compat config.guess config.h.in config.sub \
33	configure configure.in devpoll.c epoll.c epoll_sub.c event_rpcgen.py \
34	evport.c install-sh ltmain.sh missing mkinstalldirs sample \
35	strlcpy.c test/Makefile.am test/Makefile.in test/bench.c \
36	test/regress.rpc test/test-eof.c test/test-init.c test/test-time.c \
37	test/test-weof.c test/test.sh
38    cd ..
39fi
40
41echo "Adding RCS tags .."
42for f in $(grep -RL '\$NetBSD.*\$' dist include | grep -v CVS); do
43    case $f in
44    *.[ch])
45	cat - ${f} > ${f}_tmp <<- EOF
46		/*	\$NetBSD\$	*/
47	EOF
48	mv ${f}_tmp ${f}
49	;;
50    *.[0-9])
51	cat - ${f} > ${f}_tmp <<- EOF
52		.\"	\$NetBSD\$
53		.\"
54	EOF
55	mv ${f}_tmp ${f}
56	;;
57    *)
58	echo "No RCS tag added to ${f}"
59	;;
60    esac
61done
62
63echo "prepare-import done"
64