2 # $NetBSD: libevent2netbsd,v 1.2 2015/01/29 07:26:02 spz Exp $
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.
8 # lib/ is built as SUBDIR from lib/Makefile, and
9 # the regression tests are used from tests/lib/libevent
11 # Use the following template to import
12 # cvs import src/external/bsd/libevent/dist LIBEVENT libevent-X-Y-Z-stable
14 # don't forget to bump the shlib version in Makefile.inc and
15 # commit the include/ files
16 # XXX: Automate the man page generation
20 echo "Usage $0 <dir>" 1>&2
31 if [ -f $d/configure
]; then
35 make include
/event
2/event-config.h
37 /_EVENT_SIZEOF_SIZE_T/ {
40 #define _EVENT_SIZEOF_SIZE_T 8\
42 #define _EVENT_SIZEOF_SIZE_T 4\
46 /_EVENT_SIZEOF_LONG_LONG/ {
48 #define _EVENT_SIZEOF_LONG_LONG 8
51 /_EVENT_SIZEOF_LONG/ {
54 #define _EVENT_SIZEOF_LONG 8\
56 #define _EVENT_SIZEOF_LONG 4\
60 /_EVENT_SIZEOF_PTHREAD_T/ {
63 #define _EVENT_SIZEOF_PTHREAD_T 8\
65 #define _EVENT_SIZEOF_PTHREAD_T 4\
69 /_EVENT_SIZEOF_VOID_P/ {
72 #define _EVENT_SIZEOF_VOID_P 8\
74 #define _EVENT_SIZEOF_VOID_P 4\
77 }' < include
/event
2/event-config.h
> ..
/include
/event
2/event-config.h
82 echo "Removing RCS tags..."
85 echo "Adding RCS tags .."
86 for f
in $
(grep -RL '\$NetBSD.*\$' $d include |
grep -v CVS
); do
91 ' -e '/#include "event2\/event-config.h"/ {
93 #include <sys/cdefs.h>\
94 __RCSID("\$NetBSD\$");
95 }' < "$f" > tmp$$
&& mv tmp$$
"$f"
98 cat - ${f} > ${f}_tmp
<<- EOF
104 cat - ${f} > ${f}_tmp
<<- EOF
111 echo "No RCS tag added to ${f}"