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

Last change on this file since 1649 was 1649, checked in by Silvan Scherrer, 6 years ago

spec: flex: Release version 2.6.4-1.

File size: 3.7 KB
Line 
1# devel is not buildable due to unresolved externals
2%define build_devel 0
3
4Summary: A tool for creating scanners (text pattern recognizers)
5Name: flex
6Version: 2.6.4
7Release: 1%{?dist}
8# parse.c and parse.h are under GPLv3+ with exception which allows
9# relicensing. Since flex is shipped under BDS-style license,
10# let's assume that the relicensing was done.
11# gettext.h (copied from gnulib) is under LGPLv2+
12License: BSD and LGPLv2+
13URL: https://github.com/westes/flex
14Group: Development/Tools
15%scm_source github https://github.com/bitwiseworks/%{name}-os2 %{version}-os2
16
17Requires: m4
18BuildRequires: gettext gettext-devel bison m4 help2man gcc automake libtool
19
20%description
21The flex program generates scanners. Scanners are programs which can
22recognize lexical patterns in text. Flex takes pairs of regular
23expressions and C code as input and generates a C source file as
24output. The output file is compiled and linked with a library to
25produce an executable. The executable searches through its input for
26occurrences of the regular expressions. When a match is found, it
27executes the corresponding C code. Flex was designed to work with
28both Yacc and Bison, and is used by many programs as part of their
29build process.
30
31You should install flex if you are going to use your system for
32application development.
33
34# We keep the libraries in separate sub-package to allow for multilib
35# installations of flex.
36%if %{build_devel}
37%package devel
38Summary: Libraries for flex scanner generator
39Obsoletes: flex-static < 2.5.35-15
40Provides: flex-static
41
42%description devel
43
44This package contains the library with default implementations of
45`main' and `yywrap' functions that the client binary can choose to use
46instead of implementing their own.
47%endif
48
49%package doc
50Summary: Documentation for flex scanner generator
51
52%description doc
53
54This package contains documentation for flex scanner generator in
55plain text and PDF formats.
56
57%debug_package
58
59%prep
60%scm_setup
61
62%build
63autoreconf -fvi
64
65export LDFLAGS="-Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
66export LIBS="-lcx"
67%if %{build_devel}
68%global conf_flags ""
69%else
70%global conf_flags "--disable-libfl"
71%endif
72%configure --docdir=%{_pkgdocdir} %{conf_flags}
73make %{?_smp_mflags}
74
75%install
76rm -rf $RPM_BUILD_ROOT
77make DESTDIR=$RPM_BUILD_ROOT install
78rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
79rm -f $RPM_BUILD_ROOT/%{_pkgdocdir}/README.cvs
80rm -f $RPM_BUILD_ROOT/%{_pkgdocdir}/TODO
81# For now, excluding the new .la and .so files as we haven't had
82# any requests for them and adding them will require a new subpackage.
83# The .so files contain 2 optional implementations of main and yywrap
84# for developer convenience. They are also available in the .a file
85# provided in flex-devel.
86find %{buildroot} -name '*.la' -delete
87find %{buildroot} -name '*.dll' -delete
88
89( cd ${RPM_BUILD_ROOT}
90 rm -f .%{_bindir}/flex++.exe
91 ln -sf flex.exe .%{_bindir}/lex
92 ln -sf flex.exe .%{_bindir}/flex++
93 ln -s flex.1 .%{_mandir}/man1/lex.1
94 ln -s flex.1 .%{_mandir}/man1/flex++.1
95%if %{build_devel}
96 ln -s libfl.a .%{_libdir}/libl.a
97%endif
98)
99
100%find_lang flex
101
102%check
103echo ============TESTING===============
104make check
105echo ============END TESTING===========
106
107%files -f flex.lang
108%dir %{_pkgdocdir}
109%license COPYING
110%{_pkgdocdir}/NEWS
111%{_pkgdocdir}/README.md
112%{_bindir}/*
113%exclude %{_bindir}/*.dbg
114%{_mandir}/man1/*
115%{_includedir}/FlexLexer.h
116%{_infodir}/flex.info*
117
118%if %{build_devel}
119%files devel
120%dir %{_pkgdocdir}
121%license COPYING
122%{_libdir}/*.a
123%endif
124
125%files doc
126%{_pkgdocdir}
127%exclude %{_pkgdocdir}/NEWS
128%exclude %{_pkgdocdir}/README.md
129
130%changelog
131* Wed Jun 12 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.6.4-1
132- update to version 2.6.4
133- use scm_ macros
134- moved source to github
135
136* Tue Feb 28 2012 yd
137- fixed m4 executable location.
138
139* Fri Jan 06 2012 yd
140- initial unixroot build.
Note: See TracBrowser for help on using the repository browser.