summaryrefslogtreecommitdiffstats
path: root/cygwin-pcre.spec
blob: ed93c0b8f416081f68002a0c171e312c8652729e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
%global __strip %{_cygwin_strip}
%global __objdump %{_cygwin_objdump}
%global _use_internal_dependency_generator 0
%global __find_requires %{_cygwin_findrequires}
%global __find_provides %{_cygwin_findprovides}
%define __debug_install_post %{_cygwin_debug_install_post}

Name:		cygwin-pcre
Version:	8.12
Release:	1
Summary:	Cygwin pcre library

Group:		Development/Libraries
License:	BSD
URL:		http://www.pcre.org/
Source0:	ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-%{version}.tar.gz
Patch0:		pcre-8.10-multilib.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:	noarch

Requires:	pkgconfig

BuildRequires:	cygwin-filesystem
BuildRequires:	cygwin-gcc
BuildRequires:	cygwin-gcc-c++
BuildRequires:	cygwin-binutils

# New libtool to get rid of rpath
BuildRequires: autoconf, automake, libtool

%{?_cygwin_debug_package}

%description
Cross compiled Perl-compatible regular expression library for use with cygwin.

PCRE has its own native API, but a set of "wrapper" functions that are based on
the POSIX API are also supplied in the library libpcreposix. Note that this
just provides a POSIX calling interface to PCRE: the regular expressions
themselves still follow Perl syntax and semantics. The header file
for the POSIX-style functions is called pcreposix.h.


%package static
Summary:        Static version of the Cygwin PCRE library
Requires:       %{name} = %{version}-%{release}
Group:          Development/Libraries

%description static
Static version of the Cygwin PCRE library.


%prep
%setup -q -n pcre-%{version}

# Get rid of rpath
%patch0 -p1 -b .multilib
libtoolize --copy --force && autoreconf
# One contributor's name is non-UTF-8
for F in ChangeLog; do
    iconv -f latin1 -t utf8 "$F" >"${F}.utf8"
    touch --reference "$F" "${F}.utf8"
    mv "${F}.utf8" "$F"
done

%build
%{_cygwin_configure} --enable-utf8 --enable-unicode-properties
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

# same documentation as from native pcre
rm -rf $RPM_BUILD_ROOT%{_cygwin_datadir}/doc/*
rm -rf $RPM_BUILD_ROOT%{_cygwin_datadir}/man/*

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{_cygwin_bindir}/pcre-config
%{_cygwin_bindir}/pcregrep.exe
%{_cygwin_bindir}/pcretest.exe
%{_cygwin_bindir}/cygpcre*.dll
%{_cygwin_libdir}/libpcre*.dll.a
%{_cygwin_libdir}/libpcre*.la
%{_cygwin_libdir}/pkgconfig/libpcre*.pc
%{_cygwin_includedir}/*.h
%doc AUTHORS COPYING LICENCE NEWS README ChangeLog


%files static
%defattr(-,root,root,-)
%{_cygwin_libdir}/libpcre.a
%{_cygwin_libdir}/libpcrecpp.a
%{_cygwin_libdir}/libpcreposix.a


%changelog
* Thu Feb 17 2011 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 8.12-1
- Initial spec file, largely based on mingw32-pcre.