source: spec/trunk/SPECS/flex.spec@ 275

Last change on this file since 275 was 262, checked in by Yuri Dario, 14 years ago

spec: flex, initial build.

File size: 3.0 KB
Line 
1Summary: A tool for creating scanners (text pattern recognizers)
2Name: flex
3Version: 2.5.35
4Release: 1%{?dist}
5License: BSD
6Group: Development/Tools
7URL: http://flex.sourceforge.net/
8Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
9Patch0: flex-2.5.35-sign.patch
10Patch1: flex-2.5.35-hardening.patch
11Patch2: flex-2.5.35-gcc44.patch
12Patch3: flex-2.5.35-missing-prototypes.patch
13Patch4: flex-os2.patch
14BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15Requires: m4
16BuildRequires: gettext bison m4
17
18# We need to pull in the static library package. That's necessary so
19# that packages that just do BuildRequires: flex can still use -lfl.
20# I suspect that linking to -lfl is actually rare and those (few)
21# packages that do use it could be taught to require the sub-package
22# explicitly. So at some point in future, this dependency may be
23# dropped.
24#Requires: flex-static = %{version}
25
26%description
27The flex program generates scanners. Scanners are programs which can
28recognize lexical patterns in text. Flex takes pairs of regular
29expressions and C code as input and generates a C source file as
30output. The output file is compiled and linked with a library to
31produce an executable. The executable searches through its input for
32occurrences of the regular expressions. When a match is found, it
33executes the corresponding C code. Flex was designed to work with
34both Yacc and Bison, and is used by many programs as part of their
35build process.
36
37You should install flex if you are going to use your system for
38application development.
39
40# We keep the libraries in separate sub-package to allow for multilib
41# installations of flex.
42#%package static
43#Summary: Libraries for flex scanner generator
44#Group: Development/Tools
45
46#%description static
47#This package contains the library with default implementations of
48#`main' and `yywrap' functions that the client binary can choose to use
49#instead of implementing their own.
50
51%prep
52%setup -q
53%patch0 -p1
54%patch1 -p1
55%patch2 -p1
56%patch3 -p1
57%patch4 -p1
58
59%build
60export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe"
61export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
62export LIBS="-lurpo -lmmap"
63%configure \
64 --disable-dependency-tracking \
65 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
66
67make %{?_smp_mflags}
68
69%install
70rm -rf $RPM_BUILD_ROOT
71make DESTDIR=$RPM_BUILD_ROOT install
72rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
73rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
74
75( cd ${RPM_BUILD_ROOT}
76 ln -sf flex .%{_bindir}/lex
77 ln -sf flex .%{_bindir}/flex++
78 ln -s flex.1 .%{_mandir}/man1/lex.1
79 ln -s flex.1 .%{_mandir}/man1/flex++.1
80)
81
82#%check
83#echo ============TESTING===============
84#make check
85#echo ============END TESTING===========
86
87%clean
88rm -rf ${RPM_BUILD_ROOT}
89
90%files
91%defattr(-,root,root)
92%doc COPYING NEWS README
93%{_bindir}/*
94%{_mandir}/man1/*
95%{_includedir}/FlexLexer.h
96%{_infodir}/flex.info*
97%{_usr}/share/locale/*
98
99#%files static
100#%defattr(-,root,root)
101#%{_libdir}/*.a
102
103%changelog
104* Fri Jan 06 2012 yd
105- initial unixroot build.
Note: See TracBrowser for help on using the repository browser.