3 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
4 # Version 2, December 2004
6 # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
8 # Everyone is permitted to copy and distribute verbatim or modified
9 # copies of this license document, and changing it is allowed as long
10 # as the name is changed.
12 # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
13 # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16 # 0. You just DO WHAT THE FUCK YOU WANT TO.
18 # SlackBuild script for dwm without any patches
19 # =============================================
20 # By: r1w1s1 (https://fosstodon.org/@r1w1s1)
23 # URL: https://dwm.suckless.org/
25 # v6.5: 12/july/2024 by r1w1s1 - Initial build.
28 cd "$(dirname "$0")" ; CWD
=$
(pwd)
31 VERSION
=${VERSION:-6.5}
34 PKGTYPE
=${PKGTYPE:-tgz}
36 if [ -z "$ARCH" ]; then
37 case "$( uname -m )" in
40 *) ARCH
=$
( uname
-m ) ;;
44 if [ -n "${PRINT_PACKAGE_NAME}" ]; then
45 echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
50 PKG
=$TMP/package-
$PRGNAM
51 OUTPUT
=${OUTPUT:-/tmp}
53 if [ "$ARCH" = "i586" ]; then
54 SLKCFLAGS
="-O2 -march=i586 -mtune=i686"
56 elif [ "$ARCH" = "i686" ]; then
57 SLKCFLAGS
="-O3 -march=pentium4 -mtune=generic"
59 elif [ "$ARCH" = "x86_64" ]; then
60 SLKCFLAGS
="-O3 -march=x86-64 -mtune=generic -fPIC"
70 mkdir
-p "$TMP" "$PKG" "$OUTPUT"
73 #Download and extract the source code
74 rm -rf "${PRGNAM}-${VERSION}"
75 wget
-O "${PRGNAM}-${VERSION}.tar.gz" "https://dl.suckless.org/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz"
76 tar xvf
"${PRGNAM}-${VERSION}.tar.gz"
77 cd "${PRGNAM}-${VERSION}"
79 if [ -e "$CWD/config.h" ]; then
80 cp -v "$CWD/config.h" config.def.h
83 # Apply patches if available
84 for patch in "$CWD"/patches
/*; do
85 [ -e "$patch" ] ||
break
90 #patch -p1 <$CWD/patches/dwm-systray-20230922-9f88553.diff
94 \
( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
95 -o -perm 511 \
) -exec chmod 755 {} \
; -o \
96 \
( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
97 -o -perm 440 -o -perm 400 \
) -exec chmod 644 {} \
;
100 make CFLAGS
="SLACKFLAGS" \
103 X11INC
=/usr
/include \
104 X11LIB
=/usr
/lib
${LIBDIRSUFFIX}/X11
109 X11INC
=/usr
/include \
110 X11LIB
=/usr
/lib
${LIBDIRSUFFIX}/X11 \
113 install -vDm 0755 "$CWD/xinitrc.dwm" "$PKG/etc/X11/xinit/xinitrc.dwm"
114 strip
--strip-unneeded "$PKG/usr/bin/$PRGNAM"
115 gzip -9 $PKG/usr
/man
/man?
/*.?
117 mkdir
-p "$PKG/usr/doc/$PRGNAM-$VERSION"
118 cp -a LICENSE README \
119 "$PKG/usr/doc/$PRGNAM-$VERSION"
120 cat "$CWD/$PRGNAM.SlackBuild" > "$PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild"
122 mkdir
-p "$PKG"/install
123 cat "$CWD"/slack-desc
> "$PKG"/install
/slack-desc
126 /sbin
/makepkg
-l y
-c n
"$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"