wok-current view dwm/receipt @ rev 24439

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 13 18:01:32 2022 +0000 (2022-02-13)
parents 970c5ec9a60a
children e81a854f7503
line source
1 # SliTaz package receipt.
3 PACKAGE="dwm"
4 VERSION="6.0"
5 CATEGORY="x-window"
6 SHORT_DESC="Very light dynamic window manager for X."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="MIT"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://dwm.suckless.org/"
11 WGET_URL="http://dl.suckless.org/dwm/$TARBALL"
12 TAGS="window-manager"
13 HOST_ARCH="i486 arm"
15 DEPENDS="xorg-libX11 xorg-xsetroot"
16 BUILD_DEPENDS="xorg-libX11-dev xorg-xproto xorg-xineramaproto \
17 xorg-libXinerama-dev"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - ${WGET_URL%/*} 2>/dev/null | \
23 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 # From blue to grey and have lighter grey
30 sed -i s/'#0066ff'/'#222222'/g config.def.h
31 sed -i s/'#cccccc'/'#f1efeb'/g config.def.h
32 # 6 tag-mask
33 sed -i s/', "7", "8", "9"'// config.def.h
34 # Firefox on current tag-mask
35 sed -i s/'1 << 8,'/'0, '/ config.def.h
36 # [Shift]+[Alt]+[Enter]
37 sed -i s/uxterm/xterm/ config.def.h
38 make CC=${HOST_SYSTEM}-gcc
39 }
41 # Rules to gen a SliTaz package suitable for Tazpkg.
42 genpkg_rules()
43 {
44 mkdir -p $fs/usr/bin
45 cp -a $src/dwm $fs/usr/bin
46 cp -a $stuff/dwm-session $fs/usr/bin
47 chown 0.0 $fs/usr/bin/*
48 }
50 post_install()
51 {
52 res=$(cat "$1/etc/slim.conf" | grep ^session | sed s/"sessions. *"//)
53 # Adding WM to SLIM available sessions.
54 if ! echo "$res" | grep -q $PACKAGE; then
55 echo
56 echo -n "Adding $PACKAGE to /etc/slim.conf..."
57 sed -i "s/^sessions.*/sessions ${res},dwm/" /etc/slim.conf
58 status
59 fi
60 }
62 post_remove()
63 {
64 # Remove karmen from SLIM available sessions.
65 if grep -q dwm "$1/etc/slim.conf"; then
66 sed -i s/,dwm// "$1/etc/slim.conf"
67 fi
68 }