OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Martin Iturbide on March 16, 2018, 08:28:41 pm
-
Hi
I'm going forward making some more RPM installers. I'm doing one for Digger Reloaded.
Everything was going fine until I need to put a file (digger.sco - the score files) on the /home/ directory.
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/bin
mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version}
mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/share/licenses/%{name}-%{version}
mkdir -p $RPM_BUILD_ROOT/@unixroot/home/.config/%{name}
cp -p *.exe $RPM_BUILD_ROOT/@unixroot/usr/bin
cp -p digger.txt $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version}
cp -p readme.txt $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version}
cp -p copyright.txt $RPM_BUILD_ROOT/@unixroot/usr/share/licenses/%{name}-%{version}
cp -p digger.sco $RPM_BUILD_ROOT/@unixroot/home/.config/%{name}
%files
%{_bindir}/*.exe
%doc digger.txt readme.txt
%license copyright.txt
???????????/*.sco
I have no idea what to put on %files so the RPM can grab digger.sco inside the RPM package. (That is where I have the ???????)
Help is welcome.
Regards
-
I notice this line,
cp -p digger.sco $RPM_BUILD_ROOT/@unixroot/home/.config/%{name}
is that right? Seems it should be cp -p digger.sco $RPM_BUILD_ROOT/@home/.config/%{name} at a guess.
-
Hi Dave
What about the stuff at "%files" ?? Any idea how do I reference the digger.sco file? I have no idea what to put there.
Regards
-
Shouldn't the ico be in the same directory with the exe so that any program object would use it?
The sco file is the high scores file. Should not be put in %HOME%/config, perhaps %HOME% or @unixroot/var/games.
Seems digger is not the best program to be adapted to RPM as it expects a DOS environment but since Martin is just playing around, it doesn't matter if it actually runs.
Martin, have you looked at https://fedoraproject.org/wiki/How_to_create_a_GNU_Hello_RPM_package (https://fedoraproject.org/wiki/How_to_create_a_GNU_Hello_RPM_package)? Might be better to start with as it seems RPM is really geared towards having the source.
-
Hi All
Where would an rpm package put any extra game files eg *.DLF, *.DRF?
Regards
Pete
-
Probably @UNIXROOT\usr\lib\game or possibly @UNIXROOT\usr\share\game.
-
Hi.
I need some reference of the syntax that the specs uses to name some of the FHS directories.
I found some here, but no Home references:https://www.gnu.org/prep/standards/html_node/Directory-Variables.html (https://www.gnu.org/prep/standards/html_node/Directory-Variables.html)
But I still haven't found what to put on "%files" for the .sco file to be included in the package. Even if home it is not the right place to locate that file, I still do not know how to include it on the package. What should I use like "%{_bindir}/*.exe" to include the sco file ?
Regards
-
Looks like something along the lines of
%files
%{_bindir}/*.exe
%doc digger.txt readme.txt
%license copyright.txt
%{_localstatedir}/name
%{_localstatedir}/*.sco
untested here as I'm not setup to build packages and perhaps it should just be
%localstatedir
I should add that under *nix, these types of programs seem to create score files and configuration files that belong in %HOME% upon first run rather then installing them.
-
Hi
I'm going forward making some more RPM installers. I'm doing one for Digger Reloaded.
Everything was going fine until I need to put a file (digger.sco - the score files) on the /home/ directory.
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/bin
mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version}
mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/share/licenses/%{name}-%{version}
mkdir -p $RPM_BUILD_ROOT/@unixroot/home/.config/%{name}
cp -p *.exe $RPM_BUILD_ROOT/@unixroot/usr/bin
cp -p digger.txt $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version}
cp -p readme.txt $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version}
cp -p copyright.txt $RPM_BUILD_ROOT/@unixroot/usr/share/licenses/%{name}-%{version}
cp -p digger.sco $RPM_BUILD_ROOT/@unixroot/home/.config/%{name}
%files
%{_bindir}/*.exe
%doc digger.txt readme.txt
%license copyright.txt
???????????/*.sco
I have no idea what to put on %files so the RPM can grab digger.sco inside the RPM package. (That is where I have the ???????)
Help is welcome.
Regards
this spec has some not very clean statements
like you never use rm -rf $RPM_BUILD_ROOT in the install section
%clean does that for you anyway
then you don't have to copy files which you reference later on with %doc or %license, as those %doc or %license copy them to the right location anyway.
look at the macros and then you see what they do.
regards
Silvan
-
Hi
Thanks, I made it work with the %{_localstatedir}.
Maybe, doing it by the book" the score files should be at "/var/games/DiggerReloaded/digger.sco". (this is how I did it on this case)
The nice things is that setting the working directory also as "/var/games/DiggerReloaded/" allows the program to create the INI file on that directory too.(while it uses the .sco file).
It seems to work this way. I still have many doubts on how to put some stuff on the /home/ directory with RPM, but maybe with more practice I will understand.
Regards
-
like you never use rm -rf $RPM_BUILD_ROOT in the install section
%clean does that for you anyway
then you don't have to copy files which you reference later on with %doc or %license, as those %doc or %license copy them to the right location anyway.
look at the macros and then you see what they do.
Hi Silvan.
Can you point me to a spec sample on how to use %clean?
Thanks.
-
Hi
I found on a webpage that they suggest:
%Clean
%if "%{noclean}" == ""
rm -rf $RPM_BUILD_ROOT
%endif
I will check it out.
Regards
-
Hi
I found on a webpage that they suggest:
%Clean
%if "%{noclean}" == ""
rm -rf $RPM_BUILD_ROOT
%endif
I will check it out.
Regards
you don't even need %clean, as when it's not there, then it's done always. else I would use:
%clean
rm -f $(RPM_BUILD_ROOT
like in a lot of our spec.
-
Thanks Silvan I will be trying those on my installers.
I still have some doubts about "BuildArch: i686" which I took from the spec sample I got.
When it should be i686, i386 and/or pentium4 ?
For what I see on the netlabs RPM the majority is i686, and where are no binaries it uses "noarch" (when there are configuration files, icon, text, etc)
In case of this old games should I only stick to "i686" or should I generate also the "petium4" packages?
Regards
-
Hi
Here are the three installers I had created. Those had been built with rpmbuild-bot this time.
Regards