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
22 update_version=20211229
26 # Define a category for the output of the package name
29 # Define custom package version
30 pkgversion=${version}_${update_version}
32 tarname=${program}-${version}.tar.bz2
36 http://sethwklein.net/$tarname
37 https://github.com/Mic92/iana-etc/releases/download/${version}/$tarname
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
51 # Source documentation
52 docs="COPYING CREDITS NEWS README VERSION"
53 docsdir="${docdir}/${program}-${pkgversion}"
57 unpack "${tardir}/$tarname"
58 unpack "${tardir}/${program}-${update_version}.tar.gz"
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 \
70 cp -f -p "${TMPDIR}/${program}-${update_version}"/services \
73 # To handle config file(s)
74 touch "${destdir}/etc/.graft-config"
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"
83 rm -rf -- "${TMPDIR}/${program}-${update_version}"
85 unset -v update_version