Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/rpmbuild: refactor specfile for Fedora #3809

Merged
merged 3 commits into from
Jun 5, 2023

Conversation

mochaaP
Copy link
Contributor

@mochaaP mochaaP commented Jun 3, 2023

修复了一些问题:

  • 使用系统的 Lua 5.4 & liblz4 动态链接库 (Fedora Packaging Guidelines 规定)
  • 标识了所有静态依赖的 License
  • 某些放错位置的文件现在在正确的位置
  • 安装 man doc
  • 安装 shell 补全
  • 使用 autochangelog

DRAFT: 未测试 openSUSE, RHEL, Rocky Linux, openEular 等发行版的兼容性,请在用相应发行版的同学贡献和测试一下~

@mochaaP
Copy link
Contributor Author

mochaaP commented Jun 3, 2023

关联 #3808
有部分行为与一般 autom4te 的行为不一致,specfile 里写的奇怪/没用通用 macro 的是为了 workaround.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Association #3808
Some of the behaviors are inconsistent with the general autom4te behavior. The strange/useless general macro written in the specfile is for workaround.

%autochangelog isn't available in openSUSE (provided by rpmautospec)
@mochaaP
Copy link
Contributor Author

mochaaP commented Jun 4, 2023

Test builds up at https://copr.fedorainfracloud.org/coprs/mochaa/xmake/. Seems all good.

@mochaaP mochaaP marked this pull request as ready for review June 4, 2023 09:10
@mochaaP
Copy link
Contributor Author

mochaaP commented Jun 4, 2023

cc @waruqi 請求 review ;)

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


cc @waruqi claim review ;)

# add deps
if has_config "external"; then
+ add_deps "sv"
+ add_deps "tbox"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么加这个,不要去加

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我查了一圈大部分 RPM 发行版没带这两个包,这里的 patch 只是把这两个依赖改成静态了,同样只影响 rpmbuild,就没这个必要去多维护两个包了吧。

Copy link
Member

@waruqi waruqi Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

既然 rpm 发行版没硬性要求走外部依赖。。那就没必要走 external,全默认用内置依赖编译就好了,这里也就不用改,原本 xmake 的库依赖没几个,都非常小,全走内置,编译安装还更稳定,也不会因为 lua 找错版本,编译跪。。。

external 主要是因为,debian 强制要求只能走外部依赖,没办法,才搞得。。

Copy link
Contributor Author

@mochaaP mochaaP Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fedora 这边也是强制的。看 Packaging Guidelines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那两个豁免是因为体量和 stb header 差不多,就直接作为 static 就行,也不用担心更新问题

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waruqi It seemed that the libsv and tbox both have been packaged in Debian repository. Maybe we can do the same in Fedora.
@mochaaP It seemed that you have an Fedora account ? Btw, may I ask that do you have any interest of becoming the Fedora packager? see: https://docs.fedoraproject.org/en-US/package-maintainers/Joining_the_Package_Maintainers/
So you and I can make these packages (libsv, tbox and xmake) available in the Fedora repository.

Ref: https://packages.debian.org/sid/source/libsv
https://packages.debian.org/sid/source/tbox

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@topazus
Yup, that's me.

If you could mentor me (as in the Fedora terms, "sponsor"), I'd be very glad to!

My introduction post was on the devel mailing list months ago, feel free to check it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mochaaP I only became a Fedora packager a few months ago, and am not a Fedora sponsor. So I cannot sponsor and mentor you into the packager group. You could create the package review on redhat bugzilla first, and then find a Fedora sponsor (maybe directly by Email) to let he/she start your first package review and sponsored you into the packager group. For me, Vasiliy Glazov, [email protected] reviewed my first package review and sponsored me. You can also contact other persons, like Vitaly Zaitsev, [email protected] .

Ref: https://docs.fedoraproject.org/en-US/package-maintainers/How_to_Get_Sponsored_into_the_Packager_Group/#how_to_find_a_sponsor
https://lists.fedoraproject.org/archives/list/[email protected]/thread/CWHKVAWESDO3B6FE3BR6GXSXFT2TZTXG/

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mochaaP Or you can just put a post with the package review URL of RHBZ on Fedora devel list, and say that you need a sponsor to review you package. Then someone will take your package review and mentor you.

Copy link
Contributor Author

@mochaaP mochaaP Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on libtbox now.

Blocking: tboox/tbox#214

@mochaaP mochaaP requested a review from waruqi June 4, 2023 14:03
@waruqi waruqi merged commit 01d9cc1 into xmake-io:dev Jun 5, 2023
@waruqi
Copy link
Member

waruqi commented Jun 5, 2023

