diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-05 14:52:56 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-05 14:52:56 -0800 |
commit | e985601ac098ad3e1353fcea02d844d746032e46 (patch) | |
tree | 2bd338658dfb703354075508f47ad82c7944fdda | |
parent | e966d00b1c9e342a903cadf1cfba8a15f82c98ed (diff) | |
download | pcre-e985601ac098ad3e1353fcea02d844d746032e46.tar.gz pcre-e985601ac098ad3e1353fcea02d844d746032e46.tar.bz2 pcre-e985601ac098ad3e1353fcea02d844d746032e46.zip |
add packaging
-rw-r--r-- | packaging/baselibs.conf | 5 | ||||
-rw-r--r-- | packaging/pcre-visibility.patch | 192 | ||||
-rw-r--r-- | packaging/pcre.spec | 183 |
3 files changed, 380 insertions, 0 deletions
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf new file mode 100644 index 0000000..2a0be41 --- /dev/null +++ b/packaging/baselibs.conf @@ -0,0 +1,5 @@ +libpcre1 +libpcreposix0 +libpcrecpp0 + provides "pcre-<targettype> = <version>" + obsoletes "pcre-<targettype> <= <version>" diff --git a/packaging/pcre-visibility.patch b/packaging/pcre-visibility.patch new file mode 100644 index 0000000..9130337 --- /dev/null +++ b/packaging/pcre-visibility.patch @@ -0,0 +1,192 @@ +Index: configure.ac +=================================================================== +--- configure.ac.orig ++++ configure.ac +@@ -45,8 +45,12 @@ AC_CONFIG_MACRO_DIR([m4]) + remember_set_CFLAGS="$CFLAGS" + remember_set_CXXFLAGS="$CXXFLAGS" + +-AC_PROG_CC ++AC_PROG_CC_STDC ++AC_USE_SYSTEM_EXTENSIONS ++AC_SYS_LARGEFILE ++AM_PROG_CC_C_O + AC_PROG_CXX ++PCRE_VISIBILITY + + if test "x$remember_set_CFLAGS" = "x" + then +@@ -80,8 +84,7 @@ AC_LANG_POP + AC_TYPE_INT64_T + + AC_PROG_INSTALL +-AC_LIBTOOL_WIN32_DLL +-LT_INIT ++LT_INIT([win32-dll pic-only disable-static]) + AC_PROG_LN_S + + PCRE_MAJOR="pcre_major" +Index: m4/visibility.m4 +=================================================================== +--- /dev/null ++++ m4/visibility.m4 +@@ -0,0 +1,89 @@ ++# visibility.m4 serial 4 (gettext-0.18.2) ++dnl Copyright (C) 2005, 2008, 2010-2011 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++dnl From Bruno Haible. ++ ++dnl Tests whether the compiler supports the command-line option ++dnl -fvisibility=hidden and the function and variable attributes ++dnl __attribute__((__visibility__("hidden"))) and ++dnl __attribute__((__visibility__("default"))). ++dnl Does *not* test for __visibility__("protected") - which has tricky ++dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on ++dnl MacOS X. ++dnl Does *not* test for __visibility__("internal") - which has processor ++dnl dependent semantics. ++dnl Does *not* test for #pragma GCC visibility push(hidden) - which is ++dnl "really only recommended for legacy code". ++dnl Set the variable CFLAG_VISIBILITY. ++dnl Defines and sets the variable HAVE_VISIBILITY. ++ ++dnl Modified to fit with PCRE build environment by Cristian RodrÃguez. ++ ++AC_DEFUN([PCRE_VISIBILITY], ++[ ++ AC_REQUIRE([AC_PROG_CC]) ++ CFLAG_VISIBILITY= ++ CXXFLAG_INLINES_HIDDEN= ++ HAVE_VISIBILITY=0 ++ if test -n "$GCC"; then ++ dnl First, check whether -Werror can be added to the command line, or ++ dnl whether it leads to an error because of some other option that the ++ dnl user has put into $CC $CFLAGS $CPPFLAGS. ++ AC_MSG_CHECKING([whether the -Werror option is usable]) ++ AC_CACHE_VAL([gl_cv_cc_vis_werror], [ ++ gl_save_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -Werror" ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([[]], [[]])], ++ [gl_cv_cc_vis_werror=yes], ++ [gl_cv_cc_vis_werror=no]) ++ CFLAGS="$gl_save_CFLAGS"]) ++ AC_MSG_RESULT([$gl_cv_cc_vis_werror]) ++ dnl Now check whether visibility declarations are supported. ++ AC_MSG_CHECKING([for simple visibility declarations]) ++ AC_CACHE_VAL([gl_cv_cc_visibility], [ ++ gl_save_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -fvisibility=hidden" ++ dnl We use the option -Werror and a function dummyfunc, because on some ++ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning ++ dnl "visibility attribute not supported in this configuration; ignored" ++ dnl at the first function definition in every compilation unit, and we ++ dnl don't want to use the option in this case. ++ if test $gl_cv_cc_vis_werror = yes; then ++ CFLAGS="$CFLAGS -Werror" ++ fi ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar; ++ extern __attribute__((__visibility__("default"))) int exportedvar; ++ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); ++ extern __attribute__((__visibility__("default"))) int exportedfunc (void); ++ void dummyfunc (void) {} ++ ]], ++ [[]])], ++ [gl_cv_cc_visibility=yes], ++ [gl_cv_cc_visibility=no]) ++ CFLAGS="$gl_save_CFLAGS"]) ++ AC_MSG_RESULT([$gl_cv_cc_visibility]) ++ if test $gl_cv_cc_visibility = yes; then ++ CFLAG_VISIBILITY="-fvisibility=hidden" ++ CXXFLAG_INLINES_HIDDEN="-fvisibility-inlines-hidden" ++ HAVE_VISIBILITY=1 ++ AC_DEFINE(PCRE_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRE_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRE_EXP_DATA_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCREPOSIX_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCREPOSIX_EXP_DEFN, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRECPP_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ AC_DEFINE(PCRECPP_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) ++ fi ++ fi ++ AC_SUBST([CFLAG_VISIBILITY]) ++ AC_SUBST([CXXFLAG_INLINES_HIDDEN]) ++ AC_SUBST([HAVE_VISIBILITY]) ++ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], ++ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) ++]) +Index: Makefile.am +=================================================================== +--- Makefile.am.orig ++++ Makefile.am +@@ -179,6 +179,9 @@ BUILT_SOURCES = pcre_chartables.c + # Build the 8 bit library if it is enabled. + if WITH_PCRE8 + lib_LTLIBRARIES += libpcre.la ++ ++libpcre_la_CFLAGS = $(CFLAG_VISIBILITY) ++ + libpcre_la_SOURCES = \ + pcre_byte_order.c \ + pcre_compile.c \ +@@ -212,6 +215,7 @@ endif # WITH_PCRE8 + # Build the 16 bit library if it is enabled. + if WITH_PCRE16 + lib_LTLIBRARIES += libpcre16.la ++libpcre16_la_CFLAGS = $(CFLAG_VISIBILITY) + libpcre16_la_SOURCES = \ + pcre16_byte_order.c \ + pcre16_chartables.c \ +@@ -267,10 +271,10 @@ EXTRA_DIST += \ + sljit/sljitUtils.c + + if WITH_PCRE8 +-libpcre_la_LDFLAGS = $(EXTRA_LIBPCRE_LDFLAGS) ++libpcre_la_LDFLAGS = -no-undefined $(EXTRA_LIBPCRE_LDFLAGS) + endif # WITH_PCRE8 + if WITH_PCRE16 +-libpcre16_la_LDFLAGS = $(EXTRA_LIBPCRE16_LDFLAGS) ++libpcre16_la_LDFLAGS = -no-undefined $(EXTRA_LIBPCRE16_LDFLAGS) + endif # WITH_PCRE16 + + CLEANFILES += pcre_chartables.c +@@ -292,9 +296,10 @@ endif # WITH_JIT + ## A version of the main pcre library that has a posix re API. + if WITH_PCRE8 + lib_LTLIBRARIES += libpcreposix.la ++libpcreposix_la_CFLAGS = $(CFLAG_VISIBILITY) + libpcreposix_la_SOURCES = \ + pcreposix.c +-libpcreposix_la_LDFLAGS = $(EXTRA_LIBPCREPOSIX_LDFLAGS) ++libpcreposix_la_LDFLAGS = -no-undefined $(EXTRA_LIBPCREPOSIX_LDFLAGS) + libpcreposix_la_LIBADD = libpcre.la + endif # WITH_PCRE8 + +@@ -302,12 +307,13 @@ endif # WITH_PCRE8 + if WITH_PCRE_CPP + + lib_LTLIBRARIES += libpcrecpp.la ++libpcrecpp_la_CXXFLAGS = $(CFLAG_VISIBILITY) + libpcrecpp_la_SOURCES = \ + pcrecpp_internal.h \ + pcrecpp.cc \ + pcre_scanner.cc \ + pcre_stringpiece.cc +-libpcrecpp_la_LDFLAGS = $(EXTRA_LIBPCRECPP_LDFLAGS) ++libpcrecpp_la_LDFLAGS = -no-undefined $(EXTRA_LIBPCRECPP_LDFLAGS) + libpcrecpp_la_LIBADD = libpcre.la + + TESTS += pcrecpp_unittest +@@ -351,6 +357,7 @@ if WITH_PCRE8 + TESTS += RunGrepTest + dist_noinst_SCRIPTS += RunGrepTest + bin_PROGRAMS += pcregrep ++pcregrep_CFLAGS = -fwhole-program + pcregrep_SOURCES = pcregrep.c + pcregrep_LDADD = $(LIBZ) $(LIBBZ2) + pcregrep_LDADD += libpcre.la libpcreposix.la diff --git a/packaging/pcre.spec b/packaging/pcre.spec new file mode 100644 index 0000000..baa6eb1 --- /dev/null +++ b/packaging/pcre.spec @@ -0,0 +1,183 @@ +Name: pcre +Version: 8.31 +Release: 0 +License: BSD-3-Clause +Summary: A library for Perl-compatible regular expressions +# +Url: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ +Group: System/Libraries +Source: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2 +Source2: baselibs.conf +Patch0: pcre-visibility.patch +BuildRequires: gcc-c++ +BuildRequires: libtool +BuildRequires: pkg-config + +%description +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%package devel +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries +Requires: libpcre = %{version} +Requires: libpcrecpp = %{version} +Requires: libpcreposix = %{version} +Requires: libstdc++-devel + +%description devel +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%package devel-static +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries +Requires: pcre-devel = %{version} + +%description devel-static +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. +This package contains static versions of the PCRE libraries. + +%package -n libpcre +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries +Provides: %{name} = %{version} +Obsoletes: %{name} < %{version} + +%description -n libpcre +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%package -n libpcreposix +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries + +%description -n libpcreposix +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%package -n libpcrecpp +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries + +%description -n libpcrecpp +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%package doc +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries +%if 0%{?suse_version} >= 1120 +BuildArch: noarch +%endif + +%description doc +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%package tools +Summary: A library for Perl-compatible regular expressions +Group: System/Libraries + +%description tools +The PCRE library is a set of functions that implement regular +expression pattern matching using the same syntax and semantics +as Perl 5. + +%prep +%setup -q +%patch0 + +%build +# Available JIT archs see sljit/sljitConfig.h +autoreconf -fiv +%configure \ +%ifarch %ix86 x86_64 %arm ppc ppc64 mips + --enable-jit \ +%endif + --enable-static \ + --with-link-size=2 \ + --with-match-limit=10000000 \ + --enable-newline-is-lf \ + --enable-utf8 \ + --enable-unicode-properties +make %{?_smp_mflags} + + +%check +export LANG=POSIX +%ifarch %arm +make test || echo make test failed +%else +make test +%endif + +%install +%make_install +mkdir -p %{buildroot}/%{_defaultdocdir} +mv %{buildroot}/usr/share/doc/pcre %{buildroot}/%{_defaultdocdir}/pcre-doc +#empty dependecy_libs +rm -f %{buildroot}%{_libdir}/*.la + +#ove pcre and pcreposix library into /lib +#mkdir -p %{buildroot}/%{_lib} +#for l in libpcre libpcreposix; do +# ldest=$(readlink %{buildroot}/%{_libdir}/$l.so) +# mv %{buildroot}%{_libdir}/$l.so.* %{buildroot}/%{_lib} +# #update the symlinks for linking. +# ln -s -vf /%{_lib}/$ldest %{buildroot}%{_libdir}/$l.so +#done + + + +%post -n libpcre -p /sbin/ldconfig + +%postun -n libpcre -p /sbin/ldconfig + +%post -n libpcrecpp -p /sbin/ldconfig + +%postun -n libpcrecpp -p /sbin/ldconfig + +%post -n libpcreposix -p /sbin/ldconfig + +%postun -n libpcreposix -p /sbin/ldconfig + +%files -n libpcre +%{_libdir}/libpcre.so.* + +%files -n libpcrecpp +%{_libdir}/libpcrecpp.so.* + +%files -n libpcreposix +%{_libdir}/libpcreposix.so.* + +%files tools +%{_bindir}/pcregrep +%{_bindir}/pcretest +%{_mandir}/man1/pcregrep.* +%{_mandir}/man1/pcretest.* + +%files doc +%doc doc/html doc/*.txt + +%files devel +%{_bindir}/pcre-config +%{_includedir}/* +%{_libdir}/*.so +%{_libdir}/pkgconfig/libpcre.pc +%{_libdir}/pkgconfig/libpcrecpp.pc +%{_libdir}/pkgconfig/libpcreposix.pc +%{_mandir}/man1/pcre-config.* +%{_mandir}/man3/*.gz + +%files devel-static +%{_libdir}/*.a + |