recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / networking / ncftp / recipe
blob608a99f5c15bb4eb1e12a70e34e0e6b55c9efb6d
1 # Build recipe for ncftp.
3 # Copyright (c) 2018, 2020-2021 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=ncftp
21 version=3.2.6
22 release=3
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}-src.tar.gz
29 # Remote source(s)
30 fetch=ftp://ftp.ncftp.com/ncftp/$tarname
32 description="
33 A File Transfer Protocol program.
35 NcFTP is a free set of programs that use the File Transfer Protocol.
36 It's been around for quite some time now (circa 1992) and many people
37 still use the program and contribute suggestions and feedback.
39 The main program is simply called \"ncftp\".  There are also separate
40 utility programs for one-shot FTP operations (i.e. for shell scripts
41 and command line junkies);  these include ncftpget, ncftpput, and
42 ncftpls.  Run each command without any arguments to see the usage
43 screen, or read the man page.
46 homepage=https://www.ncftp.com
47 license="Clarified Artistic License"
49 # Source documentation
50 docs="README.txt DONATE.txt doc/*.txt"
51 docsdir="${docdir}/${program}-${version}"
53 build()
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
59     # Apply patches from Debian to refresh this source
60     while read -r line
61     do
62         case $line in
63         *.patch)
64             patch -Np1 -i "${worktree}/patches/ncftp/${line}"
65             ;;
66         esac
67     done < "${worktree}/patches/ncftp/series"
69     # Update config detection for hosts
70     cp -f "${worktree}/archive/common/config.guess" .
71     cp -f "${worktree}/archive/common/config.sub" .
73     # Set sane permissions
74     chmod -R u+w,go-w,a+rX-s .
76     # Unfortunately, this build system does
77     # not pick up the FLAGS after `configure'
78     CC=gcc CPPFLAGS="$QICPPFLAGS" \
79     CFLAGS="$QICFLAGS -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -Wall" \
80     LDFLAGS="$QILDFLAGS -static" \
81     ./configure $configure_args \
82      --mandir=$mandir \
83      --enable-ssp \
84      --enable-readline \
85      --build="$(gcc -dumpmachine)"
87     make -j${jobs}
88     make -j${jobs} DESTDIR="$destdir" install
90     # Replace hard link
91     ln -sf ncftpbatch "${destdir}/usr/bin/ncftpspooler"
93     # Include missing manpage for ncftpbookmarks
94     # Thanks again to "Debian GNU/Linux" :-)
96     install -p -m 0644 "${worktree}/archive/ncftp/ncftpbookmarks.1" \
97      -D "${destdir}/${mandir}/man1/ncftpbookmarks.1"
99     # Compress and link man pages (if needed)
100     (
101         cd "${destdir}/$mandir"
102         find . -type f -exec lzip -9 {} +
103         find . -type l | while read -r file
104         do
105             ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106             rm -- "$file"
107         done
108     )
110     # Copy documentation
112     mkdir -p "${destdir}/$docsdir"
113     cp -p $docs "${destdir}/$docsdir"
115     # Redundancy
116     rm -f "${destdir}/$docsdirmanifest.txt"