• R/O
  • SSH

contrib-spec-files: Commit

日本OpenSolaris Users Group有志による、レポジトリサーバ作成のためのspecファイル群です。


Commit MetaInfo

Revisionc0e1c4b218efa84f1569950ef52117674a769a09 (tree)
Time2013-12-27 06:32:03
AuthorOsamu Tabata <cantimerny.g@gmai...>
CommiterOsamu Tabata

Log Message

spec_SFEghc76-alex: initial commit

Change Summary

Incremental Difference

diff -r ce34ecfef2a8 -r c0e1c4b218ef specs/SFEghc76-alex.spec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/specs/SFEghc76-alex.spec Fri Dec 27 06:32:03 2013 +0900
@@ -0,0 +1,174 @@
1+#
2+# spec file for package SFEghc76-alex
3+#
4+
5+%include Solaris.inc
6+%include packagenamemacros.inc
7+%include default-depend.inc
8+
9+%define cc_is_gcc 1
10+%include base.inc
11+
12+%define ghc_version 7.6.3
13+
14+Name: alex
15+IPS_package_name: library/ghc76/alex
16+Version: 3.1.2
17+Release: 1
18+License: BSD
19+Group: Development/Languages/Haskell
20+URL: http://www.haskell.org/alex/
21+Source: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
22+Summary: Alex is a tool for generating lexical analysers in Haskell.
23+SUNW_Pkg: SFEghc76-alex
24+SUNW_Copyright: ghc76-alex.copyright
25+SUNW_BaseDir: %{_basedir}
26+BuildRoot: %{_tmppath}/%{name}-%{version}-build
27+
28+Requires: SFEgcc
29+Requires: SFEghc76
30+Requires: SFEghc76-QuickCheck
31+Requires: SFEghc76-happy
32+BuildRequires: SFEghc76-happy-doc
33+BuildRequires: SFEghc76-hscolour
34+
35+%description
36+Alex is a tool for generating lexical analysers in Haskell. It takes a description of tokens based on regular expressions and generates a Haskell module containing code for scanning text efficiently. It is similar to the tool lex or flex for C/C++.
37+
38+
39+%package -n SFEghc76-alex-prof
40+IPS_package_name: library/ghc76/alex-prof
41+Summary: %{summary} - profiling libraries
42+SUNW_BaseDir: %{_basedir}
43+%include default-depend.inc
44+Requires: SFEghc76-alex
45+
46+%package -n SFEghc76-alex-doc
47+IPS_package_name: library/ghc76/alex-doc
48+Summary: %{summary} - doc files
49+SUNW_BaseDir: %{_basedir}
50+%include default-depend.inc
51+Requires: SFEghc76-alex
52+
53+%prep
54+%setup -q -n %{name}-%{version}
55+export LD_LIBRARY_PATH=/usr/gnu/lib:$LD_LIBRARY_PATH
56+
57+# Need to use same gcc as we used to build ghc (gcc 4.x)
58+export CC=/usr/gnu/bin/gcc
59+export CXX=/usr/gnu/bin/g++
60+export CXXFLAGS="%{gcc_cxx_optflags}"
61+export CFLAGS="%optflags"
62+export PKG_CONFIG_PATH="%{_cxx_libdir}/pkgconfig"
63+%if %{is_s10}
64+export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib'
65+export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib'
66+%else
67+export LD_OPTIONS='-L%{_cxx_libdir}:/usr/gnu/lib -R%{_cxx_libdir}:/usr/gnu/lib'
68+export LDFLAGS='-L%{_cxx_libdir}:/usr/gnu/lib -R%{_cxx_libdir}:/usr/gnu/lib'
69+%endif
70+export PERL="/usr/perl5/bin/perl"
71+
72+GHC=/usr/bin/ghc
73+GHC_PKG=/usr/bin/ghc-pkg
74+HSC2HS=/usr/bin/hsc2hs
75+VERBOSE=--verbose=3
76+
77+chmod a+x ./Setup.lhs
78+runghc ./Setup.lhs configure --prefix=%{_prefix} \
79+ --libdir=%{_cxx_libdir} \
80+ --docdir=%{_docdir}/%{name}-%{version} \
81+ --htmldir=%{_docdir}/ghc/html/libraries/%{name}-%{version} \
82+ --libsubdir='$compiler/$pkgid' \
83+ --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} \
84+ --haddock-option="--html" \
85+ --enable-library-profiling \
86+ ${VERBOSE}
87+
88+%build
89+export LD_LIBRARY_PATH='/usr/gnu/lib'
90+%if %{is_s10}
91+export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib'
92+export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib'
93+%else
94+export LD_OPTIONS='-L%{_cxx_libdir}:/usr/gnu/lib -R%{_cxx_libdir}:/usr/gnu/lib'
95+export LDFLAGS='-L%{_cxx_libdir}:/usr/gnu/lib -R%{_cxx_libdir}:/usr/gnu/lib'
96+%endif
97+runghc ./Setup.lhs build ${VERBOSE}
98+runghc ./Setup.lhs haddock ${VERBOSE} --executables --hoogle --hyperlink-source
99+
100+%install
101+export LD_LIBRARY_PATH=/usr/gnu/lib:$LD_LIBRARY_PATH
102+%if %{is_s10}
103+export LD_OPTIONS='-L/usr/gnu/lib -R/usr/gnu/lib'
104+export LDFLAGS='-L/usr/gnu/lib -R/usr/gnu/lib'
105+%else
106+export LD_OPTIONS='-L%{_cxx_libdir}:/usr/gnu/lib -R%{_cxx_libdir}:/usr/gnu/lib'
107+export LDFLAGS='-L%{_cxx_libdir}:/usr/gnu/lib -R%{_cxx_libdir}:/usr/gnu/lib'
108+%endif
109+rm -rf $RPM_BUILD_ROOT
110+
111+install -d ${RPM_BUILD_ROOT}%{_cxx_libdir}/ghc-%{ghc_version}
112+# runghc ./Setup.lhs register ${VERBOSE} --gen-pkg-config=%{name}-%{version}.conf
113+runghc ./Setup.lhs copy ${VERBOSE} --destdir=${RPM_BUILD_ROOT}
114+
115+install -d ${RPM_BUILD_ROOT}%{_cxx_libdir}/ghc-%{ghc_version}/%{name}-%{version}/
116+# install -c -m 755 %{name}-%{version}.conf ${RPM_BUILD_ROOT}%{_cxx_libdir}/ghc-%{ghc_version}/%{name}-%{version}/%{name}-%{version}.conf
117+
118+# Prepare lists of files for packaging
119+cd %{_builddir}/%{name}-%{version}
120+find $RPM_BUILD_ROOT -type f -name "*.p_hi" > pkg-prof.files
121+find $RPM_BUILD_ROOT -type f -name "*_p.a" >> pkg-prof.files
122+find $RPM_BUILD_ROOT%{_libdir} -type f -name "*" > pkg-all.files
123+sort pkg-prof.files > pkg-prof-sort.files
124+sort pkg-all.files > pkg-all-sort.files
125+comm -23 pkg-all-sort.files pkg-prof-sort.files > pkg.files
126+find $RPM_BUILD_ROOT%{_datadir} -type f -name "*" > pkg-doc.files
127+sort pkg-doc.files > pkg-doc-sort.files
128+# Clean up syntax for %files section
129+cat pkg.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg.files
130+cat pkg-prof-sort.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-prof.files
131+cat pkg-doc-sort.files | sed 's:'"$RPM_BUILD_ROOT"'::' > TEMP && mv TEMP pkg-doc.files
132+
133+%clean
134+rm -rf $RPM_BUILD_ROOT
135+
136+%post
137+# The %install section above will only install files
138+# We need to register the package with ghc-pkg for ghc to find it
139+/usr/bin/ghc-pkg register --global --force %{_cxx_libdir}/ghc-%{ghc_version}/%{name}-%{version}/%{name}-%{version}.conf
140+
141+%post -n SFEghc76-alex-doc
142+cd %{_docdir}/ghc/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index
143+
144+%preun
145+# Need to unregister the package with ghc-pkg for the rebuild of the spec file to work
146+/usr/bin/ghc-pkg unregister --global --force %{name}-%{version}
147+
148+%postun -n SFEghc76-alex-doc
149+if [ "$1" -eq 0 ] && [ -x %{_docdir}/ghc/html/libraries/gen_contents_index ] ; then
150+ cd %{_docdir}/ghc/html/libraries && [ -x "./gen_contents_index" ] && ./gen_contents_index
151+fi
152+
153+%files -f pkg.files
154+%defattr (-, root, bin)
155+%dir %attr (0755, root, bin) %{_libdir}
156+%{_libdir}/*
157+%dir %attr (0755, root, bin) %{_bindir}
158+%{_bindir}/*
159+
160+%files -n SFEghc76-alex-prof -f pkg-prof.files
161+%defattr (-, root, bin)
162+
163+%files -n SFEghc76-alex-doc -f pkg-doc.files
164+%defattr(-,root,root,-)
165+%dir %attr (0755, root, sys) %{_datadir}
166+%dir %attr (0755, root, other) %{_docdir}
167+%dir %attr (0755, root, bin) %{_docdir}/ghc
168+%dir %attr (0755, root, bin) %{_docdir}/ghc/html
169+%dir %attr (0755, root, bin) %{_docdir}/ghc/html/libraries
170+%dir %attr (0755, root, bin) %{_docdir}/ghc/html/libraries/%{name}-%{version}
171+
172+%changelog
173+* Fri Dec 27 2013 - Osamu Tabata<cantimerny.g@gmail.com>
174+- Support for Solaris11
diff -r ce34ecfef2a8 -r c0e1c4b218ef specs/copyright/ghc76-alex.copyright
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/specs/copyright/ghc76-alex.copyright Fri Dec 27 06:32:03 2013 +0900
@@ -0,0 +1,30 @@
1+Copyright (c) 1995-2011, Chris Dornan and Simon Marlow
2+All rights reserved.
3+
4+Redistribution and use in source and binary forms, with or without
5+modification, are permitted provided that the following conditions are
6+met:
7+
8+ * Redistributions of source code must retain the above copyright
9+ notice, this list of conditions and the following disclaimer.
10+
11+ * Redistributions in binary form must reproduce the above
12+ copyright notice, this list of conditions and the following
13+ disclaimer in the documentation and/or other materials provided
14+ with the distribution.
15+
16+ * Neither the name of the copyright holders, nor the names of the
17+ contributors may be used to endorse or promote products derived
18+ from this software without specific prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Show on old repository browser