SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "tazpkg"

# SliTaz package receipt.

PACKAGE="tazpkg"
VERSION="944"
CATEGORY="base-system"
SHORT_DESC="SliTaz packages manager"
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL3"
WEB_SITE="http://www.slitaz.org/"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="http://hg.slitaz.org/tazpkg/archive/$VERSION.tar.gz"
TAGS="slitaz package-manager"
HOST_ARCH="i486 arm"

DEPENDS="busybox gettext-base"
SUGGESTED="tazpanel"
BUILD_DEPENDS="gettext tidy-html5 libnotify-dev glib-dev"

# Gettext is part of cross-chroot
case "$ARCH" in
    arm)  BUILD_DEPENDS="" ;;
esac

current_version()
{
    wget -O - http://hg.slitaz.org/$PACKAGE/ 2>/dev/null | \
    sed '/^Changeset/!d;s|.*">|http://hg.slitaz.org/'$PACKAGE'/rev/|;s|<.*||' | \
    xargs wget -O - 2>/dev/null | sed '/rev /!d;s|.*rev ||;s| .*||'
}

# Rules to gen a SliTaz package suitable for TazPkg.
#
# TazPkg is SliTaz packages manager. On an other GNU/Linux install
# can be do with `make install` from the sources directory.
#

# Rules to configure and make the package.
compile_rules()
{
    # Patch to use tazweb-legacy for tazpanel
    patch -p1 < $stuff/tazweb-libwebkit.patch

    # Thanks Rantanplan, fix miss translate in tazpkg.fr.html
    patch -p1 < $stuff/tazpkg-doc-fr.patch

    # Patch for upgrade core system package first
    patch -p1 < $stuff/upgrade-core-pkg.patch

    # Add getall, checkspace feature
    cp -a $stuff/checkspace $stuff/getall modules/
    patch -p1 < $stuff/checkspace-module.patch
    patch -p1 < $stuff/getall-module.patch

    # Patch for upgrade tazpkg first
    patch -p1 < $stuff/upgrade-tazpkg-first.patch
    rm modules/upgrade.orig

    sed -i 's|\. receipt|. ./receipt|' */*
    make && make DESTDIR=$DESTDIR VERSION=$VERSION install
}

genpkg_rules()
{
    cp -a $install/* $fs
    chown -R root.root $fs

    # A tiny bug fix
    sed 's|= "\$NEWVER|= "${NEWVER:-$VERSION}|;s|\$NEWMD5|${NEWMD5:-$OLDMD5}|' \
        -i $fs/usr/libexec/tazpkg/info
    # Default icon for mimetype (freedesktop standard compliant file
    # manager will diplay a tazpkg icon for SliTaz packages).
    icons="$fs/usr/share/icons/hicolor/32x32/mimetypes"
    mkdir -p $icons
    ln -s ../apps/tazpkg.png $icons/application-x-tazpkg.png
}

post_install()
{
    # Ensure symlink for locale doc always exist
    if [ -f $1/etc/locale.conf ]; then
        locale=$(cat $1/etc/locale.conf | awk -F'LANG=' '{print $2}' \
        | sed 's/.UTF-8//')
        chroot "$1/" /sbin/tazlocale $locale 
    fi

    # Apply a fix to config file /etc/slitaz/slitaz.conf
    [ -f $1/etc/slitaz/slitaz.conf ] && \
        sed -i 's/LOCAL_STATE/LOCALSTATE/' $1/etc/slitaz/slitaz.conf
    grep -q ^Icon= $1/usr/share/applications/tazpkg-url.desktop ||
      echo "Icon=tazpkg" >> $1/usr/share/applications/tazpkg-url.desktop

    # Make sure new config is present
    if ! grep -q ^NOTIFY_GEOM "$1/etc/slitaz/tazpkg.conf"; then
        cat >> "$1/etc/slitaz/tazpkg.conf" << "EOT"
# The geometry of the desktop notification
NOTIFY_GEOM="360x80-0+24"

EOT
    fi
    :
}
6047 packages and 209931 files in current database (Wed Jun 26 15:35:30 2024)