rebuild for openEuler

This commit is contained in:
openeuler-basic 2020-01-13 13:01:04 +08:00
parent 2c40e063d1
commit 9d48ed298c
34 changed files with 228 additions and 943 deletions

View File

@ -1,36 +0,0 @@
# openEuler-rpm-config
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,39 +0,0 @@
# openEuler-rpm-config
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

8
brp-ldconfig Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh -efu
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
/sbin/ldconfig -N -r "$RPM_BUILD_ROOT"

0
config.guess vendored Normal file
View File

0
config.sub vendored Normal file
View File

View File

@ -1,46 +1,27 @@
%global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler}
Name: %{vendor}-rpm-config
Version: 29
Release: 20
License: GPL+
Summary: specific rpm configuration files
URL: https://src.fedoraproject.org/rpms/redhat-rpm-config
Name: %{vendor}-rpm-config
Version: 30
Release: 1
License: GPL+
Summary: specific rpm configuration files
URL: https://gitee.com/src-openeuler/openEuler-rpm-config
# Core rpm settings
#fedora 29 snapshots from https://src.fedoraproject.org/rpms/redhat-rpm-config
Source0: redhat-rpm-config-118.tar.gz
#https://src.fedoraproject.org/rpms/fpc-srpm-macros/blob/f29/f/macros.fpc-srpm
Source1: macros.fpc-srpm
#https://src.fedoraproject.org/rpms/ghc-srpm-macros/blob/f29/f/macros.ghc-srpm
Source2: macros.ghc-srpm
#https://src.fedoraproject.org/rpms/gnat-srpm-macros/blob/f29/f/macros.gnat-srpm
Source3: macros.gnat-srpm
#https://src.fedoraproject.org/rpms/nim-srpm-macros/tree/f29
Source4: macros.nim-srpm
#https://src.fedoraproject.org/rpms/ocaml-srpm-macros/blob/f29/f/macros.ocaml-srpm
Source5: macros.ocaml-srpm
#https://src.fedoraproject.org/rpms/openblas-srpm-macros/blob/f29/f/macros.openblas-srpm
Source6: macros.openblas-srpm
#https://src.fedoraproject.org/rpms/perl-srpm-macros/blob/f29/f/macros.perl-srpm
Source7: macros.perl-srpm
#https://pagure.io/fedora-rust/rust2rpm
Source8: macros.rust-srpm
#https://github.com/gofed/go-macros
Source9: macros.go-srpm
Source1: brp-ldconfig
Source2: rpmrc
Source3: macros
Source4: config.guess
Source5: config.sub
Source10: macros.perl
Source11: macros.python
Source12: macros.go
Source13: macros.forge
#python https://src.fedoraproject.org/rpms/python-rpm-macros/blob/f29/
Source10: macros.python
Source11: macros.python-srpm
Source12: macros.python2
Source13: macros.python3
Source14: macros.pybytecompile
Source99: macros.openEuler
Patch0: genericOS.patch
Patch1: remove-fcf-protection-for-gcc-7.3.0-x86_64.patch
Source20: openEuler-hardened-cc1
Source21: openEuler-hardened-ld
Source22: openEuler-pie-cc1
Source23: openEuler-pie-ld
Provides: python-rpm-macros = %{version}-%{release}
Provides: python2-rpm-macros = %{version}-%{release}
@ -55,6 +36,8 @@ Provides: openblas-srpm-macros
Provides: perl-srpm-macros
Provides: rust-srpm-macros
Provides: go-srpm-macros
Provides: kernel-rpm-macros
Obsoletes: kernel-rpm-macros
Obsoletes: python-rpm-macros
Obsoletes: python2-rpm-macros
Obsoletes: python3-rpm-macros
@ -73,7 +56,6 @@ Requires: efi-srpm-macros
Requires: qt5-srpm-macros
Requires: rpm >= 4.11.0
Requires: dwz >= 0.4
Requires: zip
#Requires: (annobin if gcc)
@ -81,7 +63,7 @@ Requires: zip
Requires: %{_bindir}/find
Requires: %{_bindir}/file
Requires: %{_bindir}/grep
Requires: sed
Requires: %{_bindir}/sed
Requires: %{_bindir}/xargs
# -fstack-clash-protection and -fcf-protection require GCC 8.
@ -89,83 +71,37 @@ Conflicts: gcc < 7
Provides: system-rpm-config = %{version}-%{release}
%global rrcdir /usr/lib/rpm/%{vendor}
%global rpmvdir /usr/lib/rpm/%{vendor}
%description
specific rpm configuration files for %{vendor}.
%package -n kernel-rpm-macros
Summary: Macros and scripts for building kernel module packages
Requires: %{vendor}-rpm-config
%description -n kernel-rpm-macros
Macros and scripts for building kernel module packages.
%prep
sed -i "s/generic_os/%{vendor}/g" $RPM_SOURCE_DIR/genericOS.patch
%setup -T -c
tar -xf %{SOURCE0} --strip-components 1
%patch0 -p1
%patch1 -p1
mv redhat-hardened-cc1 %{vendor}-hardened-cc1
mv redhat-hardened-ld %{vendor}-hardened-ld
mv redhat-annobin-cc1 %{vendor}-annobin-cc1
%setup -c -T
cp -p %{sources} .
%install
mkdir -p %{buildroot}%{rrcdir}
install -p -m 644 -t %{buildroot}%{rrcdir} macros rpmrc
install -p -m 444 -t %{buildroot}%{rrcdir} %{vendor}-hardened-*
install -p -m 444 -t %{buildroot}%{rrcdir} %{vendor}-annobin-*
install -p -m 755 -t %{buildroot}%{rrcdir} config.*
install -p -m 755 -t %{buildroot}%{rrcdir} dist.sh rpmsort symset-table kmodtool
install -p -m 755 -t %{buildroot}%{rrcdir} brp-*
install -p -m 755 -t %{buildroot}%{rrcdir} find-*
mkdir -p %{buildroot}%{rrcdir}/find-provides.d
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
install -p -m 755 -t %{buildroot}%{rrcdir} brp-*
mkdir -p %{buildroot}%{rpmvdir}
install -p -m 644 -t %{buildroot}%{rpmvdir} macros rpmrc
install -p -m 755 -t %{buildroot}%{rpmvdir} config.*
install -p -m 755 -t %{buildroot}%{rpmvdir} brp-*
install -p -m 644 -t %{buildroot}%{rpmvdir} openEuler-*
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.*
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d/ %{SOURCE11} %{SOURCE12} %{SOURCE13}
mkdir -p %{buildroot}%{_fileattrsdir}
install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr
install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov
install -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} \
%{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE99}\
%{buildroot}/%{rpmmacrodir}/
%files
%dir %{rrcdir}
%{rrcdir}/macros
%{rrcdir}/rpmrc
%{rrcdir}/brp-*
%{rrcdir}/dist.sh
%{rrcdir}/%{vendor}-hardened-*
%{rrcdir}/%{vendor}-annobin-*
%{rrcdir}/config.*
%{rrcdir}/find-provides
%{rrcdir}/find-requires
%{rrcdir}/brp-ldconfig
%{_fileattrsdir}/*.attr
%{_rpmconfigdir}/kmod.prov
%{_rpmconfigdir}/macros.d/macros.*
%doc buildflags.md
%exclude %{_rpmconfigdir}/macros.d/macros.kmp
%files -n kernel-rpm-macros
%dir %{rrcdir}/find-provides.d
%{rrcdir}/kmodtool
%{rrcdir}/rpmsort
%{rrcdir}/symset-table
%{rrcdir}/find-provides.ksyms
%{rrcdir}/find-requires.ksyms
%{rrcdir}/find-provides.d/firmware.prov
%{rrcdir}/find-provides.d/modalias.prov
%{_rpmconfigdir}/macros.d/macros.kmp
%dir %{rpmvdir}
%{rpmvdir}/macros
%{rpmvdir}/rpmrc
%{rpmvdir}/brp-*
%{rpmvdir}/config.*
%{rpmvdir}/openEuler-*
%{_fileattrsdir}/
%{_rpmconfigdir}/macros.d/
%{_rpmconfigdir}/macros.d/*
%changelog
* Thu Dec 26 2019 openEuler Buildteam <buildteam@openeuler.org> 29-20

View File

@ -1,193 +0,0 @@
diff -urN a/buildflags.md b/buildflags.md
--- a/buildflags.md 2019-08-08 06:06:41.000000000 +0000
+++ b/buildflags.md 2019-08-09 06:55:22.060000000 +0000
@@ -208,7 +208,7 @@
For hardened builds (which are enabled by default, see above for how
to disable them), the flag
-`-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1` is added to the
+`-specs=/usr/lib/rpm/generic_os/redhat-hardened-cc1` is added to the
command line. It adds the following flag to the command line:
* `-fPIE`: Compile for a position-independent executable (PIE),
@@ -231,7 +231,7 @@
To support [binary watermarks for ELF
objects](https://fedoraproject.org/wiki/Toolchain/Watermark) using
-annobin, the `-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1` flag is
+annobin, the `-specs=/usr/lib/rpm/generic_os/redhat-annobin-cc1` flag is
added by default. This can be switched off by undefining the
`%_annotated_build` RPM macro (see above).
@@ -314,7 +314,7 @@
(optional, see above).
For hardened builds, the
-`-specs=/usr/lib/rpm/redhat/redhat-hardened-ld` flag is added to the
+`-specs=/usr/lib/rpm/generic_os/redhat-hardened-ld` flag is added to the
compiler driver command line. (This can be disabled by undefining the
`%_hardened_build` macro; see above) This activates the following
linker flags:
diff -urN a/dist.sh b/dist.sh
--- a/dist.sh 2019-08-08 06:06:41.000000000 +0000
+++ b/dist.sh 2019-08-09 06:55:22.060000000 +0000
@@ -11,7 +11,7 @@
# If we successfully detect the version number, we output the
# dist tag. Otherwise, we exit with no output.
-RELEASEFILE=/etc/redhat-release
+RELEASEFILE=/etc/generic_os-release
function check_num {
MAINVER=`cut -d "(" -f 1 < $RELEASEFILE | \
diff -urN a/find-provides b/find-provides
--- a/find-provides 2019-08-08 06:06:41.000000000 +0000
+++ b/find-provides 2019-08-09 06:55:22.060000000 +0000
@@ -15,7 +15,7 @@
#
# --- any other extra find-provides scripts
-for i in /usr/lib/rpm/redhat/find-provides.d/*.prov
+for i in /usr/lib/rpm/generic_os/find-provides.d/*.prov
do
[ -x $i ] &&
(echo $filelist | tr '[:blank:]' \\n | $i | sort -u)
@@ -44,7 +44,7 @@
unset is_kmod
fi
-[ -x /usr/lib/rpm/redhat/find-provides.ksyms ] && [ "$is_kmod" ] &&
- printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-provides.ksyms
+[ -x /usr/lib/rpm/generic_os/find-provides.ksyms ] && [ "$is_kmod" ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/generic_os/find-provides.ksyms
exit 0
diff -urN a/find-requires b/find-requires
--- a/find-requires 2019-08-08 06:06:41.000000000 +0000
+++ b/find-requires 2019-08-09 06:55:22.060000000 +0000
@@ -33,7 +33,7 @@
done
# Disabling for now while the Fedora kernel doesn't produce kABI deps.
-#[ -x /usr/lib/rpm/redhat/find-requires.ksyms ] && [ "$is_kmod" ] &&
-# printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/redhat/find-requires.ksyms
+#[ -x /usr/lib/rpm/generic_os/find-requires.ksyms ] && [ "$is_kmod" ] &&
+# printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/generic_os/find-requires.ksyms
exit 0
diff -urN a/macros b/macros
--- a/macros 2019-08-08 06:06:41.000000000 +0000
+++ b/macros 2019-08-09 06:57:55.040000000 +0000
@@ -3,7 +3,7 @@
#==============================================================================
# ---- per-platform macros.
#
-%_vendor redhat
+%_vendor generic_os
%_os linux
%_target_platform %{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}
@@ -77,7 +77,7 @@
%configure \
%{set_build_flags}; \
[ "%_configure_gnuconfig_hack" = 1 ] && for i in $(find $(dirname %{_configure}) -name config.guess -o -name config.sub) ; do \
- [ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
+ [ -f /usr/lib/rpm/generic_os/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/generic_os/$(basename $i) $i ; \
done ; \
[ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \
for i in $(find . -name ltmain.sh) ; do \
@@ -136,7 +136,7 @@
# Build root policy macros. Standard naming:
# convert all '-' in basename to '_', add two leading underscores.
-%__brp_ldconfig /usr/lib/rpm/redhat/brp-ldconfig
+%__brp_ldconfig /usr/lib/rpm/generic_os/brp-ldconfig
%__brp_compress /usr/lib/rpm/brp-compress
%__brp_strip /usr/lib/rpm/brp-strip %{__strip}
%__brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
@@ -147,7 +147,7 @@
# __brp_mangle_shebangs_exclude_file - file from which to get shebangs to exclude
# __brp_mangle_shebangs_exclude_from - files to ignore
# __brp_mangle_shebangs_exclude_from_file - file from which to get files to ignore
-%__brp_mangle_shebangs /usr/lib/rpm/redhat/brp-mangle-shebangs %{?__brp_mangle_shebangs_exclude:--shebangs "%{?__brp_mangle_shebangs_exclude}"} %{?__brp_mangle_shebangs_exclude_file:--shebangs-from "%{__brp_mangle_shebangs_exclude_file}"} %{?__brp_mangle_shebangs_exclude_from:--files "%{?__brp_mangle_shebangs_exclude_from}"} %{?__brp_mangle_shebangs_exclude_from_file:--files-from "%{__brp_mangle_shebangs_exclude_from_file}"}
+%__brp_mangle_shebangs /usr/lib/rpm/generic_os/brp-mangle-shebangs %{?__brp_mangle_shebangs_exclude:--shebangs "%{?__brp_mangle_shebangs_exclude}"} %{?__brp_mangle_shebangs_exclude_file:--shebangs-from "%{__brp_mangle_shebangs_exclude_file}"} %{?__brp_mangle_shebangs_exclude_from:--files "%{?__brp_mangle_shebangs_exclude_from}"} %{?__brp_mangle_shebangs_exclude_from_file:--files-from "%{__brp_mangle_shebangs_exclude_from_file}"}
%__os_install_post \
%{?__brp_ldconfig} \
@@ -193,9 +193,9 @@
# Use XZ compression for binary payloads
%_binary_payload w2.xzdio
-%_hardening_cflags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
+%_hardening_cflags -specs=/usr/lib/rpm/generic_os/generic_os-hardened-cc1
# we don't escape symbols '~', '"', etc. so be careful when changing this
-%_hardening_ldflags -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
+%_hardening_ldflags -Wl,-z,now -specs=/usr/lib/rpm/generic_os/generic_os-hardened-ld
# Harden packages by default for Fedora 23:
# https://fedorahosted.org/fesco/ticket/1384 (accepted on 2014-02-11)
@@ -204,12 +204,14 @@
%_hardened_cflags %{?_hardened_build:%{_hardening_cflags}}
%_hardened_ldflags %{?_hardened_build:%{_hardening_ldflags}}
-%_annobin_cflags -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
+#%_annobin_cflags -specs=/usr/lib/rpm/generic_os/generic_os-annobin-cc1
+%_annobin_cflags %{nil}
# Add extra information to binary objects created by gcc for Fedora 28:
# https://pagure.io/fesco/issue/1780 (accepted on 2017-10-30)
# Use "%undefine _annotated_build" to disable.
-%_annotated_build 1
+#%_annotated_build 1
+%undefine _annotated_build
%_annotated_cflags %{?_annotated_build:%{_annobin_cflags}}
# Fail linking if there are undefined symbols. Required for proper
diff -urN a/macros.kmp b/macros.kmp
--- a/macros.kmp 2019-08-08 06:06:41.000000000 +0000
+++ b/macros.kmp 2019-08-09 06:55:22.060000000 +0000
@@ -2,8 +2,8 @@
redhat_kernel_module_package 1
kernel_module_package_release 1
-%__find_provides /usr/lib/rpm/redhat/find-provides
-%__find_requires /usr/lib/rpm/redhat/find-requires
+%__find_provides /usr/lib/rpm/generic_os/find-provides
+%__find_requires /usr/lib/rpm/generic_os/find-requires
#kernel_module_package [ -n name ] [ -v version ] [ -r release ] [ -s script ]
# [ -f filelist] [ -x ] [ -p preamble ] flavor flavor ...
@@ -12,10 +12,10 @@
kernel-devel
%kernel_module_package(n:v:r:s:f:xp:) %{expand:%( \
- %define kmodtool %{-s*}%{!-s:/usr/lib/rpm/redhat/kmodtool} \
+ %define kmodtool %{-s*}%{!-s:/usr/lib/rpm/generic_os/kmodtool} \
%define kmp_version %{-v*}%{!-v:%{version}} \
%define kmp_release %{-r*}%{!-r:%{release}} \
- %define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/redhat/rpmsort -r | head -n 1` | head -n 1) \
+ %define latest_kernel %(rpm -q --qf '%{VERSION}-%{RELEASE}\\\\n' `rpm -q kernel-devel | /usr/lib/rpm/generic_os/rpmsort -r | head -n 1` | head -n 1) \
%{!?kernel_version:%{expand:%%global kernel_version %{latest_kernel}}} \
%global kverrel %(%{kmodtool} verrel %{?kernel_version} 2>/dev/null) \
flavors="default" \
diff -urN a/redhat-rpm-config.spec b/redhat-rpm-config.spec
--- a/redhat-rpm-config.spec 2019-08-08 06:06:41.000000000 +0000
+++ b/redhat-rpm-config.spec 2019-08-09 06:55:22.060000000 +0000
@@ -110,7 +110,7 @@
Provides: system-rpm-config = %{version}-%{release}
-%global rrcdir /usr/lib/rpm/redhat
+%global rrcdir /usr/lib/rpm/generic_os
%description
Red Hat specific rpm configuration files.
@@ -952,7 +952,7 @@
* Mon Jul 7 2003 Jens Petersen <petersen@redhat.com> - 8.0.25-1
- update config.{guess,sub} to 2003-06-17
-- define VENDOR to be redhat only when /etc/redhat-release present
+- define VENDOR to be redhat only when /etc/generic_os-release present
[suggested by jbj]
- put VENDOR in vendor field in our config.guess file for
ia64, ppc, ppc64, s390, s390x, x86_64 and elf32-i386 Linux

0
macros Normal file
View File

0
macros.forge Normal file
View File

View File

@ -1,3 +0,0 @@
%fpc_arches %{ix86} %{arm} x86_64 ppc64
# fpc_arches lists the architectures where the Free Pascal Compiler is
# available in Fedora.

View File

@ -1,7 +0,0 @@
# Macros needed for building srpms of Haskell packages
# from ghc-7.8 ghci is supported on all arch's
# former archs: armv5tel ppc sparcv9
%ghc_arches_with_ghci %{ix86} x86_64 armv7hl ppc64 ppc64le aarch64 s390 s390x %{mips}
# ghc_arches is not used in current packages but still here for back compat
# former archs: alpha ppc sparcv9 armv5tel
%ghc_arches %{ix86} x86_64 armv7hl ppc64 ppc64le aarch64 s390 s390x

View File

@ -1,14 +0,0 @@
%GNAT_arches %{GPRbuild_arches} ia64 ppc alpha %{ix86}
# GNAT_arches lists the architectures where GNAT is available in Fedora. Ada
# packages won't build on other architectures until GNAT is bootstrapped for
# them.
# (Although not all of these architectures have active maintainer teams in
# Fedora, it seems appropriate to keep this list in agreement with the one in
# gcc.spec.)
%GPRbuild_arches x86_64 ppc64 ppc64p7 ppc64le s390x %{arm} aarch64
# GPRbuild_arches lists the architectures where GPRbuild is available in Fedora.
# If an architecture is included in GNAT_arches but not in GPRbuild_arches, then
# either GPRbuild hasn't been bootstrapped for that architecture, or there might
# be some architecture-specific problem.
# x86 is excluded from GPRbuild_arches because of
# https://bugzilla.redhat.com/show_bug.cgi?id=1444614

0
macros.go Normal file
View File

View File

@ -1,170 +0,0 @@
# Copyright (c) 2015-2018 Jakub Cajka <jcajka@redhat.com>,
# Jan Chaloupka <jchaloup@redhat.com>,
# Nicolas Mailhot <nim@fedoraproject.org>
# This file is distributed under the terms of GNU GPL license version 3, or
# any later version.
# This file contains macros for building projects in golang for packages
# with golang compiler or gcc-go compiler based on an architecture.
# Golang is primarly for primary architectures, gcc-go for secondary.
#
# This file provides only macros and must not use any other package except
# redhat-rpm-macros.
# Define arches for PA and SA
%golang_arches %{ix86} x86_64 %{arm} aarch64 ppc64le s390x
%gccgo_arches %{mips}
%go_arches %{golang_arches} %{gccgo_arches}
# Where to set GOPATH for builds
%gopath %{_datadir}/gocode
# Define go_compilers macro to signal go-compiler package is available
%go_compiler 1
# Sanitize a Go import path that can then serve as rpm package name
# Mandatory parameter: a Go import path
%gorpmname() %{lua:
local goname = rpm.expand("%1")
-- lowercase and end with '/'
goname = string.lower(goname .. "/")
-- remove eventual protocol prefix
goname = string.gsub(goname, "^http(s?)://", "")
-- remove eventual .git suffix
goname = string.gsub(goname, "%.git/*", "")
-- remove eventual git. prefix
goname = string.gsub(goname, "^git%.", "")
-- add golang prefix
goname = "golang-" .. goname
-- remove FQDN root (.com, .org, etc)
goname = string.gsub(goname, "^([^/]+)%.([^%./]+)/", "%1/")
-- special-case x.y.z number-strings as thats an exception in our naming
-- guidelines
repeat
goname, i = string.gsub(goname, "(%d)%.(%d)", "%1:%2")
until i == 0
-- replace various separators rpm does not like with -
goname = string.gsub(goname, "[%._/%-]+", "-")
-- because of the Azure sdk
goname = string.gsub(goname, "%-for%-go%-", "-")
-- Tokenize along - separators and remove duplicates to avoid
-- golang-foo-foo-bar-foo names
local result = ""
local tokens = {}
tokens["go"] = true
for token in string.gmatch(goname, "[^%-]+") do
if not tokens[token] then
result = result .. "-" .. token
tokens[token] = true
end
end
-- reassemble the string, restore x.y.z runs, convert the vx.y.z
-- Go convention to x.y.z as prefered in rpm naming
result = string.gsub(result, "^-", "")
result = string.gsub(result, ":", ".")
-- some projects have a name that end up in a number, and *also* add release
-- numbers on top of it, keep a - prefix before version strings
result = string.gsub(result, "%-v([%.%d])", "-%1")
print(result)
}
# Map Go information to rpm metadata. This macro will compute default spec
# variable values.
#
# The following spec variable MUST be set before calling the macro:
#
# goipath the packaged Go project import path
#
# The following spec variables SHOULD be set before calling the macro:
#
# forgeurl the project url on the forge, strongly recommended, if it can not
# be deduced from goipath; alternatively, use -u <url>
# Version if applicable, set it with Version: <version>
# tag if applicable
# commit if applicable
#
# The macro will attempt to compute and set the following variables if they are
# not already set by the packager:
#
# goname an rpm-compatible package name derived from goipath
# gosource an URL that can be used as SourceX: value
# gourl an URL that can be used as URL: value
#
# It will delegate processing to the forgemeta macro for:
#
# forgesource an URL that can be used as SourceX: value
# forgesetupargs the correct arguments to pass to %setup for this source
# used by %forgesetup and %forgeautosetup
# archivename the source archive filename, without extentions
# archiveext the source archive filename extensions, without leading dot
# archiveurl the url that can be used to download the source archive,
# without renaming
# scm the scm type, when packaging code snapshots: commits or tags
#
# If the macro is unable to parse your forgeurl value set at least archivename
# and archiveurl before calling it.
#
# Most of the computed variables are both overridable and optional. However,
# the macro WILL REDEFINE %{dist} when packaging a snapshot (commit or tag).
# The previous %{dist} value will be lost. Dont call the macro if you dont
# wish %{dist} to be changed.
#
# Optional parameters:
# -u <url> Ignore forgeurl even if it exists and use <url> instead. Note
# that the macro will still end up setting <url> as the forgeurl
# spec variable if it manages to parse it.
# -s Silently ignore problems in forgeurl, use it if it can be parsed,
# ignore it otherwise.
# -p Restore problem handling, override -s.
# -v Be verbose and print every spec variable the macro sets.
# -i Print some info about the state of spec variables the macro may use or
# set at the end of the processing.
%gometa(u:spvi) %{expand:%{lua:
local forgeurl = rpm.expand("%{?-u*}")
if (forgeurl == "") then
forgeurl = rpm.expand("%{?forgeurl}")
end
-- Be explicit about the spec variables were setting
local function explicitset(rpmvariable,value)
rpm.define(rpmvariable .. " " .. value)
if (rpm.expand("%{?-v}") ~= "") then
rpm.expand("%{echo:Setting %%{" .. rpmvariable .. "} = " .. value .. "\\n}")
end
end
-- Never ever stomp on a spec variable the packager already set
local function safeset(rpmvariable,value)
if (rpm.expand("%{?" .. rpmvariable .. "}") == "") then
explicitset(rpmvariable,value)
end
end
-- All the Go packaging automation relies on goipath being set
local goipath = rpm.expand("%{?goipath}")
if (goipath == "") then
rpm.expand("%{error:Please set the Go import path in the “goipath” variable before calling “gometa”!}")
end
-- Compute and set spec variables
if (forgeurl ~= "") then
rpm.expand("%forgemeta %{?-v} %{?-i} %{?-s} %{?-p} -u " .. forgeurl .. "\\n")
safeset("gourl", forgeurl)
else
safeset("gourl", "https://" .. goipath)
rpm.expand("%forgemeta %{?-v} %{?-i} -s %{?-p} -u %{gourl}\\n")
end
if (rpm.expand("%{?forgesource}") ~= "") then
safeset("gosource", "%{forgesource}")
else
safeset("gosource", "%{gourl}/%{archivename}.%{archiveext}")
end
safeset("goname", "%gorpmname %{goipath}")
rpm.define("gosetup %forgesetup")
-- Final spec variable summary if the macro was called with -i
if (rpm.expand("%{?-i}") ~= "") then
rpm.expand("%{echo:Go-specific packaging variables}")
rpm.expand("%{echo: goipath: %{?goipath}}")
rpm.expand("%{echo: goname: %{?goname}}")
rpm.expand("%{echo: gourl: %{?gourl}}")
rpm.expand("%{echo: gosource: %{?gosource}}")
end}
BuildRequires: compiler(go-compiler)
ExclusiveArch: %{go_arches}
}

View File

@ -1 +0,0 @@
%nim_arches %{ix86} x86_64 %{arm} aarch64 %{power64}

View File

@ -1,11 +0,0 @@
# Note that OCaml is compiled on all architectures. However
# on some (rare) architectures, only bytecode compilation is
# available. Use these macros to find out if native code
# compilation is available on a particular architecture.
# Architectures that support the OCaml native code compiler.
%ocaml_native_compiler aarch64 %{arm} %{ix86} ppc ppc64 ppc64le riscv64 s390x sparc sparcv9 x86_64
# Architectures that support native dynamic linking of OCaml code.
%ocaml_natdynlink aarch64 %{arm} %{ix86} ppc ppc64 ppc64le riscv64 s390x sparc sparcv9 x86_64
# Architectures that support profiling of native code (ocamlopt -p).
%ocaml_native_profiling %{arm} %{ix86} ppc ppc64 ppc64le sparc sparcv9 x86_64

View File

@ -1,31 +0,0 @@
#custom macros
%disable_rpath \
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool \
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%delete_la_and_a \
find $RPM_BUILD_ROOT -type f -name "*.la" -delete \
find $RPM_BUILD_ROOT -type f -name "*.a" -delete
%delete_la find $RPM_BUILD_ROOT -type f -name "*.la" -delete
%chrpath_delete find $RPM_BUILD_ROOT/ -type f -exec file {} ';' | grep "\<ELF\>" | awk -F ':' '{print $1}' | xargs -i chrpath --delete {}
%package_help \
%package help \
Summary: Documents for %{name} \
Buildarch: noarch \
Requires: man info \
\
%description help \
Man pages and other related documents for %{name}.
#%sbin_installinfo_rm bc.info
#%sbin_installinfo_rm bc.info.gz
%install_info() \
/sbin/install-info %1 %{_infodir}/dir || :
%install_info_rm() \
/sbin/install-info --remove %1 %{_infodir}/dir || :

View File

@ -1,2 +0,0 @@
# Architectures that OpenBLAS supports
%openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64 s390x

151
macros.perl Normal file
View File

@ -0,0 +1,151 @@
# Sensible Perl-specific RPM build macros.
#
# Note that these depend on the generic filtering system being in place in
# rpm core; but won't cause a build to fail if they're not present.
#
# Chris Weyl <cweyl@alumni.drew.edu> 2009
# Marcela Mašláňová <mmaslano@redhat.com> 2011
# This macro unsets several common vars used to control how Makefile.PL (et
# al) build and install packages. We also set a couple to help some of the
# common systems be less interactive. This was blatantly stolen from
# cpanminus, and helps building rpms locally when one makes extensive use of
# local::lib, etc.
#
# Usage, in %build, before "%{__perl} Makefile.PL ..."
#
# %{?perl_ext_env_unset}
%perl_ext_env_unset %{expand:
unset PERL_MM_OPT MODULEBUILDRC PERL5INC
export PERL_AUTOINSTALL="--defaultdeps"
export PERL_MM_USE_DEFAULT=1
}
#############################################################################
# Filtering macro incantations
# keep track of what "revision" of the filtering we're at. Each time we
# change the filter we should increment this.
%perl_default_filter_revision 3
# By default, for perl packages we want to filter all files in _docdir from
# req/prov scanning.
# Filtering out any provides caused by private libs in vendorarch/archlib
# (vendor/core) is done by rpmbuild since Fedora 20
# <https://fedorahosted.org/fpc/ticket/353>.
#
# Note that this must be invoked in the spec file, preferably as
# "%{?perl_default_filter}", before any %description block.
%perl_default_filter %{expand: \
%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}^%{_docdir}
%global __requires_exclude_from %{?__requires_exclude_from:%__requires_exclude_from|}^%{_docdir}
%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}^perl\\\\(VMS|^perl\\\\(Win32|^perl\\\\(DB\\\\)|^perl\\\\(UNIVERSAL\\\\)
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\\\(VMS|^perl\\\\(Win32
}
#############################################################################
# Macros to assist with generating a "-tests" subpackage in a semi-automatic
# manner.
#
# The following macros are still in a highly experimental stage and users
# should be aware that the interface and behaviour may change.
#
# PLEASE, PLEASE CONDITIONALIZE THESE MACROS IF YOU USE THEM.
#
# See http://gist.github.com/284409
# These macros should be invoked as above, right before the first %description
# section, and conditionalized. e.g., for the common case where all our tests
# are located under t/, the correct usage is:
#
# %{?perl_default_subpackage_tests}
#
# If custom files/directories need to be specified, this can be done as such:
#
# %{?perl_subpackage_tests:%perl_subpackage_tests t/ one/ three.sql}
#
# etc, etc.
%perl_version %(eval "`%{__perl} -V:version`"; echo $version)
%perl_testdir %{_libexecdir}/perl5-tests
%cpan_dist_name %(eval echo %{name} | %{__sed} -e 's/^perl-//')
# easily mark something as required by -tests and BR to the main package
%tests_req() %{expand:\
BuildRequires: %*\
%%tests_subpackage_requires %*\
}
# fixup (and create if needed) the shbang lines in tests, so they work and
# rpmlint doesn't (correctly) have a fit
%fix_shbang_line() \
TMPHEAD=`mktemp`\
TMPBODY=`mktemp`\
for file in %* ; do \
head -1 $file > $TMPHEAD\
tail -n +2 $file > $TMPBODY\
%{__perl} -pi -e '$f = /^#!/ ? "" : "#!%{__perl}$/"; $_="$f$_"' $TMPHEAD\
cat $TMPHEAD $TMPBODY > $file\
done\
%{__perl} -MExtUtils::MakeMaker -e "ExtUtils::MM_Unix->fixin(qw{%*})"\
%{__rm} $TMPHEAD $TMPBODY\
%{nil}
# additional -tests subpackage requires, if any
%tests_subpackage_requires() %{expand: \
%global __tests_spkg_req %{?__tests_spkg_req} %* \
}
# additional -tests subpackage provides, if any
%tests_subpackage_provides() %{expand: \
%global __tests_spkg_prov %{?__tests_spkg_prov} %* \
}
#
# Runs after the body of %check completes.
#
%__perl_check_pre %{expand: \
%{?__spec_check_pre} \
pushd %{buildsubdir} \
%define perl_br_testdir %{buildroot}%{perl_testdir}/%{cpan_dist_name} \
%{__mkdir_p} %{perl_br_testdir} \
%{__tar} -cf - %{__perl_test_dirs} | ( cd %{perl_br_testdir} && %{__tar} -xf - ) \
find . -maxdepth 1 -type f -name '*META*' -exec %{__cp} -vp {} %{perl_br_testdir} ';' \
find %{perl_br_testdir} -type f -exec %{__chmod} -c -x {} ';' \
T_FILES=`find %{perl_br_testdir} -type f -name '*.t'` \
%fix_shbang_line $T_FILES \
%{__chmod} +x $T_FILES \
%{_fixperms} %{perl_br_testdir} \
popd \
}
#
# The actual invoked macro
#
%perl_subpackage_tests() %{expand: \
%global __perl_package 1\
%global __perl_test_dirs %* \
%global __spec_check_pre %{expand:%{__perl_check_pre}} \
%package tests\
Summary: Test suite for package %{name}\
Group: Development/Debug\
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}\
Requires: /usr/bin/prove \
%{?__tests_spkg_req:Requires: %__tests_spkg_req}\
%{?__tests_spkg_prov:Provides: %__tests_spkg_prov}\
AutoReqProv: 0 \
%description tests\
This package provides the test suite for package %{name}.\
%files tests\
%defattr(-,root,root,-)\
%{perl_testdir}\
}
# shortcut sugar
%perl_default_subpackage_tests %perl_subpackage_tests t/

View File

@ -1,15 +0,0 @@
# Copyright (c) 2012 Petr Pisar <ppisar@redhat.com>.
# This file is distributed under the terms of GNU GPL license version 3, or
# any later version.
# This file contains macros that can be used for building source RPM package
# from git source repository. This file must present in minimal build root to
# take effect.
# This file must not use Perl or any non-minimal-build-root package. The
# purpose is to enable bootstrapping perl.
# Perl bootstrap For rebuild of Perl and all related packages is needed
# switch, which enable only vital build requires. This could help cyclic
# dependencies, for example: perl-Test-Minimum-Version <->
# perl-Perl-Minimum-Version Defined for bootstraping, undefined otherwise.
# Usage: %%if !%%{defined perl_bootstrap} ... %%endif
#%%perl_bootstrap 1

View File

@ -1,19 +0,0 @@
# Note that the path could itself be a python file, or a directory
# Python's compile_all module only works on directories, and requires a max
# recursion depth
# Usage:
# %py_byte_compile <interpereter> <path>
# Example:
# %py_byte_compile %{__python3} %{buildroot}%{_datadir}/spam/plugins/
# This will terminate build on SyntaxErrors, if you want to avoid that,
# use it in a subshell like this:
# (%{py_byte_compile <interpereter> <path>}) || :
%py_byte_compile()\
python_binary="%1"\
bytecode_compilation_path="%2"\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -m py_compile\
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -m py_compile

View File

@ -1,81 +0,0 @@
%py_setup setup.py
%py_shbang_opts -s
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}" %{?*}
sleep 1
}
%py_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python_sitelib}
easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*}
}
%py_install_wheel() %{expand:\\\
pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}
%python_provide() %{lua:
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
package = rpm.expand("%{?1}")
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(package, "python2-")) then
if (rpm.expand("%{?buildarch}") ~= "noarch") then
str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr
print(rpm.expand(str))
end
print("\\nProvides: python-")
print(string.sub(package,9,string.len(package)))
print(" = ")
print(vr)
--Obsoleting the previous default python package
print("\\nObsoletes: python-")
print(string.sub(package,9,string.len(package)))
print(" < ")
print(vr)
elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then
--No unversioned provides as python3 is not default
elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then
--No unversioned provides as python3_other is not default
elseif (string.starts(package, "pypy-")) then
--No unversioned provides as pypy is not default
elseif (string.starts(package, "pypy3-")) then
--No unversioned provides as pypy is not default
elseif (string.starts(package, "python-")) then
--Providing the current default python
print("Provides: python2-")
print(string.sub(package,8,string.len(package)))
print(" = ")
print(vr)
else
print("%python_provide: ERROR: ")
print(package)
print(" not recognized.")
end
}
%python_enable_dependency_generator() \
%global __pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires \
%{nil}

View File

@ -1,107 +0,0 @@
# python3_pkgversion specifies the version of Python 3 in the distro. It can be
# a specific version (e.g. 34 in Fedora EPEL7)
%python3_pkgversion 3
# Set to /bin/true to avoid %ifdefs and %{? in specfiles
%__python3_other /bin/true
%py3_other_build /bin/true
%py3_other_install /bin/true
# === Macros for Build/Requires tags using Python dist tags ===
# - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
# - These macros need to be in macros.python-srpm, because BuildRequires tags
# get rendered as runtime requires into the metadata of SRPMs.
# Converts Python dist name to a canonical format
%py_dist_name() %{lua:\
name = rpm.expand("%{?1:%{1}}");\
canonical = string.gsub(string.lower(name), "[^%w%.]+", "-");\
print(canonical);\
}
# Creates Python 2 dist tag(s) after converting names to canonical format
# Needs to first put all arguments into a list, because invoking a different
# macro (%py_dist_name) overwrites them
%py2_dist() %{lua:\
args = {}\
arg = 1\
while (true) do\
name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\
if (name == nil or name == '') then\
break\
end\
args[arg] = name\
arg = arg + 1\
end\
for arg, name in ipairs(args) do\
canonical = rpm.expand("%py_dist_name " .. name);\
print("python2dist(" .. canonical .. ") ");\
end\
}
# Creates Python 3 dist tag(s) after converting names to canonical format
# Needs to first put all arguments into a list, because invoking a different
# macro (%py_dist_name) overwrites them
%py3_dist() %{lua:\
args = {}\
arg = 1\
while (true) do\
name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\
if (name == nil or name == '') then\
break\
end\
args[arg] = name\
arg = arg + 1\
end\
for arg, name in ipairs(args) do\
canonical = rpm.expand("%py_dist_name " .. name);\
print("python3dist(" .. canonical .. ") ");\
end\
}
# Macro to replace overly complicated references to PyPI source files.
# Expands to the pythonhosted URL for a package
# Accepts zero to three arguments:
# 1: The PyPI project name, defaulting to %srcname if it is defined, then
# %pypi_name if it is defined, then just %name.
# 2: The PYPI version, defaulting to %version.
# 3: The file extension, defaulting to "tar.gz". (A period will be added
# automatically.)
# Requires %__pypi_url and %__pypi_default_extension to be defined.
%__pypi_url https://files.pythonhosted.org/packages/source/
%__pypi_default_extension tar.gz
%pypi_source() %{lua:
local src = rpm.expand('%1')
local ver = rpm.expand('%2')
local ext = rpm.expand('%3')
local url = rpm.expand('%__pypi_url')
\
-- If no first argument, try %srcname, then %pypi_name, then %name
-- Note that rpm leaves macros unchanged if they are not defined.
if src == '%1' then
src = rpm.expand('%srcname')
end
if src == '%srcname' then
src = rpm.expand('%pypi_name')
end
if src == '%pypi_name' then
src = rpm.expand('%name')
end
\
-- If no second argument, use %version
if ver == '%2' then
ver = rpm.expand('%version')
end
\
-- If no third argument, use the preset default extension
if ext == '%3' then
ext = rpm.expand('%__pypi_default_extension')
end
\
local first = string.sub(src, 1, 1)
\
print(url .. first .. '/' .. src .. '/' .. src .. '-' .. ver .. '.' .. ext)
}

View File

@ -1,41 +0,0 @@
%__python2 /usr/bin/python2
%python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
%python2_version_nodots %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
%py2_shbang_opts -s
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py2_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*}
sleep 1
}
%py2_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py2_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py2_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py2_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python2_sitelib}
easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*}
}
%py2_install_wheel() %{expand:\\\
pip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}

View File

@ -1,43 +0,0 @@
%__python3 /usr/bin/python3
%python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())")
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
%py3_shbang_opts -s
# Use the slashes after expand so that the command starts on the same line as
# the macro
%py3_build() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}
sleep 1
}
%py3_build_egg() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py3_build_wheel() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
%py3_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}
%py3_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python3_sitelib}
easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
}
%py3_install_wheel() %{expand:\\\
pip%{python3_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}

View File

@ -1 +0,0 @@
%rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x

2
openEuler-hardened-cc1 Normal file
View File

@ -0,0 +1,2 @@
*cc1_options:
+ %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}

2
openEuler-hardened-ld Normal file
View File

@ -0,0 +1,2 @@
*self_spec:
+ %{!static:%{!shared:%{!r:-pie}}}

2
openEuler-pie-cc1 Normal file
View File

@ -0,0 +1,2 @@
*cc1_options:
+ %{!r:%{!D__KERNEL__:%{!pie:%{!fpic:%{!fPIC:%{!fpie:%{!fPIE:%{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE:%{!shared:%{!static:%{!nostdlib:%{!nostartfiles:-fPIE}}}}}}}}}}}}}}}

2
openEuler-pie-ld Normal file
View File

@ -0,0 +1,2 @@
*self_spec:
+ %{!D__KERNEL__:%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r:%{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}}

2
openeuler-fs-cc1 Normal file
View File

@ -0,0 +1,2 @@
*cc1_options:
+ %{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs:%{!fno-stack-protector:%{!fstack-protector-all:-fstack-protector-strong}}}}}

Binary file not shown.

View File

@ -1,25 +0,0 @@
From b2723527bfbfa90d5fc77bf171a13e934d707471 Mon Sep 17 00:00:00 2001
From: jiangchuangang <jiangchuangang@huawei.com>
Date: Fri, 15 Nov 2019 11:13:48 +0800
Subject: [PATCH] remove -fcf-protection for gcc-7.3.0 x86_64, -fcf-protection require GCC 8.
---
rpmrc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rpmrc b/rpmrc
index 630c8c0..0b516aa 100644
--- a/rpmrc
+++ b/rpmrc
@@ -6,7 +6,7 @@ optflags: i586 %{__global_compiler_flags} -m32 -march=i586 -mtune=generic -fasyn
optflags: i686 %{__global_compiler_flags} -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
optflags: athlon %{__global_compiler_flags} -m32 -march=athlon -fasynchronous-unwind-tables -fstack-clash-protection
optflags: ia64 %{__global_compiler_flags}
-optflags: x86_64 %{__global_compiler_flags} -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
+optflags: x86_64 %{__global_compiler_flags} -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
optflags: alpha %{__global_compiler_flags} -mieee
optflags: alphaev5 %{__global_compiler_flags} -mieee -mcpu=ev5
--
2.19.1

19
rpmrc Normal file
View File

@ -0,0 +1,19 @@
include: /usr/lib/rpm/rpmrc
optflags: i686 %{__global_compiler_flags} -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
optflags: athlon %{__global_compiler_flags} -m32 -march=athlon -fasynchronous-unwind-tables -fstack-clash-protection
optflags: ia64 %{__global_compiler_flags}
optflags: x86_64 %{__global_compiler_flags} -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
optflags: aarch64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection
buildarchtranslate: athlon: i686
buildarchtranslate: geode: i686
buildarchtranslate: pentium4: i686
buildarchtranslate: pentium3: i686
buildarchtranslate: i686: i686
buildarchtranslate: i586: i586
buildarchtranslate: armv7l: armv5tel
buildarchtranslate: armv7hl: armv7hl
buildarchtranslate: armv7hnl: armv7hl