Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

make a Debian package #210

Open
andy5995 opened this issue Sep 7, 2018 · 6 comments
Open

make a Debian package #210

andy5995 opened this issue Sep 7, 2018 · 6 comments

Comments

@andy5995
Copy link
Contributor

andy5995 commented Sep 7, 2018

make a .deb ZetaGlest package

@andy5995 andy5995 self-assigned this Sep 7, 2018
@andy5995 andy5995 added this to To do in Linux Distro packaging via automation Sep 7, 2018
@linux-player9
Copy link

How can I make a debian package of ZetaGlest from source with make or cmake ?

@andy5995
Copy link
Contributor Author

andy5995 commented Sep 10, 2018

You can do it this way, but I haven't reviewed the cmakelists.txt files so I don't know if the *.deb package will contain everything required.

From the zetaglest-source/ top directory

mkdir build
cd build
cmake ..
make package

You can speed up the build by using make -j? where ? is the number of cpu cores your PC has, plus 1. So if you have 4 cores, then make -j5 package.

@andy5995 andy5995 added this to the 0.8.02 milestone Sep 10, 2018
@linux-player9
Copy link

Ok thanks, I will try.
Where should I place the zetaglest-data folder ? Or how can I tell the compiler where zetaglest should search the data ?

@andy5995
Copy link
Contributor Author

that's a bit broken right now. I made some changes a while back, and now I don't know how to fix them without breaking the Windows build. The ticket for that is #110 and we won't actually be able to do a release without that fixed.

But when that is fixed, the way to specify where to search for the data is passing an option when cmake is run. You can see available options by using

zetaglest-source/build$ cmake -LH ..

You'll see this option: ZETAGLEST_DATA_INSTALL_PATH:STRING=share/zetaglest/

So to specify where the zetaglest binary will look for data at runtime, you'd use

ZETAGLEST_DATA_INSTALL_PATH=/usr/share/zetaglest

some distros might prefer a different path for data, but on Debian that's the path to use if you want to specify an installation for all users.

To install without root privileges, one could do something like

ZETAGLEST_DATA_INSTALL_PATH=$HOME/local/data

and use this to install the binary package

ZETAGLEST_BIN_INSTALL_PATH=$HOME/local/bin

So after those options are passed to cmake and make is run, make install would install things to those directories.

The best way to create a Debian package (or for any distro), you use install paths like that, but when you run make install, you use DESTDIR

https://cmake.org/cmake/help/latest/envvar/DESTDIR.html

That will still build the program with the paths you specify, but it will put everything into a temp directory. Once that's done, you compress the package using dpkg (or rpm packaging tool) to make it into a distro-specific package.

What should happen when ZETAGLEST_DATA_INSTALL_PATH=/usr/share/zetaglest is used is that the path specified gets "hard-coded" in the ZG source during compilation, so when it is run, it will look for data in that directory. Unfortunately a patch I did a while back broke that because now it looks for these 7 files in the paths I specified here

https://github.com/ZetaGlest/zetaglest-source/blob/2a97657e54d9c89639d66bcb17eee47e075e0f63/mk/linux/glest.ini#L104

@andy5995
Copy link
Contributor Author

ok, I commited some changes.

From the top zetaglest-source directory:

  • mkdir build
  • cd build
  • cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local -DZETAGLEST_DATA_INSTALL_PATH=$HOME/local/data/zetaglest
  • make
  • make install

for the data path, Instead of specifying the path to the data, I used an empty directory.

After the installed, I cd'ed to that directory then used, which created symlinks to my existing data.

~/local/data/zetaglest$ ln -s ~/src/ZetaGlest/zetaglest-data/* .

There will still be some kinks to work out. For instance, I didn't test yet as root, or by specifying no paths at all.

As I work on this more, I'll create some formal documentation.

andy5995 added a commit that referenced this issue Sep 15, 2018
[skip ci] #210

These are edited files I extracted from megaglest_3.12.0-2.debian.tar.xz
downloaded from https://packages.debian.org/stretch/megaglest
@andy5995 andy5995 moved this from To do to In Progress in Linux Distro packaging Sep 16, 2018
@andy5995
Copy link
Contributor Author

andy5995 commented Oct 2, 2018

While it will be easy to make a Debian package, getting it into the Debian repo anytime soon is not likely, as far as I know. According to the Debian guidelines, one must be a member of the Debian team to submit a package. We can, however, offer the debian package as a download.

@andy5995 andy5995 removed their assignment Oct 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Linux Distro packaging
  
In Progress
Development

No branches or pull requests

2 participants