1 # Build recipe for iptables.
3 # Copyright (c) 2017-2018 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.
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/networking"
24 tarname=${program}-${version}.tar.bz2
27 fetch=http://www.netfilter.org/projects/iptables/files/$tarname
30 The main firewall program in GNU/Linux.
32 iptables is the userspace command line program used to configure the
33 Linux 2.4.x and later packet filtering ruleset. It is targeted towards
34 system administrators.
36 Since Network Address Translation is also configured from the packet
37 filter ruleset, iptables is used for this, too.
39 The iptables package also includes ip6tables. ip6tables is used for
40 configuring the IPv6 packet filter.
43 homepage=http://www.netfilter.org/projects/iptables/index.html
46 # Source documentation
47 docs="COMMIT_NOTES COPYING INCOMPATIBILITIES"
48 docsdir="${docdir}/${program}-${version}"
54 unpack "${tardir}/$tarname"
58 # Set sane permissions
59 chmod -R u+w,go-w,a+rX-s .
61 # A patch from Alpine Linux adding definitions for Musl
62 patch -p1 < "${worktree}/patches/iptables/iptables-1.6.0-musl-fixes.patch"
64 ./configure CFLAGS="$QICFLAGS -D_GNU_SOURCE" LDFLAGS="$QILDFLAGS" \
66 --libdir=/usr/lib${libSuffix} \
71 --enable-bpf-compiler \
74 --build="$(cc -dumpmachine)"
77 make -j${jobs} DESTDIR="$destdir" install
79 # Manage dot new config file
80 touch "${destdir}/etc/.graft-config"
82 # Compress and link man pages (if needed)
83 if test -d "${destdir}/$mandir"
86 cd "${destdir}/$mandir"
87 find . -type f -exec lzip -9 '{}' +
88 find . -type l | while read -r file
90 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
97 mkdir -p "${destdir}${docsdir}"
101 cp -p $file "${destdir}${docsdir}"