wok-current view tazpkg/receipt @ rev 25691

Add feature to upgrade tazpkg first
author Stanislas Leduc <shann@slitaz.org>
date Sun Mar 17 16:10:19 2024 +0000 (8 months ago)
parents ece35c6e0e49
children
line source
1 # SliTaz package receipt.
3 PACKAGE="tazpkg"
4 VERSION="944"
5 CATEGORY="base-system"
6 SHORT_DESC="SliTaz packages manager"
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="http://www.slitaz.org/"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WGET_URL="http://hg.slitaz.org/tazpkg/archive/$VERSION.tar.gz"
12 TAGS="slitaz package-manager"
13 HOST_ARCH="i486 arm"
15 DEPENDS="busybox gettext-base"
16 SUGGESTED="tazpanel"
17 BUILD_DEPENDS="gettext tidy-html5 libnotify-dev glib-dev"
19 # Gettext is part of cross-chroot
20 case "$ARCH" in
21 arm) BUILD_DEPENDS="" ;;
22 esac
24 current_version()
25 {
26 wget -O - http://hg.slitaz.org/$PACKAGE/ 2>/dev/null | \
27 sed '/^Changeset/!d;s|.*">|http://hg.slitaz.org/'$PACKAGE'/rev/|;s|<.*||' | \
28 xargs wget -O - 2>/dev/null | sed '/rev /!d;s|.*rev ||;s| .*||'
29 }
31 # Rules to gen a SliTaz package suitable for TazPkg.
32 #
33 # TazPkg is SliTaz packages manager. On an other GNU/Linux install
34 # can be do with `make install` from the sources directory.
35 #
37 # Rules to configure and make the package.
38 compile_rules()
39 {
40 # Patch to use tazweb-legacy for tazpanel
41 patch -p1 < $stuff/tazweb-libwebkit.patch
43 # Thanks Rantanplan, fix miss translate in tazpkg.fr.html
44 patch -p1 < $stuff/tazpkg-doc-fr.patch
46 # Patch for upgrade core system package first
47 patch -p1 < $stuff/upgrade-core-pkg.patch
49 # Add getall, checkspace feature
50 cp -a $stuff/checkspace $stuff/getall modules/
51 patch -p1 < $stuff/checkspace-module.patch
52 patch -p1 < $stuff/getall-module.patch
54 # Patch for upgrade tazpkg first
55 patch -p1 < $stuff/upgrade-tazpkg-first.patch
56 rm modules/upgrade.orig
58 sed -i 's|\. receipt|. ./receipt|' */*
59 make && make DESTDIR=$DESTDIR VERSION=$VERSION install
60 }
62 genpkg_rules()
63 {
64 cp -a $install/* $fs
65 chown -R root.root $fs
67 # A tiny bug fix
68 sed 's|= "\$NEWVER|= "${NEWVER:-$VERSION}|;s|\$NEWMD5|${NEWMD5:-$OLDMD5}|' \
69 -i $fs/usr/libexec/tazpkg/info
70 # Default icon for mimetype (freedesktop standard compliant file
71 # manager will diplay a tazpkg icon for SliTaz packages).
72 icons="$fs/usr/share/icons/hicolor/32x32/mimetypes"
73 mkdir -p $icons
74 ln -s ../apps/tazpkg.png $icons/application-x-tazpkg.png
75 }
77 post_install()
78 {
79 # Ensure symlink for locale doc always exist
80 if [ -f $1/etc/locale.conf ]; then
81 locale=$(cat $1/etc/locale.conf | awk -F'LANG=' '{print $2}' \
82 | sed 's/.UTF-8//')
83 chroot "$1/" /sbin/tazlocale $locale
84 fi
86 # Apply a fix to config file /etc/slitaz/slitaz.conf
87 [ -f $1/etc/slitaz/slitaz.conf ] && \
88 sed -i 's/LOCAL_STATE/LOCALSTATE/' $1/etc/slitaz/slitaz.conf
89 grep -q ^Icon= $1/usr/share/applications/tazpkg-url.desktop ||
90 echo "Icon=tazpkg" >> $1/usr/share/applications/tazpkg-url.desktop
92 # Make sure new config is present
93 if ! grep -q ^NOTIFY_GEOM "$1/etc/slitaz/tazpkg.conf"; then
94 cat >> "$1/etc/slitaz/tazpkg.conf" << "EOT"
95 # The geometry of the desktop notification
96 NOTIFY_GEOM="360x80-0+24"
98 EOT
99 fi
100 :
101 }