Permission error when building packages

I build a package using custom build method, and failed to build build SRPM. I got some errors below:

I need help to fix these errors.

2 Likes

Please post text as preformatted text not screen shots. Use the </> button.

What are you trying to build?
Which command do you use?
What is the output?

I think you are trying to build a python module that is not supported on python 3.13.

I want to build a noarch package with geosite database and rule sets for sing-box.

Here’s the builder-live.log.gz

My script:

#! /bin/sh -x
pkgname=sing-geosite
DATE=$(curl -s https://api.github.com/repos/SagerNet/${pkgname}/releases/latest | grep -oP -m 1 '"created_at": "\K(.*)(?=T)')
DATE=$(date -d "$DATE" +'%a %b %d %Y')
VERSION=$(curl -s https://api.github.com/repos/SagerNet/${pkgname}/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')

git clone https://github.com/SagerNet/${pkgname}
mv -v ${pkgname} ${pkgname}-${VERSION}
tar czvf ${pkgname}-${VERSION}.tar.gz ${pkgname}-${VERSION}
curl -L -O https://raw.githubusercontent.com/JamesBrosy/rpm-spec-templates/refs/heads/main/sing-box/${pkgname}/${pkgname}.spec
sed -i -e "s/VERSION/$VERSION/g" -e "s/DATE/$DATE/g" ${pkgname}.spec

My spec file:

Name:           sing-geosite
Version:        VERSION
Release:        1%{?dist}
Summary:        Geosite Database and Rule Sets for sing-box

License:        CC-BY-SA-4.0 GPL-3.0-or-later
URL:            https://github.com/SagerNet/%{name}
Source0:        %{name}-%{version}.tar.gz

BuildRequires:  git
Requires:       sing-box, sing-geosite-db, sing-geosite-rule-set
BuildArch:      noarch

%description
Geosite Database and Rule Sets for sing-box

%package        db
Summary:        Geosite Database for sing-box
Requires:       sing-box
BuildArch:      noarch

%description    db
Geosite Database for sing-box

%package        rule-set
Summary:        Geosite Rule Sets for sing-box
Requires:       sing-box
BuildArch:      noarch

%description    rule-set
Geosite Rule Sets for sing-box


%prep
%autosetup


%build


%install
# install sing-geosite-db
git checkout release
install -Dm644 geosite*.db -t %{buildroot}%{_datadir}/sing-box/geosite-db
# install sing-geosite-rule-set
git checkout rule-set
install -Dm644 geosite-*.srs -t %{buildroot}%{_datadir}/sing-box/geosite-rule-set

git checkout main

%files
%license LICENSE

%files db
%license LICENSE
%dir %{_datadir}/sing-box/geosite-db
%{_datadir}/sing-box/geosite-db/*

%files rule-set
%license LICENSE
%dir %{_datadir}/sing-box/geosite-rule-set
%{_datadir}/sing-box/geosite-rule-set/*


%changelog
* DATE SagerNet <contact-sagernet@sekai.icu>
- See GitHub for full changelog

These worked well before, and failed to build today. And I also failed to build my other packages with the same errors.

I don’t know if the copr build system has been updated these days.

Thanks. But I don’t know how to permit selinux mode. :frowning_face:

Obviously, the problem is not with spec file. Buiding failed at the SRPM buiding stage.

copr does get updated, they always announce on the copr mailing list.
It looks like the last change, to drop modularity, was on 23/10/2024.

The routine adding of a new release, f42 in this case, happens every 6 months.

This looks like a common problem, here’s a workaround:

copr edit-package-custom copr_name \
    --name package_name \
    --script /path/to/script \
    --script-chroot fedora-latest-x86_64 \
    --script-builddeps pam
2 Likes

Thank you very much :slight_smile:

well, I think this is a good way, but no the best way to solve this problem, and the official build system has better be updated accordingly

2 Likes

Linking the upstream ticket: Fedora 42 default minimal buildroot has non-working /bin/su · Issue #3631 · fedora-copr/copr · GitHub

1 Like