recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / x-apps / dwm / recipe
blobf5d5e206ac0151f25e5fe197dfa07fc119deba30
1 # Build recipe for dwm.
3 # Copyright (c) 2018-2019, 2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
18 set -e
20 program=dwm
21 version=6.3
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=x-apps
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://dl.suckless.org/dwm/$tarname
32 description="
33 Dynamic Window Manager.
35 dwm is a dynamic window manager for X.  It manages windows in tiled,
36 monocle and floating layouts.  All of the layouts can be applied
37 dynamically, optimising the environment for the application in use
38 and the task performed.
41 homepage=https://dwm.suckless.org
42 license="MIT X Consortium"
44 # Source documentation
45 docs="LICENSE README"
46 docsdir="${docdir}/${program}-${version}"
48 build()
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     # Set default font size to '14'
58     patch -p0 < "${worktree}/patches/dwm/dwm-fontsize.diff"
60     cat "${worktree}/archive/dwm/config.mk" > ./config.mk
62     make -j${jobs} \
63      X11INC=/usr/include/X11 \
64      X11LIB=/usr/lib${libSuffix}/X11 \
65      FREETYPEINC=/usr/include/freetype2
67     make -j${jobs} PREFIX=/usr DESTDIR="$destdir" install
69     strip --strip-unneeded "${destdir}/usr/bin/dwm"
70     lzip -9 "${destdir}/${mandir}/man1/dwm.1"
72     # Include xinitrc file to start DWM
74     mkdir -p "${destdir}/etc/X11/xinit"
75     cp -p "${worktree}/archive/dwm/xinitrc-dwm" "${destdir}/etc/X11/xinit/"
76     chmod 644 "${destdir}/etc/X11/xinit/xinitrc-dwm"
78     touch "${destdir}/etc/X11/xinit/.graft-config"
80     # Copy documentation
81     mkdir -p "${destdir}/$docsdir"
82     cp -p $docs "${destdir}/$docsdir"