Git Repositories

README.Salix in the SLKBUILD, ImageMagick to convert the .ico to multiple png, Sub...
authorCyrille Pontvieux <jrd@enialis.net>
Tue, 11 Feb 2014 23:40:50 +0000 (00:40 +0100)
committerCyrille Pontvieux <jrd@enialis.net>
Tue, 11 Feb 2014 23:40:50 +0000 (00:40 +0100)
stepmania/14.1/5-beta2a/README.salix [deleted file]
stepmania/14.1/5-beta2a/SLKBUILD
stepmania/14.1/5-beta2a/makedep

diff --git a/stepmania/14.1/5-beta2a/README.salix b/stepmania/14.1/5-beta2a/README.salix
deleted file mode 100644 (file)
index a60e5b3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-You can install your custom songs in
-  ~/.local/share/@XDGDIR@/Songs/
-All others data files are in
-  ~/.local/share/@XDGDIR@/
-Your configuration can be found in
-  ~/.config/@XDGDIR/
-Your cache files can be found in
-  ~/.cache/@XDGDIR@/
-
-A smzip binary is provided to you to easy install .smzip files.
-Just pass it as argument or open it with smzip in your file manager.
-
-/!\ Don't try to associate .smzip file with smzip, as there are just regular zip files,
---- and so all your .zip file will further open with smzip. I bet that's not what your want.
index a5664f6..3cce88f 100644 (file)
@@ -5,9 +5,9 @@ pkgname=stepmania
 pkgver=5.beta2a
 pkgrel=1cp
 
