Package init
This commit is contained in:
parent
39facd00e4
commit
1422a47be1
58
0001-Fix-Bytes-String-for-OCaml-4.06.patch
Normal file
58
0001-Fix-Bytes-String-for-OCaml-4.06.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
From 5c5eff66dfaccb212b8906e769e40633d8b8f5e4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Tue, 13 Feb 2018 08:20:52 +0000
|
||||||
|
Subject: [PATCH] Fix Bytes/String for OCaml 4.06.
|
||||||
|
|
||||||
|
---
|
||||||
|
src/format_ext2_kernel.ml | 4 ++--
|
||||||
|
src/mode_build.ml | 10 ++++++----
|
||||||
|
2 files changed, 8 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
|
||||||
|
index d5d529d..98bff3a 100644
|
||||||
|
--- a/src/format_ext2_kernel.ml
|
||||||
|
+++ b/src/format_ext2_kernel.ml
|
||||||
|
@@ -290,9 +290,9 @@ and read_leshort chan offset =
|
||||||
|
|
||||||
|
and read_string chan offset len =
|
||||||
|
seek_in chan offset;
|
||||||
|
- let buf = String.create len in
|
||||||
|
+ let buf = Bytes.create len in
|
||||||
|
really_input chan buf 0 len;
|
||||||
|
- buf
|
||||||
|
+ Bytes.to_string buf
|
||||||
|
|
||||||
|
and copy_or_symlink_file copy_kernel src dest =
|
||||||
|
if not copy_kernel then
|
||||||
|
diff --git a/src/mode_build.ml b/src/mode_build.ml
|
||||||
|
index 95869cb..b5f5fa6 100644
|
||||||
|
--- a/src/mode_build.ml
|
||||||
|
+++ b/src/mode_build.ml
|
||||||
|
@@ -299,9 +299,10 @@ and update_appliance appliance lines = function
|
||||||
|
(* Determine the [file_type] of [file], or exit with an error. *)
|
||||||
|
and get_file_type file =
|
||||||
|
let chan = open_in file in
|
||||||
|
- let buf = String.create 512 in
|
||||||
|
- let len = input chan buf 0 (String.length buf) in
|
||||||
|
+ let buf = Bytes.create 512 in
|
||||||
|
+ let len = input chan buf 0 (Bytes.length buf) in
|
||||||
|
close_in chan;
|
||||||
|
+ let buf = Bytes.to_string buf in
|
||||||
|
|
||||||
|
if len >= 3 && buf.[0] = '\x1f' && buf.[1] = '\x8b' && buf.[2] = '\x08'
|
||||||
|
then (* gzip-compressed file *)
|
||||||
|
@@ -335,8 +336,9 @@ and get_file_content file buf len =
|
||||||
|
and get_compressed_file_content zcat file =
|
||||||
|
let cmd = sprintf "%s %s" zcat (quote file) in
|
||||||
|
let chan_out, chan_in, chan_err = open_process_full cmd [||] in
|
||||||
|
- let buf = String.create 512 in
|
||||||
|
- let len = input chan_out buf 0 (String.length buf) in
|
||||||
|
+ let buf = Bytes.create 512 in
|
||||||
|
+ let len = input chan_out buf 0 (Bytes.length buf) in
|
||||||
|
+ let buf = Bytes.to_string buf in
|
||||||
|
(* We're expecting the subprocess to fail because we close the pipe
|
||||||
|
* early, so:
|
||||||
|
*)
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
||||||
29
9000-fix-cannot-detect-package-manager-on-openeuler.patch
Normal file
29
9000-fix-cannot-detect-package-manager-on-openeuler.patch
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
From 21d7bb90cbcb1ab71c3d7e660948b92bbf85e5f6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhanghaibo <ted.zhang@huawei.com>
|
||||||
|
Date: Wed, 11 Dec 2019 03:02:27 +0000
|
||||||
|
Subject: [PATCH] supermin:fix cannot detect package manager on openeuler
|
||||||
|
|
||||||
|
---
|
||||||
|
src/ph_rpm.ml | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/ph_rpm.ml b/src/ph_rpm.ml
|
||||||
|
index b0a5eb2..61537ce 100644
|
||||||
|
--- a/src/ph_rpm.ml
|
||||||
|
+++ b/src/ph_rpm.ml
|
||||||
|
@@ -31,10 +31,11 @@ let stringset_of_list pkgs =
|
||||||
|
let fedora_detect () =
|
||||||
|
Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () &&
|
||||||
|
(Config.yumdownloader <> "no" || Config.dnf <> "no") &&
|
||||||
|
- (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos" ] ||
|
||||||
|
+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos"; "openEuler" ] ||
|
||||||
|
try
|
||||||
|
(stat "/etc/redhat-release").st_kind = S_REG ||
|
||||||
|
- (stat "/etc/fedora-release").st_kind = S_REG
|
||||||
|
+ (stat "/etc/fedora-release").st_kind = S_REG ||
|
||||||
|
+ (stat "/etc/openEuler-release").st_kind = S_REG
|
||||||
|
with Unix_error _ -> false)
|
||||||
|
|
||||||
|
let opensuse_detect () =
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
36
README.en.md
36
README.en.md
@ -1,36 +0,0 @@
|
|||||||
# supermin
|
|
||||||
|
|
||||||
#### 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/)
|
|
||||||
39
README.md
39
README.md
@ -1,39 +0,0 @@
|
|||||||
# supermin
|
|
||||||
|
|
||||||
#### 介绍
|
|
||||||
{**以下是码云平台说明,您可以替换此简介**
|
|
||||||
码云是 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/)
|
|
||||||
BIN
supermin-5.1.19.tar.gz
Normal file
BIN
supermin-5.1.19.tar.gz
Normal file
Binary file not shown.
62
supermin.spec
Normal file
62
supermin.spec
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
Name: supermin
|
||||||
|
Version: 5.1.19
|
||||||
|
Release: 9
|
||||||
|
Summary: A tool for building supermin appliances, required by libguestfs
|
||||||
|
License: GPLv2+
|
||||||
|
URL: http://libguestfs.org/
|
||||||
|
Source0: http://libguestfs.org/download/supermin/%{name}-%{version}.tar.gz
|
||||||
|
Patch0001: 0001-Fix-Bytes-String-for-OCaml-4.06.patch
|
||||||
|
Patch9000: 9000-fix-cannot-detect-package-manager-on-openeuler.patch
|
||||||
|
BuildRequires: augeas dietlibc-devel dnf dnf-plugins-core e2fsprogs-devel
|
||||||
|
BuildRequires: findutils gnupg2 grubby hivex kernel ocaml ocaml-findlib-devel
|
||||||
|
BuildRequires: rpm rpm-devel systemd-udev tar
|
||||||
|
BuildRequires: /usr/bin/pod2man /usr/bin/pod2html /usr/sbin/mke2fs
|
||||||
|
Requires: cpio dnf dnf-plugins-core e2fsprogs-libs >= 1.42 findutils
|
||||||
|
Requires: rpm tar util-linux-ng /usr/sbin/mke2fs
|
||||||
|
|
||||||
|
%description
|
||||||
|
Supermin is a tool for building supermin appliances. These are tiny
|
||||||
|
appliances (similar to virtual machines), usually around 100KB in
|
||||||
|
size, which get fully instantiated on-the-fly in a fraction of a
|
||||||
|
second when you need to boot one of them.
|
||||||
|
|
||||||
|
%package help
|
||||||
|
Summary: Man files for supermin
|
||||||
|
Requires: man
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description help
|
||||||
|
This contains man files for the using of supermin.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure --disable-network-tests
|
||||||
|
make -C init CC="diet gcc"
|
||||||
|
%make_build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%make_install
|
||||||
|
|
||||||
|
%check
|
||||||
|
#%ifarch aarch64
|
||||||
|
#export SKIP_TEST_EXECSTACK=1
|
||||||
|
#%endif
|
||||||
|
|
||||||
|
#make check || {
|
||||||
|
# cat tests/test-suite.log
|
||||||
|
# exit 1
|
||||||
|
#}
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc examples/build-basic-vm.sh README
|
||||||
|
%license COPYING
|
||||||
|
%{_bindir}/*
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%{_mandir}/man1/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Feb 14 2020 Ling Yang <lingyang2@huawei.com> - 5.1.19-9
|
||||||
|
- Package Initialization
|
||||||
Loading…
x
Reference in New Issue
Block a user