recipes: compressors/xz: Upgraded to version 5.6.2
[dragora.git] / recipes / tools / mc / recipe
blob990a1a08aa3156809ba538786266dde6f26d554a
1 # Build recipe for mc (Midnight Commander).
3 # Copyright (c) 2017-2023 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=mc
21 version=4.8.29
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=tools
27 tarname=${program}-${version}.tar.bz2
29 # Remote source(s)
30 fetch=http://ftp.midnight-commander.org/$tarname
32 description="
33 File manager and user shell.
35 GNU Midnight Commander can be used locally or remotely, on the console
36 or under X Window System.  By using full screen space of the terminals,
37 it provides an intuitive user interface to the operating system,
38 aiming to be a useful tool for users with any level of experience,
39 from a newbie to a guru.
42 homepage=https://www.midnight-commander.org
43 license=GPLv3+
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README"
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Apply a patch in order to build against Musl
56     # (Thanks to "Alpine Linux")
57     patch -p1 < "${worktree}/patches/mc/fix-cchar_t.patch"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     ./configure CPPFLAGS="$QICPPFLAGS" \
63     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --infodir=$infodir \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --enable-nls \
70      --with-search-engine=pcre \
71      --with-screen=ncurses \
72      --without-x \
73      --with-gpm-mouse \
74      --build="$(gcc -dumpmachine)"
76     make -j${jobs} V=1
77     make -j${jobs} DESTDIR="$destdir" install
79     # To manage .new files
80     touch "${destdir}/etc/mc/.graft-config"
82     # Compress info documents deleting index file for the package
83     if test -d "${destdir}/$infodir"
84     then
85         rm -f "${destdir}/${infodir}/dir"
86         lzip -9 "${destdir}/${infodir}"/*
87     fi
89     # Compress and link man pages (if needed)
90     if test -d "${destdir}/$mandir"
91     then
92         (
93             cd "${destdir}/$mandir"
94             find . -type f -exec lzip -9 {} +
95             find . -type l | while read -r file
96             do
97                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
98                 rm -- "$file"
99             done
100         )
101     fi
103     # Copy documentation
104     mkdir -p "${destdir}/$docsdir"
105     cp -p $docs "${destdir}/$docsdir"