Commit 36e4b145736b978dbe2bfc22e9045947a72157d7

Authored by Davide Madrisan
1 parent faf2a81b00
Exists in master

GHC template - improve the template and fix some indentations

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>

Showing 1 changed file with 17 additions and 17 deletions Side-by-side Diff

1   -%define ghc_ver %(ghc --version | sed "s|.*version ||")
  1 +%define ghc_ver %(ghc --numeric-version)
2 2 %define pkgname %(echo %name | sed "s|^ghc-||")
  3 +
3 4 Name: @pck_name@
4 5 Version: @pck_version@
5 6 Release: @spec_first_release@@DISTRO_rpm@
6   -Summary: ...
  7 +Summary: GHC ...
7 8 Group: Development/Libraries
8 9 Vendor: @VENDOR@
9 10 Distribution: @DISTRO@
10 11 Packager: @packager_fullname@ <@packager_email@>
11 12 URL: http://hackage.haskell.org/package/%{pkgname}
12   -Source: ...
  13 +Source: http://hackage.haskell.org/package/%{pkgname}-%{version}/%{pkgname}-%{version}.tar.gz
13 14 License: BSD
14 15 ## AUTOBUILDREQ-BEGIN
15 16 ## AUTOBUILDREQ-END
16 17  
17 18  
18 19  
19 20  
20 21  
... ... @@ -40,37 +41,36 @@
40 41 %setup -q -n %{pkgname}-%{version}
41 42  
42 43 %build
43   -runghc Setup.hs configure \\
44   - --prefix=%{_prefix} --libdir=%{_libdir}
  44 +runghc Setup.hs configure -v2 \\
  45 +\ --prefix=%{_prefix} \\
  46 +\ --libdir=%{_libdir} \\
  47 +\ --libexecdir=%{_libexecdir} \\
  48 +\ --docdir=%{_docdir}/%{name}-%{version}
45 49  
46 50 runghc Setup.hs build
47   -runghc Setup.hs haddock --html-location=URL --hyperlink-source
  51 +runghc Setup.hs haddock --executable --html-location=URL --hyperlink-source
48 52  
49 53 %install
50 54 [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
51 55 runghc Setup.hs copy --destdir=%{buildroot}
52 56 runghc Setup.hs register \\
53   - --gen-pkg-config="%{buildroot}%{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}/%{pkgname}-%{version}.conf"
  57 +\ --gen-pkg-config="%{buildroot}%{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}/%{pkgname}-%{version}.conf"
54 58  
55 59 %clean
56 60 [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
57 61  
58 62 %post
59   -ghc-pkg register %{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}/%{pkgname}-%{version}.conf &>/dev/null || true
60   -:
  63 +ghc-pkg register %{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}/%{pkgname}-%{version}.conf &>/dev/null || :
61 64  
62 65 %preun
63   -ghc-pkg unregister %{pkgname}-%{version} &>/dev/null || true
64   -:
  66 +ghc-pkg unregister %{pkgname}-%{version} &>/dev/null || :
65 67  
66 68 %files
67 69 %defattr(-,root,root)
68   -%dir %{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}
69   -%{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}/*
70   -%dir %{_docdir}/%{pkgname}-%{version}
71   -%{_docdir}/doc/%{pkgname}-%{version}/LICENSE
72   -%dir %{_docdir}/%{pkgname}-%{version}/html
73   -%{_docdir}/%{pkgname}-%{version}/html/*
  70 +%{_libdir}/ghc-%{ghc_ver}/%{pkgname}-%{version}
  71 +%dir %{_docdir}/%{name}-%{version}
  72 +%{_docdir}/%{name}-%{version}/LICENSE
  73 +%{_docdir}/%{name}-%{version}/html
74 74  
75 75 ## Remove the following block if there is no binary tool provided
76 76 #%files -n %{pkgname}