summaryrefslogtreecommitdiff
path: root/ghc-bootstrap.spec
diff options
context:
space:
mode:
Diffstat (limited to 'ghc-bootstrap.spec')
-rw-r--r--ghc-bootstrap.spec108
1 files changed, 108 insertions, 0 deletions
diff --git a/ghc-bootstrap.spec b/ghc-bootstrap.spec
new file mode 100644
index 0000000..a8e5369
--- /dev/null
+++ b/ghc-bootstrap.spec
@@ -0,0 +1,108 @@
+Name: ghc-bootstrap
+Version: 9.2.3
+Release: 1
+Summary: Binary distributions of The Glorious Glasgow Haskell Compiler
+License: BSD-3-Clause
+URL: https://gitee.com/src-openeuler/ghc-bootstrap
+Source0: LICENSE
+Source1: ghc-9.2.3-powerpc64-unknown-linux.tar.xz
+Source2: ghc-9.2.3-powerpc64le-unknown-linux.tar.xz
+Source3: ghc-9.2.3-x86_64-unknown-linux.tar.xz
+Source4: ghc-9.2.3-aarch64-unknown-linux.tar.xz
+
+BuildRequires: chrpath
+BuildRequires: fdupes
+BuildRequires: gmp-devel
+BuildRequires: libffi
+BuildRequires: libatomic
+BuildRequires: ncurses-libs
+BuildRequires: pkgconfig
+BuildRequires: pkgconfig(libffi)
+BuildRequires: numactl-devel
+Requires: gmp-devel
+Requires: libffi
+Requires: libatomic
+Requires: ncurses-libs
+Requires: pkgconfig(libffi)
+Requires: numactl-devel
+Requires: libffi-devel
+
+Conflicts: ghc-base
+Provides: ghc-bootstrap-devel
+ExclusiveArch: ppc64 ppc64le x86_64 aarch64
+AutoReq: off
+
+%description
+This package contains a binary distribution of The Glorious Glasgow
+Haskell Compilation System.
+
+The tarballs come from the ghc download page.
+This package is only used for bootstraping ghc.
+
+Do not install this package! Install 'ghc' instead.
+
+%prep
+cp %{SOURCE0} .
+cp %{SOURCE1} .
+cp %{SOURCE2} .
+cp %{SOURCE3} .
+cp %{SOURCE4} .
+cp %{SOURCE5} .
+
+%ifarch ppc64
+%define longarch powerpc64
+%define arch ppc64
+%endif
+%ifarch ppc64le
+%define longarch powerpc64le
+%define arch ppc64
+%endif
+%ifarch aarch64
+%define longarch aarch64
+%define arch aarch64
+%endif
+%ifarch x86_64
+%define longarch x86_64
+%define sysname unknown
+%define arch x86_64
+%endif
+%ifarch ppc64 ppc64le x86_64 aarch64
+%define sysname unknown
+%endif
+
+%build
+tar Jxf ghc-%{version}-%{longarch}-%{sysname}-linux.tar.xz
+cd ghc-%{version}-%{longarch}-%{sysname}-linux
+
+%install
+cd ghc-%{version}-%{longarch}-%{sysname}-linux
+
+./configure --prefix=/opt
+mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
+echo "/opt/lib/ghc-%{version}/lib/%{arch}-linux-ghc-%{version}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/ghc.conf
+%make_install
+for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do
+ chrpath -d $i
+done
+
+rm %{buildroot}/opt/lib/ghc-%{version}/lib/package.conf.d/.stamp
+(cd %{buildroot}/opt/lib/ghc-%{version}/lib/package.conf.d/
+for i in *.conf; do
+ mv $i.copy $i
+done
+)
+
+%post
+/sbin/ldconfig
+/opt/bin/ghc-pkg recache
+
+%postun -p /sbin/ldconfig
+
+%files
+%license LICENSE
+/opt/*
+%config %{_sysconfdir}/ld.so.conf.d/ghc.conf
+
+%changelog
+* Sat Jul 22 2023 Lin Runze <lrzlin@163.com> - 9.2.3-1
+- Initial packaging. (Version 9.2.3)