11077SjjgSUMMARY="Perl5 Compatible Regular Expressions"
21077SjjgDESCRIPTION="The PCRE library is a set of functions that implement regular \
31077Sjjgexpression pattern matching using the same syntax and semantics as Perl 5. \
41077SjjgPCRE has its own native API, as well as a set of wrapper functions that \
51077Sjjgcorrespond to the POSIX regular expression API. The PCRE library is free, even \
61077Sjjgfor building proprietary software.
71077SjjgThis package contains the native API."
81077SjjgCOPYRIGHT="1997-2017 University of Cambridge
91077Sjjg	2007-2012, Google Inc. All rights reserved."
101077SjjgHOMEPAGE="http://www.pcre.org/"
111077SjjgLICENSE="PCRE"
121077SjjgREVISION="1"
131077SjjgSOURCE_URI="https://downloads.sf.net/pcre/pcre-$portVersion.tar.bz2"
141077SjjgCHECKSUM_SHA256="e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530"
151077SjjgSOURCE_DIR="pcre-$portVersion"
161077Sjjg
171077SjjgARCHITECTURES="all"
181077SjjgSECONDARY_ARCHITECTURES="x86_gcc2 x86"
191077Sjjg
201077SjjgPROVIDES="
211077Sjjg	libpcre$secondaryArchSuffix = $portVersion
221077Sjjg	lib:libpcre$secondaryArchSuffix = 1.2.9 compat >= 1
231077Sjjg	lib:libpcrecpp$secondaryArchSuffix = 0.0.1 compat >= 0
241077Sjjg	lib:libpcreposix$secondaryArchSuffix = 0.0.5 compat >= 0
251077Sjjg	"
261077Sjjgif [ -z "$secondaryArchSuffix" ];then
271077Sjjg	PROVIDES="$PROVIDES
281077Sjjg		cmd:pcregrep = $portVersion compat >= 8
291077Sjjg		cmd:pcretest = $portVersion compat >= 8
301077Sjjg		"
311077Sjjgfi
321077Sjjg
331077SjjgREQUIRES="
341077Sjjg	haiku$secondaryArchSuffix
351077Sjjg	"
361077Sjjg
371077SjjgPROVIDES_devel="
381077Sjjg	libpcre${secondaryArchSuffix}_devel = $portVersion
391077Sjjg	cmd:pcre_config$secondaryArchSuffix = $portVersion compat >= 8
401077Sjjg	devel:libpcre$secondaryArchSuffix = 1.2.9 compat >= 1
411077Sjjg	devel:libpcrecpp$secondaryArchSuffix = 0.0.1 compat >= 0
421077Sjjg	devel:libpcreposix$secondaryArchSuffix = 0.0.5 compat >= 0
431077Sjjg	"
44REQUIRES_devel="
45	libpcre$secondaryArchSuffix == $portVersion base
46	"
47
48BUILD_REQUIRES="
49	haiku${secondaryArchSuffix}_devel
50	"
51BUILD_PREREQUIRES="
52	cmd:aclocal
53	cmd:autoconf
54	cmd:automake
55	cmd:gcc$secondaryArchSuffix
56	cmd:make
57	cmd:ld$secondaryArchSuffix
58	cmd:libtoolize$secondaryArchSuffix
59	"
60
61BUILD()
62{
63	libtoolize --force --copy --install
64	aclocal
65	autoconf
66	automake --add-missing
67	runConfigure ./configure \
68		--enable-utf8 \
69		--enable-unicode-properties \
70		--with-pic
71	make $jobArgs
72}
73
74INSTALL()
75{
76	make install
77
78	rm $libDir/libpcre*.la
79
80	# prepare develop/lib
81	prepareInstalledDevelLibs libpcre libpcrecpp libpcreposix
82	fixPkgconfig
83
84	# fix pcre-config
85	fixDevelopLibDirReferences $binDir/pcre-config
86
87	if [ -n "$secondaryArchSuffix" ]; then
88		maybe_manDir_man1_pcre_config=
89		maybe_manDir_man3=
90	 	rm -rf $documentationDir
91	else
92		maybe_manDir_man1_pcre_config=$manDir/man1/pcre-config.1
93		maybe_manDir_man3=$manDir/man3
94	fi
95
96	# devel package
97	packageEntries devel \
98		$binDir/pcre-config \
99		$developDir \
100		$maybe_manDir_man1_pcre_config \
101		$maybe_manDir_man3
102
103	if [ -n "$secondaryArchSuffix" ]; then
104	 	rm -rf $binDir
105	fi
106}
107
108TEST()
109{
110	make check
111}
112