etc/services - sync with NetBSD-8
[minix.git] / external / bsd / libevent / libevent2netbsd
blob2551618cb4e0caf69370663ee2d3deac1b20914d
1 #!/bin/sh
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
18 if [ -z "$1" ]
19 then
20 echo "Usage $0 <dir>" 1>&2
21 exit 1
24 case $1 in
25 /*)
26 d=$1;;
28 d=$(pwd)/$1;;
29 esac
31 if [ -f $d/configure ]; then
32 mkdir -p tmp
33 cd tmp
34 $d/configure
35 make include/event2/event-config.h
36 sed -e '
37 /_EVENT_SIZEOF_SIZE_T/ {
39 #ifdef _LP64\
40 #define _EVENT_SIZEOF_SIZE_T 8\
41 #else\
42 #define _EVENT_SIZEOF_SIZE_T 4\
43 #endif
46 /_EVENT_SIZEOF_LONG_LONG/ {
48 #define _EVENT_SIZEOF_LONG_LONG 8
51 /_EVENT_SIZEOF_LONG/ {
53 #ifdef _LP64\
54 #define _EVENT_SIZEOF_LONG 8\
55 #else\
56 #define _EVENT_SIZEOF_LONG 4\
57 #endif
60 /_EVENT_SIZEOF_PTHREAD_T/ {
62 #ifdef _LP64\
63 #define _EVENT_SIZEOF_PTHREAD_T 8\
64 #else\
65 #define _EVENT_SIZEOF_PTHREAD_T 4\
66 #endif
69 /_EVENT_SIZEOF_VOID_P/ {
71 #ifdef _LP64\
72 #define _EVENT_SIZEOF_VOID_P 8\
73 #else\
74 #define _EVENT_SIZEOF_VOID_P 4\
75 #endif
77 }' < include/event2/event-config.h > ../include/event2/event-config.h
78 cd ..
79 rm -Rf tmp
82 echo "Removing RCS tags..."
83 cleantags $d
85 echo "Adding RCS tags .."
86 for f in $(grep -RL '\$NetBSD.*\$' $d include | grep -v CVS); do
87 case $f in
88 *.c)
89 sed -e '1i\
90 /* \$NetBSD\$ */
91 ' -e '/#include "event2\/event-config.h"/ {
93 #include <sys/cdefs.h>\
94 __RCSID("\$NetBSD\$");
95 }' < "$f" > tmp$$ && mv tmp$$ "$f"
97 *.h)
98 cat - ${f} > ${f}_tmp <<- EOF
99 /* \$NetBSD\$ */
101 mv ${f}_tmp ${f}
103 *.[0-9])
104 cat - ${f} > ${f}_tmp <<- EOF
105 .\" \$NetBSD\$
108 mv ${f}_tmp ${f}
111 echo "No RCS tag added to ${f}"
113 esac
114 done