Hey all,
First off, let me just get this out of the way: Not looking to get this package into the repo's or even into RPMFusion, I'm just playing around to help myself learn and I had this on hand.
Trying to package Minecraft (which comes as a single Minecraft.jar), a desktop file for minecraft, and an icon file.
Minecraft.jar, minecraft.desktop and minecraft.png are just sitting in my SOURCES directory. When I run: "rpmbuild -ba Minecraft.spec" I get yelled at about:
File not found: /home/egriffith/rpmbuild/BUILDROOT/Minecraft-1.0-1.fc21.x86_64/usr/bin/Minecraft.jar
File not found: /home/egriffith/rpmbuild/BUILDROOT/Minecraft-1.0-1.fc21.x86_64/usr/share/applications/minecraft.desktop
File not found: /home/egriffith/rpmbuild/BUILDROOT/Minecraft-1.0-1.fc21.x86_64/usr/share/icons/hicolor/256x256/apps/minecraft.png
Go check out the BUILDROOT directory and its blank. Fair enough, I didn't tell it to copy or create anything, so I'm not surprised.
I'm assuming that i should be creating the directory structure under %prep, yes? via "mkdir -p" but wouldn't it then get deleted when %install happened? and what would even be the correct command sequence? $RPM_BUILD_ROOT/%{_bindir}/ ? then copy %source0 into said directory?
The spec file is copied below
[BEGIN SPEC FILE] Name: Minecraft Version: 1.0 Release: 1%{?dist} Summary: Sandbox adventure game by Mojang AB
License: Mojang Minecraft EULA URL: https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar Source0: Minecraft.jar Source1: minecraft.desktop Source2: minecraft.png
BuildRequires: java Requires: java
%description "Java based Sandbox adventure game written by Mojang AB."
%prep
%build
%install rm -rf $RPM_BUILD_ROOT
%files %{_bindir}/Minecraft.jar %{_prefix}/share/applications/minecraft.desktop %{_prefix}/share/icons/hicolor/256x256/apps/minecraft.png
%changelog * Sun Mar 1 2015 Eric Griffith - [END OF SPEC FILE]
Any help would be appreciated guys & gals. As I said, I'm just trying to learn and experiment with different things.
On Mon, Mar 02, 2015 at 04:46:47PM -0500, Eric Griffith wrote:
Hey all,
First off, let me just get this out of the way: Not looking to get this package into the repo's or even into RPMFusion, I'm just playing around to help myself learn and I had this on hand.
[snip]
I'm assuming that i should be creating the directory structure under %prep, yes? via "mkdir -p" but wouldn't it then get deleted when %install happened? and what would even be the correct command sequence? $RPM_BUILD_ROOT/%{_bindir}/ ? then copy %source0 into said directory?
%prep is for preparing to build. So things like untarring source files and applying patches.
%build is for actually building.
%install is for putting things into the %{buildroot} (aka $RPM_BUILD_ROOT).
So in your example, since there is no source (you're just dropping the files you retrieved into the filesystem), you'd want to do your mkdir -p and cp -p SOURCEFILE %{buildroot}/DESTINATION_DIR/FILENAME in %install.
-Toshio
packaging@lists.fedoraproject.org