-source=(https://github.com/$pkgname/$pkgname/archive/SM$(echo $pkgver|sed -r 's/^(.)\.(.*)/\1-\2/').tar.gz README.salix)
+source=(https://github.com/$pkgname/$pkgname/archive/SM$(echo $pkgver|sed -r 's/^(.)\.(.*)/\1-\2/').tar.gz)
 sourcetemplate=http://people.salixos.org/jrd/salix/$pkgname/$pkgver-\$arch-$pkgrel/
-docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "README.salix")
+docs=("README.Salix")
 url=http://stepmania.com
 
 slackdesc=\
@@ -20,7 +20,8 @@ slackdesc=\
 )
 
 build() {
-  cd $SRC/$pkgname-SM$(echo $pkgver|sed -r 's/^(.)\.(.*)/\1-\2/') || return 1
+  set -e
+  cd $SRC/$pkgname-SM$(echo $pkgver|sed -r 's/^(.)\.(.*)/\1-\2/')
   # Patch ArchHooks_Unix.cpp to specify correct locations for data, config and cache files
   xdgdir=$pkgname-$(echo $pkgver|sed -r 's/^(.)\..*/\1/')
   sed -ri '
@@ -32,9 +33,8 @@ build() {
       };
     \@"/Cache"@s@sUserDataPath \+ "/Cache"@sUserCachePath@;
     \@"/Save"@s@sUserDataPath \+ "/Save"@sUserConfigPath@;
-  ' src/arch/ArchHooks/ArchHooks_Unix.cpp || return 1
-  sed -i "s/@XDGDIR@/$xdgdir/g" $SRC/README.salix
-  ./autogen.sh || return 1
+  ' src/arch/ArchHooks/ArchHooks_Unix.cpp
+  ./autogen.sh
   ./configure \
     --prefix=/usr \
     --libdir=/usr/lib${LIBDIRSUFFIX} \
@@ -43,10 +43,10 @@ build() {
     --enable-lua-binaries \
     --with-fast-compile \
     --with-sse2 \
-    --build=$arch-slackware-linux || return 1
+    --build=$arch-slackware-linux
   # lua build requires ncurses that 'configure' didn't put in the Makefile
   for m in Makefile src/Makefile; do
-    sed -ri 's/^LIBS = (.*)/LIBS = \1 -lncurses/' $m || return 1
+    sed -ri 's/^LIBS = (.*)/LIBS = \1 -lncurses/' $m
   done
   # DESTDIR not used in Makefile, so it should be added
   sed -i '
@@ -60,43 +60,168 @@ build() {
       n; s,\$(prefix)/\$(productID),$(DESTDIR)/$(datadir)/stepmania,;
       n; s,\$(prefix)/\$(productID),$(DESTDIR)/$(datadir)/stepmania,;
     };
-  ' Makefile || return 1
-  make -j $numjobs || return 1
-  make install DESTDIR=$PKG || return 1
-  install -d $PKG/usr/bin || return 1
+  ' Makefile
+  make -j $numjobs
+  make install DESTDIR=$PKG
+  mkdir -p $PKG/usr/bin
   cat <<'EOF' > $PKG/usr/bin/$pkgname
 #!/bin/sh
 cd /usr/libexec/stepmania && exec ./stepmania "$@"
 EOF
-  cat <<EOF > $PKG/usr/bin/smzip
+  cat <<EOF > $PKG/usr/bin/smzip-installer
 #!/bin/sh
 if [ -z "\$1" ]; then
   echo "Install a smzip package for Stepmania." >&2
   echo "Usage: smzip package.smzip" >&2
   exit 1
 fi
-if ! [ -r "\$1" ] || ! echo "\$1"|grep -q '\.smzip\$'; then
+if ! [ -r "\$1" ] || ! echo "\$1"|grep -q '\.smzip\$' || ! file "\$1"|grep -q 'Zip archive data'; then
   notify-send -i error "Stepmania Smzip installer" "<b>\$1</b> is not a smzip readable file"
   exit 1
 fi
 PKG=\$(readlink -f "\$1")
 NAME=\$(basename "\$PKG")
-cd ~
-mkdir -p .local/share/$xdgdir
-cd .local/share/$xdgdir
-unzip "\$PKG" \
+mkdir -p ~/.local/share/$xdgdir/Packages
+cp "$PKG" ~/.local/share/$xdgdir/Packages/ \
   && notify-send -i $pkgname-ssc "Stepmania Smzip installer" "<b>\$NAME</b> installed" \
   || (notify-send -i error "Stepmania Smzip installer" "<b>\$NAME</b> failed"; exit 1)
 EOF
   chmod +x $PKG/usr/bin/*
-  mkdir -p $PKG/usr/share/applications || return 1
-  cp -r icons $PKG/usr/share/ || return 1
-  install -t $PKG/usr/share/applications $pkgname.desktop || return 1
-  # games group can modify this content. Users should still modify Stepmania using their own ~/.local/share/stepmania-5 directory
-  chown -R :games $PKG/usr/share/stepmania/* || return 1
-  chmod -R g+rwX $PKG/usr/share/stepmania/* || return 1
+  # documentation
+  mkdir -p $PKG/usr/doc/$pkgname-$pkgver
+  cat <<EOF > $SRC/README.Salix
+You can install your custom songs in
+  ~/.local/share/$xdgdir/Songs/
+All others data files are in
+  ~/.local/share/$xdgdir/
+Your configuration can be found in
+  ~/.config/$xdgdir/
+Your cache files can be found in
+  ~/.cache/$xdgdir/
+
+A smzip-installer binary is provided to you to easy install .smzip files.
+Just pass it as argument or open your smzip with smzip-installer in your file manager.
+
+/!\ Don't try to associate .smzip file with smzip-installer, as there are just regular zip files,
+--- and so all your .zip file will further open with smzip-installer. I bet that's not what your want.
+EOF
+  mv $PKG/usr/share/stepmania/Docs/* $PKG/usr/doc/$pkgname-$pkgver/
+  cp -r Manual $PKG/usr/doc/$pkgname-$pkgver/
+  # Delete windows stuff
+  rm -rf $PKG/usr/share/stepmania/Themes/_Installer # NSIS stuff
+  rm -rf $PKG/usr/doc/$pkgname-$pkgver/WindowsNotes.txt
+  # XDG Desktop stuff
+  mkdir -p $PKG/etc/xdg/menus/applications-merged $PKG/usr/share/desktop-directories $PKG/usr/share/applications
+  for i in $(find icons -name 'stepmania-ssc.*'); do
+    mv "$i" $(echo "$i"|sed 's/-ssc//')
+  done
+  cp -r icons $PKG/usr/share/
+  (
+    cd $PKG/usr/doc/$pkgname-$pkgver/Luadoc
+    for s in 16 32 48 64 128; do
+      mkdir -p $PKG/usr/share/icons/hicolor/${s}x${s}/apps
+      n=$(identify favicon.ico|sed -rn "/${s}x${s}.*32-bit/s/.*\[(.)+\].*/\1/p"); convert favicon.ico[$n] $PKG/usr/share/icons/hicolor/${s}x${s}/apps/stepmania-lua.png
+    done
+    xsltproc Lua.xml > Lua.html
+  )
+  cat <<'EOF' > $PKG/etc/xdg/menus/applications-merged/stepmania.menu
+<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
+  "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
+<Menu>
+  <Menu>
+    <Name>Games</Name>
+    <Menu>
+      <Name>Stepmania</Name>
+      <Directory>stepmania.directory</Directory>
+      <Include>
+        <Category>X-Stepmania</Category>
+      </Include>
+    </Menu>
+  </Menu>
+</Menu>
+EOF
+  cat <<'EOF' > $PKG/usr/share/desktop-directories/stepmania.directory
+[Desktop Entry]
+Version=1.0
+Type=Directory
+Icon=stepmania
+Name=Stepmania
+EOF
+  sed -r 's/-ssc//; s/^Categories=.*/Categories=Application;X-Stepmania/' $pkgname.desktop > $PKG/usr/share/applications/$pkgname.desktop
+  cat <<EOF > $PKG/usr/share/applications/$pkgname-firstuse.desktop
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=First Use
+Icon=text-x-readme
+Exec=xdg-open /usr/doc/$pkgname-$pkgver/Userdocs/sm5_beginner.txt
+Categories=Application;X-Stepmania
+EOF
+  cat <<EOF > $PKG/usr/share/applications/$pkgname-manual.desktop
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=Manual
+Icon=text-html
+Exec=xdg-open /usr/doc/$pkgname-$pkgver/Manual/index.html
+Categories=Application;X-Stepmania
+EOF
+  cat <<EOF > $PKG/usr/share/applications/$pkgname-developpers.desktop
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=Developper's documentation
+Icon=emblem-documents
+Exec=xdg-open /usr/doc/$pkgname-$pkgver/Devdocs
+Categories=Application;X-Stepmania
+EOF
+  cat <<EOF > $PKG/usr/share/applications/$pkgname-lua.desktop
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=Lua documentation
+Icon=stepmania-lua
+Exec=xdg-open /usr/doc/$pkgname-$pkgver/Luadoc/Lua.html
+Categories=Application;X-Stepmania
+EOF
+  cat <<EOF > $PKG/usr/share/applications/$pkgname-simfile-formats.desktop
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=File formats documentation
+Icon=emblem-documents
+Exec=xdg-open /usr/doc/$pkgname-$pkgver/SimfileFormats
+Categories=Application;X-Stepmania
+EOF
+  cat <<EOF > $PKG/usr/share/applications/$pkgname-themer.desktop
+[Desktop Entry]
+Version=1.0
+Type=Application
+Encoding=UTF-8
+Name=Theme documentation
+Icon=emblem-documents
+Exec=xdg-open /usr/doc/$pkgname-$pkgver/Themerdocs
+Categories=Application;X-Stepmania
+EOF
+  # Correct permissions
+  # 'games' group can modify the contents of /usr/share/stepmania/*
+  # Users should still modify Stepmania using their own ~/.local/share/stepmania-5 directory
+  chown -R root:games $PKG/usr/share/stepmania/*
+  chmod -R ug=rwX,o=rX $PKG/usr/share/stepmania/*
+  chown -R root: $PKG/usr/doc/$pkgname-$pkgver/*
+  chmod -R u=rwX,go=rX $PKG/usr/doc/$pkgname-$pkgver/*
+  chown -R root: $PKG/usr/share/icons
+  chmod -R u=rwX,go=rX $PKG/usr/share/icons
+  chown root: $PKG/usr/libexec/stepmania/*
+  chmod u=rwx,go=rx $PKG/usr/libexec/stepmania/*
   (
     cd $PKG/usr/libexec/stepmania
     ln -s ../../share/stepmania/* .
   )
+  set +e
 }
index cf0a242..837d76f 100644 (file)
@@ -1 +1 @@
-automake
+automake,libxslt,imagemagick