RPM packaging. Part 4: Packaging Not Tetris 2

In the previous installment we packed the game engine, now we have to do the same with the game if we want to play.

Packaging Not Tetris 2

This is how the SPEC of Not Tetris 2 will be. I put comments to explain the things that differ from what was explained in the previous parts.

This time there is no% build section. This is because the games for LÖVE are ZIP files with the extension .sees it, which contain scripts Moon. Come on, you don't have to compile anything.

Name: nottetris
Version: 2
Release: 0% {? Dist}
Summary: Classic Tetris mixed with physics

# This time we also include the summary in Spanish
Summary (en): Classic Tetris mixed with physics
Group: Amusements / Games

# As it is a script, the system architecture is indifferent to us
BuildArch: noarch

License: ZLIB / libPng
URL: http://stabyourself.net/%name/
Source0: http://stabyourself.net/dl.php?file=%name%version/%name%version-source.zip

# We need these programs to extract the icon from the game launcher
BuildRequires: unzip
BuildRequires: / usr / bin / convert

# The game engine is needed to run it, but not to build the RPM,
# that's why we label it as Requires instead of BuildRequires
Requires: love


% description
Not Tetris 2 is the spiritual successor of the classic Tetris mixed with
physics. The result is a fun spinoff in which blocks are no longer bound to the
usualgrid. Blocks can be rotated and placed at any angle, resulting in a
Complete mess if not careful. And with the newest cutting edge technology, Not
tetris 2 allows line clears when the lines are sufficiently filled. the old
mode is still available for play and is now called Stack.

# We also include the Spanish translation
% description -l is
Not Tetris 2 is the spiritual successor to classic Tetris mixed with physics.
The result is a fun game in which the blocks are no longer limited
to move through the typical grid. Blocks can be rotated and placed in
any angle, resulting in a tremendous mess if not careful.
With the latest technology, Not Tetris 2 allows lines to empty when
they are sufficiently complete. The old mode is still available for
play, and is now called "Stack".


% prep
% setup -qc

# Again we eliminate the end of lines like Windows
sed -i 's / r $ //' * .txt

# We rename the files so that they are more 'GNU style'
mv 'Not Readme.txt' readme.txt
mv 'Not Tetris 2.love'% name.love

# We create an executable
echo -e "#! / bin / shnlove% _datadir /% name /% name.loven">% name

# Create the launcher for the desktop
echo "[Desktop Entry] Type = Application
Version =% version
Encoding = UTF-8
Name = Not Tetris 2
Comment = Classic Tetris mixed with physics
Comment [en] = Classic Tetris mixed with physics
Icon =% _ icons96dir /% name.png
Exec =% name
Terminal = false
StartupNotify = true
Categories = Application; Game; ArcadeGame;
">% name.desktop

# We create an icon for the application, based on an image that the game brings
unzip -p% name.love graphics / title.png | convert - -geometry 96x96% name.png


# We install the necessary files:
% install

# 1. The game data
install -pDm u = rw, go = r% name.love% buildroot% _datadir /% name /% name.love

# 2. The executable
install -pDm u = rwx, go = rx% name% buildroot% _bindir /% name

# 3. The desktop launcher
install -pDm u = rwx, go = rx% name.desktop% buildroot% _desktopdir /% name.desktop

# 4. The icon for the launcher
install -pDm u = rw, go = r% name.png% buildroot% _icons96dir /% name.png


% files

# We indicate that the owner of the files will be root
% defattr (-, root, root)

# We indicate which files are documentation
% doc readme.txt

# We list the 4 files that this package will install
% _bindir /% name
% _datadir /% name /% name.love
% _desktopdir /% name.desktop
% _icons96dir /% name.png

# We also list the data directory so that it is deleted when uninstalling
% _datadir /% name


% changelog
* Fri Nov 18 2011 Jairot Llopis 2-0
-Initial release

Once this is done, we repeat the same operation as with the previous package:

sudo yum-builddep ~ / rpmbuild / SPECS / nottetris.spec
rpmbuild -ba ~ / rpmbuild / SPECS / nottetris.spec

Now you just need to install and play:

sudo yum install ~/rpmbuild/RPMS/x86_64/love-0.7.2-1.fc16.x86_64.rpm ~/rpmbuild/RPMS/noarch/nottetris-2-0.fc16.noarch.rpm

Updates

When we want to update the package, we must increase the number indicated in Release, and include a new entry in the% changelog section. In case the update is because a new version has come out, what we would do would be to increase the number indicated in Version.

Conclusion

This ends the RPM packaging tutorial. It only covers the basics, but I hope you have learned a lot. Once you get the hang of it, you're sure to start packing everything up.

Oh, and as I said at the beginning, be careful, that this game is too hooking!

RPM Packaging Course: Step 1 —, Step 2 —, Step 3 —


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Borisdsp said

    I find it very interesting, thanks for sharing it.
    By the way you could not do another delivery but with .deb files? I would appreciate it so much more.
    All the best

  2.   Let's use Linux said

    I'll try…
    Cheers! Paul.