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
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.bz2
30 fetch=http://ftp.midnight-commander.org/$tarname
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
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README"
47 docsdir="${docdir}/${program}-${version}"
51 unpack "${tardir}/$tarname"
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" \
65 --libdir=/usr/lib${libSuffix} \
70 --with-search-engine=pcre \
71 --with-screen=ncurses \
74 --build="$(gcc -dumpmachine)"
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"
85 rm -f "${destdir}/${infodir}/dir"
86 lzip -9 "${destdir}/${infodir}"/*
89 # Compress and link man pages (if needed)
90 if test -d "${destdir}/$mandir"
93 cd "${destdir}/$mandir"
94 find . -type f -exec lzip -9 {} +
95 find . -type l | while read -r file
97 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
104 mkdir -p "${destdir}/$docsdir"
105 cp -p $docs "${destdir}/$docsdir"