RPM limitations

I know that RPMs generally can’t install anything directly inside of /home, but is this a restriction built into dnf or baked into RPM itself? I want to write a package manager that installs to the home directory(similar to pip) and I know very little about packaging formats in general(the only experience I have is with RPM and barely with deb), but as far as I can tell RPM looks like a good candidate(other than the /home thing), unless there is something that I’m missing.

I suspect you need to build it as a relocatable package, and use the “–prefix” option to specify in which home directory you need tht package installed. You google for the text “making a relocatable package rpm” for further information.

I think its a convention not to use /home that RPM will not enforce.

You could try it and see with a simple RPM you create.

You could also consider installing into /opt or /usr/local which is less surprising.

Or are you expect to have more then one user on a system install conflicting packages?

The idea was a Minecraft mod package manager. It makes the most sense to me to store the mods and associated files in somewhere like ~/.cache or ~/.local with mcmpm install mod, then to symlink the mod into ~/.minecraft/mods with mcmpm load mod. I wanted it to support things like resource packs, shaders, etc, so I’m not sure if conflicts would arise between users but I doubt it.

It doesn’t make much sense to me to install to a location outside of the home directory, just because these aren’t independent programs, they’re modifications for an existing program. I honestly want to follow some convention to do this properly, perhaps it would make sense to install to a subdirectory of /etc? Not entirely sure…

I’ll make an RPM and try to install to /home, see how that pans out.

Thank you, I’ll look into it.

/etc is a poor choice as it is for admin’s to configure the system.
/usr/share/ is a better choice.

Makes sense, only problem is outside of /home it needs to be invoked with sudo, but I suppose that means all the downloaded content can be shared between users. Still, I’m barely just beginning learning rust led alone coding a pm, so still exploring different options.

If your intent is to package individual mods, those should be installed somewhere in /usr. If you want to allow downloading mods outside of RPM, then those could be installed into the home directory. Consider as an example gnome-shell-extension-* packages vs extensions downloaded from extensions.gnome.org installed into ~/.local/share/gnome-shell/extensions

If you need to make symlinks (etc.) in ~, you can package a wrapper script for minecraft.