summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-10-28 12:14:45 +0000
committerCoprDistGit <infra@openeuler.org>2023-10-28 12:14:45 +0000
commit0fdcbcd9f8d618d244bf2eef3fdbaaaa7b18838a (patch)
tree760cdaa8c394a3060ec5915434f7423fa9594ce7
parent145f00aece6d6b0418af18b463bdfb0c96010150 (diff)
automatic import of ghc-rpm-macrosopeneuler22.03_LTS_SP2
-rw-r--r--.gitignore1
-rw-r--r--ghc-rpm-macros.spec68
-rw-r--r--sources1
-rw-r--r--using-help-as-doc-packages-suffix.patch78
4 files changed, 148 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..83d9b43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ghc-rpm-macros-2.5.2.tar.xz
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
new file mode 100644
index 0000000..b78acf8
--- /dev/null
+++ b/ghc-rpm-macros.spec
@@ -0,0 +1,68 @@
+Name: ghc-rpm-macros
+Version: 2.5.2
+Release: 1
+Summary: RPM Macros for building packages for GHC
+License: GPL-3.0-or-later
+URL: https://fedoraproject.org/wiki/Haskell_SIG
+Source0: %{name}-%{version}.tar.xz
+
+Patch1: using-help-as-doc-packages-suffix.patch
+BuildRequires: xz
+Requires: rpm
+Requires: chrpath
+BuildArch: noarch
+
+%description
+A set of macros for building GHC packages. ghc needs to be installed
+in order to make use of these macros.
+
+%package extra
+Summary: Extra RPM macros for building Haskell packages with several libs
+Requires: %{name} = %{version}-%{release}
+
+%description extra
+Extra macros used for subpackaging of Haskell libraries,
+for example in ghc and haskell-platform.
+
+%prep
+%setup -q
+%patch1 -p1
+
+%build
+echo no build stage needed
+
+%install
+install -p -D -m 0644 macros.ghc %{buildroot}%{_rpmmacrodir}/macros.ghc
+install -p -D -m 0644 macros.ghc-extra %{buildroot}/%{_rpmmacrodir}/macros.ghc-extra
+install -p -D -m 0644 macros.ghc-suse %{buildroot}/%{_rpmmacrodir}/macros.ghc-suse
+install -p -D -m 0755 ghc-deps.sh %{buildroot}/%{_prefix}/lib/rpm/ghc-deps.sh
+install -p -D -m 0755 cabal-tweak-dep-ver %{buildroot}/%{_bindir}/cabal-tweak-dep-ver
+install -p -D -m 0755 cabal-tweak-drop-dep %{buildroot}/%{_bindir}/cabal-tweak-drop-dep
+install -p -D -m 0755 cabal-tweak-flag %{buildroot}/%{_bindir}/cabal-tweak-flag
+install -p -D -m 0755 cabal-tweak-remove-upperbound %{buildroot}/%{_bindir}/cabal-tweak-remove-upperbound
+install -p -D -m 0755 ghc-pkg-wrapper %{buildroot}/%{_prefix}/lib/rpm/ghc-pkg-wrapper
+install -p -D -m 0644 ghc.attr %{buildroot}/%{_prefix}/lib/rpm/fileattrs/ghc.attr
+install -p -D -m 0644 Setup.hs %{buildroot}/%{_datadir}/%{name}/Setup.hs
+
+%files
+%doc AUTHORS
+%license COPYING
+%{_rpmmacrodir}/macros.ghc
+%{_rpmmacrodir}/macros.ghc-suse
+%{_prefix}/lib/rpm/ghc-deps.sh
+%{_bindir}/cabal-tweak-dep-ver
+%{_bindir}/cabal-tweak-flag
+%{_bindir}/cabal-tweak-drop-dep
+%{_bindir}/cabal-tweak-remove-upperbound
+%{_prefix}/lib/rpm/ghc-pkg-wrapper
+%{_prefix}/lib/rpm/fileattrs/ghc.attr
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/Setup.hs
+
+%files extra
+%{_rpmmacrodir}/macros.ghc-extra
+
+%changelog
+* Tue Jul 25 2023 Lin Runze <lrzlin@163.com> 2.5.2-1
+- Initial packaging (Version 2.5.2)
+- Using help suffix instead of doc
diff --git a/sources b/sources
new file mode 100644
index 0000000..9320667
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+e046fc5f8f88d7189d0da42b4cef49aa ghc-rpm-macros-2.5.2.tar.xz
diff --git a/using-help-as-doc-packages-suffix.patch b/using-help-as-doc-packages-suffix.patch
new file mode 100644
index 0000000..b995f9b
--- /dev/null
+++ b/using-help-as-doc-packages-suffix.patch
@@ -0,0 +1,78 @@
+diff -Naur origin/ghc-rpm-macros-2.5.2/macros.ghc ghc-rpm-macros-2.5.2/macros.ghc
+--- origin/ghc-rpm-macros-2.5.2/macros.ghc 2023-03-19 08:16:20.000000000 +0800
++++ ghc-rpm-macros-2.5.2/macros.ghc 2023-09-26 16:30:17.418978816 +0800
+@@ -161,8 +161,8 @@
+ exit 1\
+ fi\
+ %define basepkg %{ghc_prefix}-%{pkgname}\
+-rm -f %{basepkg}.files %{basepkg}-doc.files\
+-touch %{basepkg}.files %{basepkg}-doc.files\
++rm -f %{basepkg}.files %{basepkg}-help.files\
++touch %{basepkg}.files %{basepkg}-help.files\
+ %if 0%{?1:1}\
+ if [ -d "%{buildroot}%{_ghclicensedir}/%{basepkg}" ]; then\
+ for i in $(ls %{buildroot}%{_ghclicensedir}/%{basepkg}); do\
+@@ -194,18 +194,18 @@
+ %if %{with haddock}\
+ haddock_dir=%{ghc_html_libraries_dir}/%{pkgnamever}\
+ if [ -d %{buildroot}$haddock_dir ]; then\
+-echo $haddock_dir >> %{basepkg}-doc.files\
++echo $haddock_dir >> %{basepkg}-help.files\
+ %if %{with hadrian}\
+ # for < 9.4.1-rc1\
+ else\
+ haddock_dir=%{ghc_html_libraries_dir}/%{pkgname}\
+ if [ -d %{buildroot}$haddock_dir ]; then\
+-echo $haddock_dir >> %{basepkg}-doc.files\
++echo $haddock_dir >> %{basepkg}-help.files\
+ fi\
+ %endif\
+ fi\
+ %endif\
+-for i in %{basepkg}.files %{basepkg}-devel.files %{basepkg}-doc.files %{basepkg}-prof.files; do\
++for i in %{basepkg}.files %{basepkg}-devel.files %{basepkg}-help.files %{basepkg}-prof.files; do\
+ if [ -f "$i" ]; then\
+ sed -i -e "s!%{buildroot}!!g" $i\
+ fi\
+@@ -217,7 +217,7 @@
+ cat %{name}-%1.files >> %{name}-%2.files\
+ cat %{name}-%1-devel.files >> %{name}-%2-devel.files\
+ %if %{with haddock}\
+-cat %{name}-%1-doc.files >> %{name}-%2-doc.files\
++cat %{name}-%1-help.files >> %{name}-%2-help.files\
+ %endif\
+ %if %{with ghc_prof}\
+ cat %{name}-%1-prof.files >> %{name}-%2-prof.files\
+diff -Naur origin/ghc-rpm-macros-2.5.2/macros.ghc-extra ghc-rpm-macros-2.5.2/macros.ghc-extra
+--- origin/ghc-rpm-macros-2.5.2/macros.ghc-extra 2023-02-02 23:29:52.000000000 +0800
++++ ghc-rpm-macros-2.5.2/macros.ghc-extra 2023-09-26 10:29:01.799794938 +0800
+@@ -48,16 +48,16 @@
+ \
+ %if 0%{!-m:1}\
+ %if %{with haddock}\
+-%package -n %{basepkg}-doc\
++%package -n %{basepkg}-help\
+ Summary: Haskell %{pkgname} library documentation\
+ %{?1:Version: %{pkgver}}\
+ %{-l:License: %{-l*}}\
+ BuildArch: noarch\
+ Requires: %{ghc_prefix}-filesystem\
+-%{?ghc_obsoletes_name:Obsoletes: %{ghc_obsoletes_name}-%{pkgname}-doc < %{pkgver}-%{release}}\
+-Supplements: (%{basepkg}-devel and %{ghc_prefix}-doc)\
++%{?ghc_obsoletes_name:Obsoletes: %{ghc_obsoletes_name}-%{pkgname}-help < %{pkgver}-%{release}}\
++Supplements: (%{basepkg}-devel and %{ghc_prefix}-help)\
+ \
+-%description -n %{basepkg}-doc\
++%description -n %{basepkg}-help\
+ This package provides the Haskell %{pkgname} library documentation.\
+ %endif\
+ \
+@@ -81,7 +81,7 @@
+ %if 0%{!-m:1}\
+ \
+ %if %{with haddock}\
+-%files -n %{basepkg}-doc -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-doc.files\
++%files -n %{basepkg}-help -f %{!-d:%{pkgname}-%{pkgver}/}%{basepkg}-help.files\
+ %endif\
+ \
+ %if %{with ghc_prof}\