有一些 build failed 了 。。https://copr.fedorainfracloud.org/coprs/waruqi/xmake/build/6002677/

@mochaaP
Copy link
Contributor Author

mochaaP commented Jun 5, 2023

No matching package to install: 'pkgconfig(lua) >= 5.4'

我看過了,都是已經 eol 的發行版,引導用戶去用 static build 吧。

我開的構建有這些,你可以參考一下:

amazonlinux-2023-aarch64
amazonlinux-2023-x86_64
centos-stream-9-aarch64
centos-stream-9-x86_64
fedora-37-aarch64
fedora-37-x86_64
fedora-38-aarch64
fedora-38-i386
fedora-38-x86_64
fedora-eln-aarch64
fedora-eln-x86_64
fedora-rawhide-aarch64
fedora-rawhide-x86_64
mageia-cauldron-aarch64
mageia-cauldron-x86_64
openeuler-22.03-aarch64
openeuler-22.03-x86_64
opensuse-tumbleweed-aarch64
opensuse-tumbleweed-x86_64
rhel-9-aarch64
rhel-9-x86_64

@waruqi
Copy link
Member

waruqi commented Jun 5, 2023

我看過了,都是已經 eol 的發行版,引導用戶去用 static build 吧。

怎么引导?还是得调整下构建的发行版列表?

@waruqi
Copy link
Member

waruqi commented Jun 5, 2023

改了之后,好多了 https://copr.fedorainfracloud.org/coprs/waruqi/xmake/build/6002723/

mageia-cauldron-aarch64
mageia-cauldron-x86_64

不过这两不行

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I have read that they are all eol releases, guide users to use static build.

How to guide? Or do I have to tweak the build distribution list?

@mochaaP
Copy link
Contributor Author

mochaaP commented Jun 5, 2023

@waruqi 大概是竟态了,按下rebuild就行

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@waruqi It's probably a race, just press rebuild

@mochaaP
Copy link
Contributor Author

mochaaP commented Jun 5, 2023

呃 我又看了一下
估计是 mageia 他们自己的 rpm macro 有问题或者有什么东西没打好,和我们无关

不过还好这个发行版用的人并不多,先禁用吧

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


uh i looked again
It is estimated that there is a problem with mageia's own rpm macro or something is not working properly, it has nothing to do with us

Fortunately, there are not many people using this distribution, so disable it first.

@waruqi
Copy link
Member

waruqi commented Jun 5, 2023

我禁了

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I banned

@mochaaP
Copy link
Contributor Author

mochaaP commented Jul 11, 2023

diff --git a/scripts/rpmbuild/xmake.spec b/scripts/rpmbuild/xmake.spec
index dd4f3b1af..b184b948c 100644
--- a/scripts/rpmbuild/xmake.spec
+++ b/scripts/rpmbuild/xmake.spec
@@ -2,7 +2,7 @@
 %define     use_luajit 0
 
 Name:       xmake
-Version:    2.7.9
+Version:    2.8.1
 Release:    1%{?dist}
 Summary:    A cross-platform build utility based on Lua
 
@@ -53,11 +53,7 @@ rm -rf core/src/{lua,luajit,lua-cjson,lz4,pdcurses}/*/
 
 %build
 %set_build_flags
-./configure --external=yes \
-  --prefix=%{_prefix} \
-  --bindir=%{_bindir} \
-  --libdir=%{_libdir} \
-  --includedir=%{_includedir} \
+%configure --external=yes \
 %if %{use_luajit}
   --runtime=luajit
 %else
@@ -100,6 +96,9 @@ cp -rp xmake \
 %{_mandir}/man1/*.1*
 
 %changelog
+* Tue Jul 11 2023 Zephyr Lykos <[email protected]> - 2.8.1-1
+- Update to 2.8.1
+
 * Sun Jun 04 2023 Zephyr Lykos <[email protected]> - 2.7.9-1
 - Switch to release tarball
 - Use system provided libs if possible

@waruqi
Copy link
Member

waruqi commented Jul 11, 2023

? 是要更新这个 patch ? 你可以直接提 pr 过来

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


? Do you want to update this patch? You can directly submit the pr

@mochaaP
Copy link
Contributor Author

mochaaP commented Jul 11, 2023

? 是要更新这个 patch ? 你可以直接提 pr 过来

key 不在手边,直接发 patch 了
git apply 一下就好

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


? Do you want to update this patch? You can directly submit the pr

The key is not at hand, and the patch is sent directly
Just git apply

@waruqi
Copy link
Member

waruqi commented Jul 11, 2023

改了,你可以直接 github 上 edit 编辑的

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Changed, you can edit directly on github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants