recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / data / iana-etc / recipe
blob562f5ea660f4426de6ffbb8b767aacd8d982b87c
1 # Build recipe for iana-etc.
3 # Copyright (c) 2017, 2021-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=iana-etc
21 version=2.30
22 update_version=20211229
23 arch=noarch
24 release=1
26 # Define a category for the output of the package name
27 pkgcategory=data
29 # Define custom package version
30 pkgversion=${version}_${update_version}
32 tarname=${program}-${version}.tar.bz2
34 # Remote source(s)
35 fetch="
36   http://sethwklein.net/$tarname
37   https://github.com/Mic92/iana-etc/releases/download/${version}/$tarname
40 description="
41 Provides /etc/services and /etc/protocols files.
43 The iana-etc package provides the Unix/Linux /etc/services and
44 /etc/protocols files.  Using data from the Internet Assigned
45 Numbers Authority <https://www.iana.org>.
48 homepage=https://www.iana.org/protocols
49 license=OSLv3.0
51 # Source documentation
52 docs="COPYING CREDITS NEWS README VERSION"
53 docsdir="${docdir}/${program}-${pkgversion}"
55 build()
57     unpack "${tardir}/$tarname"
58     unpack "${tardir}/${program}-${update_version}.tar.gz"
60     cd "$srcdir"
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
65     make all && make DESTDIR="$destdir" install
67     # Update files from 'update_version' iana's variant
68     cp -f -p "${TMPDIR}/${program}-${update_version}"/protocols \
69      "${destdir}/etc"
70     cp -f -p "${TMPDIR}/${program}-${update_version}"/services \
71      "${destdir}/etc"
73     # To handle config file(s)
74     touch "${destdir}/etc/.graft-config"
76     # Copy documentation
77     mkdir -p "${destdir}/$docsdir"
78     cp -p $docs "${destdir}/$docsdir"
80     # Do not keep the update version source, unless --keep is passed in Qi
81     if test -z "$keep_srcdir"
82     then
83         rm -rf -- "${TMPDIR}/${program}-${update_version}"
84     fi
85     unset -v update_version