locally built rpm, added to local repo, not found by 'dnf' ?
by PGNet Dev
i've locally built an rpm on F32 with `rpmbuild`.
it installs fine via `rpm -Uvh`.
i've created/enabled a local repo, cp'd the rpm to the local store, and rebuilt the metadata cache.
'dns' sees the enabled repo, but fails to find my package in local repo, or act on it, e.g., to install.
this is what I see so far:
mkdir -p /usr/local/LOCAL_REPO/nginx-mainline
cp -af \
/root/rpmbuild/RPMS/compat-luarocks-v3.3.1-1.fc32.x86_64.rpm \
/usr/local/LOCAL_REPO/nginx-mainline/
cat /etc/yum.repos.d/nginx-mainline-local.repo
[nginx-mainline-local]
enabled=1
name=nginx-mainline-local
baseurl=file:///usr/local/LOCAL_REPO/nginx-mainline
type=rpm
gpgcheck=0
repo_gpgcheck=0
createrepo /usr/local/LOCAL_REPO/nginx-mainline
tree /usr/local/LOCAL_REPO/nginx-mainline
/usr/local/LOCAL_REPO/nginx-mainline
├── compat-luarocks-v3.3.1-1.fc32.x86_64.rpm
└── repodata
├── 1cb61ea996355add02b1426ed4c1780ea75ce0c04c5d1107c025c3fbd7d8bcae-primary.xml.gz
├── 21324a08c18bd53275b5fcd1dd7bc626ed8047f3ac4d26fd0b0d3676a051ce50-primary.sqlite.bz2
├── 87adbcf16161d5539b35e41ab2265b01ad190018e7b02b12455c0b881971e9e5-filelists.sqlite.bz2
├── 95a4415d859d7120efb6b3cf964c07bebbff9a5275ca673e6e74a97bcbfb2a5f-filelists.xml.gz
├── d16e93ab5919df03a0e6dcbc6f544c2cbced38a6f596dbf4187d5d86834eee83-other.sqlite.bz2
├── ef3e20691954c3d1318ec3071a982da339f4ed76967ded668b795c9e070aaab6-other.xml.gz
└── repomd.xml
dnf --disablerepo="*" --enablerepo="nginx-mainline-local" clean metadata
Cache was expired
0 files removed
dnf --disablerepo="*" --enablerepo="nginx-mainline-local" makecache -v
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.2.23
cachedir: /var/cache/dnf
Making cache files for all metadata files.
nginx-mainline-local: has expired and will be refreshed.
repo: downloading from remote: nginx-mainline-local
nginx-mainline-local 251 kB/s | 257 B 00:00
nginx-mainline-local: using metadata from Sun 28 Jun 2020 10:42:29 AM PDT.
User-Agent: constructed: 'libdnf (Fedora 32; generic; Linux.x86_64)'
Completion plugin: Generating completion cache...
Metadata cache created.
dnf repolist nginx-mainline-local
repo id repo name status
nginx-mainline-local nginx-mainline-local enabled
dnf info compat-luarocks
Last metadata expiration check: 0:00:27 ago on Sun 28 Jun 2020 12:09:37 PM PDT.
Error: No matching Packages to list
can't see it, can't install it :-/
what have I missed in the process?
3 years, 5 months
install/remove lua rocks in rpm spec's '%post'/'%preun' scriplets.
'reinstall' != 'remove' + 'install' ?
by PGNet Dev
I've a .spec, building luarocks
https://pastebin.com/6DA94Ump
reading,
PackagingDrafts/Lua : Rocks
https://fedoraproject.org/wiki/PackagingDrafts/Lua#Rocks
per the tentative stmt there,
"Upstream Lua developers increasingly use LuaRocks to distribute their modules. We are exploring providing better integration with LuaRocks in the future -- both in generating spec files from .rockspec specifications, and in shipping a luarocks package that can pick up existing RPM-installed Lua packages, but for the time being, you can use upstream rockspec specifications to guide your packaging work."
my spec's currently configured to install the pkg as an rpm, & 4 rocks to be installed _by_ the just-installed 'luarocks'
atm,
(1) install works.
(2) remove works.
(3) reinstall fails, running scriptlets out of expected order
TL;DR:
'reinstall' != 'remove' + 'install
I'm trying to fix the reinstall stage.
The spec contain a '%post' scriplet for rock installation
...
%post
for r in %{rocks_list}
do
echo "##!! Installing rock: ${r}"
luarocks install --force-fast ${r} CFLAGS="%{_CFLAGS}"
done
...
and '%preun' for rock removal
...
%preun
for r in %{rocks_list}
do
if [[ $( luarocks list --porcelain ${r} | cut -f1 ) == ${r} ]]
then
echo "##!! Removing rock: ${r}"
luarocks remove --force-fast --deps-mode=none ${r}
fi
done
...
checking stages,
@ (1), install
prior to install
tree /usr/lib/luarocks/ -L 3
/usr/lib/luarocks/
└── rocks-5.1
└── manifest
on install
dnf install compat-luarocks
...
Transaction Summary
...
##!! Installing rock: luasocket
Installing https://luarocks.org/luasocket-3.0rc1-2.src.rock
luasocket 3.0rc1-2 is now installed in /usr (license: MIT)
...
##!! Installing rock: luasec
Warning: falling back to wget - install luasec to get native HTTPS support
Installing https://luarocks.org/luasec-0.9-1.src.rock
luasec 0.9-1 is now installed in /usr (license: MIT)
...
##!! Installing rock: lua-resty-lrucache
Installing https://luarocks.org/lua-resty-lrucache-0.09-2.src.rock
lua-resty-lrucache 0.09-2 is now installed in /usr (license: 2bsd)
...
##!! Installing rock: lua-resty-core
Installing https://luarocks.org/lua-resty-core-0.1.17-4.src.rock
lua-resty-core 0.1.17-4 is now installed in /usr (license: BSD)
Installed:
compat-luarocks-v3.3.1-1.fc32.x86_64
Complete!
verifying
luarocks --version
/usr/bin/luarocks 3.3.1
LuaRocks main command-line interface
luarocks list --porcelain
lua-resty-core 0.1.17-4 installed /usr/lib/luarocks/rocks-5.1
lua-resty-lrucache 0.09-2 installed /usr/lib/luarocks/rocks-5.1
luasec 0.9-1 installed /usr/lib/luarocks/rocks-5.1
luasocket 3.0rc1-2 installed /usr/lib/luarocks/rocks-5.1
tree /usr/lib/luarocks/ -L 3
/usr/lib/luarocks/
└── rocks-5.1
├── lua-resty-core
│ └── 0.1.17-4
├── lua-resty-lrucache
│ └── 0.09-2
├── luasec
│ └── 0.9-1
├── luasocket
│ └── 3.0rc1-2
└── manifest
@ (2), remove
on remove
dnf remove compat-luarocks
...
##!! Removing rock: luasocket
Removing luasocket 3.0rc1-2...
Removal successful.
...
##!! Removing rock: luasec
Removing luasec 0.9-1...
Removal successful.
...
##!! Removing rock: lua-resty-lrucache
Removing lua-resty-lrucache 0.09-2...
Removal successful.
...
##!! Removing rock: lua-resty-core
Removing lua-resty-core 0.1.17-4...
Removal successful.
Removed:
compat-luarocks-v3.3.1-1.fc32.x86_64
Complete!
verifying
luarocks --version
/usr/bin/luarocks: No such file or directory
tree /usr/lib/luarocks/ -L 3
/usr/lib/luarocks/
└── rocks-5.1
└── manifest
@ (3), reinstall
1st, install
dnf install compat-luarocks
(... as above, in (1) ...)
tree /usr/lib/luarocks/ -L 3
/usr/lib/luarocks/
└── rocks-5.1
├── lua-resty-core
│ └── 0.1.17-4
├── lua-resty-lrucache
│ └── 0.09-2
├── luasec
│ └── 0.9-1
├── luasocket
│ └── 3.0rc1-2
└── manifest
now **reinstall**
dnf reinstall compat-luarocks
correctly starts the transaction, installing all the rocks, as in the 'install' stage,
...
Running transaction
Preparing : 1/1
Reinstalling : compat-luarocks-v3.3.1-1.fc32.x86_64 1/2
Running scriptlet: compat-luarocks-v3.3.1-1.fc32.x86_64 1/2
##!! Installing rock: luasocket
Installing https://luarocks.org/luasocket-3.0rc1-2.src.rock
luasocket 3.0rc1-2 is now installed in /usr (license: MIT)
##!! Installing rock: luasec
Installing https://luarocks.org/luasec-0.9-1.src.rock
luasec 0.9-1 is now installed in /usr (license: MIT)
##!! Installing rock: lua-resty-lrucache
Installing https://luarocks.org/lua-resty-lrucache-0.09-2.src.rock
lua-resty-lrucache 0.09-2 is now installed in /usr (license: 2bsd)
##!! Installing rock: lua-resty-core
Installing https://luarocks.org/lua-resty-core-0.1.17-4.src.rock
lua-resty-core 0.1.17-4 is now installed in /usr (license: BSD)
but then *immmediately* continues to REMOVE the rocks,
Running scriptlet: compat-luarocks-v3.3.1-1.fc32.x86_64 2/2
##!! Removing rock: luasocket
Removing luasocket 3.0rc1-2...
Removal successful.
Missing dependencies for luasec 0.9-1:
luasocket (not installed)
##!! Removing rock: luasec
Removing luasec 0.9-1...
Removal successful.
##!! Removing rock: lua-resty-lrucache
Removing lua-resty-lrucache 0.09-2...
Removal successful.
Missing dependencies for lua-resty-core 0.1.17-4:
lua-resty-lrucache (not installed)
##!! Removing rock: lua-resty-core
Removing lua-resty-core 0.1.17-4...
Removal successful.
Cleanup : compat-luarocks-v3.3.1-1.fc32.x86_64 2/2
Running scriptlet: compat-luarocks-v3.3.1-1.fc32.x86_64 2/2
Verifying : compat-luarocks-v3.3.1-1.fc32.x86_64 1/2
Verifying : compat-luarocks-v3.3.1-1.fc32.x86_64 2/2
Reinstalled:
compat-luarocks-v3.3.1-1.fc32.x86_64
Complete!
leaving me with the *package* installed
rpm -qa | grep -i luarocks
compat-luarocks-v3.3.1-1.fc32.x86_64
luarocks --version
/usr/bin/luarocks 3.3.1
LuaRocks main command-line interface
but the rocks themselves UNinstalled/missing,
tree /usr/lib/luarocks/ -L 3
/usr/lib/luarocks/
└── rocks-5.1
└── manifest
luarocks list --porcelain
(empty)
It's clear that, in this^ example
reinstall != remove + install
In the same vein as
restart == (typically) stop + start
, shouldn't it?
If not, what's causing the %preun removal to exec AFTER the %post install?
And, how do I prevent that?
3 years, 5 months
mock and kernel-rpm-macros package
by Quentin Barnes
I author a kmod rpm package that uses the %kernel_module_package
macro. That macro used to be in the /usr/lib/rpm/redhat/macros
file, but was moved in RHEL 8 and later versions of Fedora to
the /usr/lib/rpm/macros.d/macros.kmp file which is owned by the
"kernel-rpm-macros" package.
If I attempt to build my packages on these later systems with mock,
they break imediately even when just trying to create the srpm
because the %kernel_module_package macro is undefined leading to
a spec file parse error.
What I need help with is understanding where the bug is and the best
way to fix it.
I would think that either: 1) my spec file needs to be updated in
some way to mitigate this change, or 2) the "kernel-rpm-macros"
package needs to be added to the @buildsys-build group for Fedora
(or added to the "config_opts['chroot_setup_cmd']=..." cfg line for
CentOS/RHEL).
For now, I've just been hacking mock cfg files to workaround this
issue.
What are people's thoughts on this problem?
If I do need to tweak the spec file, if someone could point me to
an example of how, that would be appreciated.
Quentin
3 years, 5 months