UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStarâ„¢
https://usdx.eu
GNU General Public License v2.0
812 stars 160 forks source link

Making a Debian package #143

Closed andy5995 closed 6 years ago

andy5995 commented 7 years ago

After modifying dists/debian/package_debian.sh, I was able to build a Debian package.

Checking it with lintian yields the following output:

E: ultrastardx: binary-from-other-architecture usr/bin/UltraStarDeluxe E: ultrastardx: unstripped-binary-or-object usr/bin/UltraStarDeluxe W: ultrastardx: hardening-no-relro usr/bin/UltraStarDeluxe E: ultrastardx: changelog-file-missing-in-native-package E: ultrastardx: no-copyright-file E: ultrastardx: description-synopsis-is-empty E: ultrastardx: package-section-games-but-contains-no-game W: ultrastardx: binary-without-manpage usr/bin/UltraStarDeluxe W: ultrastardx: script-not-executable usr/share/UltraStarDeluxe/languages/convert.sh

Is that something you'd like my help with? I use Debian 8 Jessie (amd_64).

basisbit commented 7 years ago

yes, please help this project. I myself have absolutely no knowledge about how to write make/build/packaging scripts for linux targets.

andy5995 commented 7 years ago

I've reduced the number of errors lintian is reporting

W: ultrastardx: hardening-no-relro usr/bin/UltraStarDeluxe E: ultrastardx: changelog-file-missing-in-native-package E: ultrastardx: no-copyright-file E: ultrastardx: description-synopsis-is-empty E: ultrastardx: package-section-games-but-contains-no-game W: ultrastardx: binary-without-manpage usr/bin/UltraStarDeluxe

I don't know yet the best way to fix the message about hardening-no-relro. Any suggestions? https://lintian.debian.org/tags/hardening-no-relro.html

AlexanderS commented 7 years ago

Oh I think this script should be removed. This is not the process for building debian packages. I will try to look into this issue in the next days.

andy5995 commented 7 years ago

I rewrote the script to match it up more with the process for building debian packages.

# package_debian.sh
#
# Package UltraStar for distribution on a Debian system
#
# UltraStar Deluxe
# http://sourceforge.net/projects/ultrastardx/
#
# LICENSE: GPLv2
#

# USDX Home can not have a trailing slash
if [ ! $1 ]; then
  echo "Usage: debian_package.sh <USDX SourceDir Home>"
  echo "  (do not use a trailing slash)"
  exit 1
fi

USDX_HOME=$1

# remove output files from previous installation so unneeded ones won't
# get included with a new package
rm -fr $USDX_HOME/../deb-package
rm -fr $USDX_HOME/../packages

mkdir $USDX_HOME/../packages &&

cd $USDX_HOME &&

make distclean &&

./configure --prefix=/usr --sysconfdir=/etc &&
make &&

# Must be run as root to pass lintian checks. File and directories must
# have a certain ID associated with them
make install DESTDIR=$USDX_HOME/../deb-package

# required to pass lintian check
# Discard symbols from object files.
cd $USDX_HOME/../deb-package &&

strip usr/bin/ultrastardx &&
chmod -x usr/share/ultrastardx/plugins/*
chmod +x usr/share/ultrastardx/languages/convert.sh

mkdir $USDX_HOME/../deb-package/DEBIAN &&

cp $USDX_HOME/dists/debian/ultrastardx.control $USDX_HOME/../deb-package/DEBIAN/control &&

cd $USDX_HOME/.. &&

dpkg-deb --build ./deb-package &&
mv deb-package.deb ./packages/UltraStarDeluxe_1.3.2_amd64.deb &&

rm -fr $USDX_HOME/../deb-package

exit 0

Output of dpkg-deb:

dpkg-deb: building package ultrastardx' in./deb-package.deb'.

Package size: 17008892

lintian reports:

W: ultrastardx: hardening-no-relro usr/bin/ultrastardx E: ultrastardx: changelog-file-missing-in-native-package E: ultrastardx: no-copyright-file E: ultrastardx: description-synopsis-is-empty W: ultrastardx: extra-license-file usr/share/ultrastardx/COPYING.txt W: ultrastardx: duplicate-font-file usr/share/ultrastardx/fonts/DejaVu/DejaVuSans-Bold.ttf also in ttf-dejavu-core W: ultrastardx: duplicate-font-file usr/share/ultrastardx/fonts/DejaVu/DejaVuSans.ttf also in ttf-dejavu-core W: ultrastardx: extra-license-file usr/share/ultrastardx/fonts/DejaVu/LICENSE W: ultrastardx: extra-license-file usr/share/ultrastardx/fonts/FreeSans/COPYING W: ultrastardx: duplicate-font-file usr/share/ultrastardx/fonts/FreeSans/FreeSans.ttf also in fonts-freefont-ttf W: ultrastardx: duplicate-font-file usr/share/ultrastardx/fonts/FreeSans/FreeSansBold.ttf also in fonts-freefont-ttf E: ultrastardx: package-section-games-but-contains-no-game W: ultrastardx: binary-without-manpage usr/bin/ultrastardx

basisbit commented 7 years ago

no need for executable flag on the .usdx files.

basisbit commented 7 years ago

oh, and sorry, if I understand correctly, we can't merge that because of incompatible license (GPLv3).

AlexanderS commented 7 years ago

No, manually building the package contents and calling dpkg-deb is not the usual way to build a package. Normally the source contains a debian/ folder with a rules file and some other files and debuild will call all the required steps. I have some experience building debian packages and will create the required structure.

I am currently trying to get fpc-3.0 into jessie-backports, so that the package itself also could be build with jessie-backports.

andy5995 commented 7 years ago

@basisbit I wasn't intending for a merge until after a complete review. Thanks for pointing out the license issue though, I'll fix that.

@AlexanderS Okay, I won't do anything more with this then. I don't have experience building Debian packages according to their specs, so will absolutely defer to your judgement. :)

AlexanderS commented 7 years ago

Working on this I noticed, that there currently is no supported version of ffmpeg in the debian repositories. ffmpeg-3.2 from jessie-backports (or unstable/testing) is too new and libav-11.8 from jessie (current stable) seems to correspond to something like ffmpeg-2.3 (but it seems, that we only support ffmpeg-2.2 and ffmpeg-2.4). But I think it should be manageable produce the intermediate version.

So there is progress but...

hoehermann commented 7 years ago

While not an ideal solution for everyone, I prefer to compile an ultrastar-compatible ffmpeg version exclusively for use with ultrastar. Offers great flexibility, supports many recent codecs and fixes (e.g. the AV-sync fix). It's actually painless, too.

# confer to https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#GettheDependencies
# get a specific ffmpeg version from git
git clone -b release/2.8 https://github.com/FFmpeg/FFmpeg.git
# configure ffmpeg
# note how we define an installation prefix which does not clash with any preexisting ffmpeg installation
# feel free to adjust the rest of the configuration according to your specific needs
./configure --prefix=/opt/ffmpeg2.8 \
--enable-gpl --enable-nonfree --enable-version3 --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libopus --enable-libfdk-aac --disable-x11grab --enable-bzlib --enable-zlib --enable-pthreads --enable-postproc --enable-avresample --disable-gnutls --disable-libfreetype --disable-librtmp --disable-libopencv --disable-libopenjpeg --disable-libpulse --disable-vaapi --disable-vdpau --disable-avisynth --arch=amd64 --enable-shared --disable-static --disable-doc --disable-outdev=alsa --disable-outdev=oss --disable-outdev=v4l2 --disable-indev=jack --disable-indev=alsa --disable-indev=oss --disable-indev=dv1394 --disable-ffserver
# build ffmpeg
make
# install freshly built ffmpeg
sudo checkinstall --pkgname=ffmpeg2.8 --pkgversion="2.8~git`git rev-parse --short HEAD`" --backup=no --deldoc=yes --fstrans=no --default

# confer to https://github.com/UltraStar-Deluxe/USDX#compiling-on-linuxbsd-using-make
# get ultrastar from git
git clone https://github.com/UltraStar-Deluxe/USDX.git
# configure to compile against custom ffmpeg version
env PKG_CONFIG_PATH=/opt/ffmpeg2.8/lib/pkgconfig/ LDFLAGS=-L/opt/ffmpeg2.8/lib LIBS="-llua5.3 -lswresample" ./configure --prefix=/opt/ultrastardx-git
# build ultrastar
make
# install ultrastar
sudo checkinstall --pkgname=ultrastardx-git --pkgversion="1.3.2~git`git rev-parse --short HEAD`" --backup=no --deldoc=yes --fstrans=no --default --requires="ffmpeg2.8"

# launch ultrastar while using custom ffmpeg version
env LD_LIBRARY_PATH=/opt/ffmpeg2.8/lib /opt/ultrastardx-git/bin/ultrastardx

Note: I did not check if my paths or package names are in terms with the Debian schemes.

AlexanderS commented 7 years ago

Yes, this might be a good "local" solution, but this is not a solution for an official debian package.

AlexanderS commented 7 years ago

Thanks to #235, it should be possible to create a debian package for jessie-backports. I will try it later today or tomorrow.

cRaZy-bisCuiT commented 7 years ago

Hey @AlexanderS !

Actually I can't build with either ffmpeg 3.2.5 from the jessie backports nor using ffmpeg 3.2 (3.2.0) from the sources. The configure script still complains. What's the matter?

Could we make USDX compatible with any 3.2.x version as well as the recent 3.3.1 and 3.3.2?