<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Anjanmomi</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Anjanmomi"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Anjanmomi"/>
	<updated>2026-05-03T04:40:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Wireless_AP_with_udhcpd_and_NAT&amp;diff=22350</id>
		<title>Wireless AP with udhcpd and NAT</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Wireless_AP_with_udhcpd_and_NAT&amp;diff=22350"/>
		<updated>2022-10-03T05:27:07Z</updated>

		<summary type="html">&lt;p&gt;Anjanmomi: fix command formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Networking]]&lt;br /&gt;
Setting up a wireless AP with udhcpd and NAT&lt;br /&gt;
&lt;br /&gt;
(based largely on the [http://elinux.org/RPI-Wireless-Hotspot raspberry pi wireless router howto])&lt;br /&gt;
&lt;br /&gt;
= Dependencies =&lt;br /&gt;
&lt;br /&gt;
Install the hostapd access point software, busybox-extras (for the udhcpd DHCP server),&lt;br /&gt;
and the iptables firewall manager.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add hostapd busybox-extras iptables}}&lt;br /&gt;
&lt;br /&gt;
If you want to connect clients to the internet, you need to provide some way&lt;br /&gt;
of redirecting traffic from the AP to the internet.&lt;br /&gt;
There are two main possibilities:&lt;br /&gt;
*A bridge&lt;br /&gt;
*Network Address Translation&lt;br /&gt;
&lt;br /&gt;
If you use a bridge and get your IP via DHCP, you may have a hard time&lt;br /&gt;
configuring it such that the bridge gets an IP address without screwing up your&lt;br /&gt;
local internet connection.&lt;br /&gt;
&lt;br /&gt;
This guide only covers NAT. See [[Bridge]] for more info.&lt;br /&gt;
&lt;br /&gt;
= Configure hostapd =&lt;br /&gt;
You need to write a configuration file. Alpine ships with a sample file in&lt;br /&gt;
/etc/hostapd/hostapd.conf, but it didn&#039;t work for me (possibly because I&lt;br /&gt;
used a pre-wireless-N card, supported by ath5k?).&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample based on something that did work for me &lt;br /&gt;
(I&#039;ve changed ssid &amp;amp; wpa_passphrase):&lt;br /&gt;
 ctrl_interface=/var/run/hostapd&lt;br /&gt;
 ctrl_interface_group=0&lt;br /&gt;
 interface=wlan0&lt;br /&gt;
 driver=nl80211&lt;br /&gt;
 logger_syslog=-1&lt;br /&gt;
 logger_syslog_level=2&lt;br /&gt;
 logger_stdout=-1&lt;br /&gt;
 logger_stdout_level=2&lt;br /&gt;
 ssid=alpine-test&lt;br /&gt;
 hw_mode=g&lt;br /&gt;
 channel=6&lt;br /&gt;
 max_num_sta=32&lt;br /&gt;
 rts_threshold=2347&lt;br /&gt;
 fragm_threshold=2346&lt;br /&gt;
 macaddr_acl=0&lt;br /&gt;
 auth_algs=3&lt;br /&gt;
 ignore_broadcast_ssid=0&lt;br /&gt;
 wpa=2&lt;br /&gt;
 wpa_passphrase=supertopsecret&lt;br /&gt;
 wpa_key_mgmt=WPA-PSK WPA-PSK-SHA256&lt;br /&gt;
 wpa_pairwise=TKIP CCMP&lt;br /&gt;
&lt;br /&gt;
Change &amp;quot;interface&amp;quot; to match your wireless interface.&lt;br /&gt;
Change &amp;quot;ssid&amp;quot; and &amp;quot;wpa_passphrase&amp;quot; as necessary.&lt;br /&gt;
Set &amp;quot;wpa&amp;quot; to 3 if you want plain wpa and wpa2. or 1 for plain WPA1 only.&lt;br /&gt;
&lt;br /&gt;
The example in the package uses wpa_psk_file (needed for WPS) instead of a&lt;br /&gt;
static passphrase. That does not enable WPS.&lt;br /&gt;
&lt;br /&gt;
You may want to change the channel to avoid collisions with other local APs.&lt;br /&gt;
Unfortunately, the automatic channnel selection (channel=0) is *not*&lt;br /&gt;
currently enabled at compile time, so we can&#039;t use it. Scan for channels&lt;br /&gt;
in use with {{Cmd|iwlist wlan0 scanning}} or equivalent, before setup.&lt;br /&gt;
&lt;br /&gt;
max_num_sta sets a limit on the number of clients that can connect to your AP.&lt;br /&gt;
Set it higher than you think you might have, but not much higher.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t put this in /etc/hostapd/hostapd.conf, you will need to change&lt;br /&gt;
the CONFIGS line in /etc/conf.d/hostapd to point at it.&lt;br /&gt;
I prefer doing that, so that the default is available for reference.&lt;br /&gt;
&lt;br /&gt;
= Configure udhcpd =&lt;br /&gt;
&lt;br /&gt;
Edit /etc/udhcpd.conf.&lt;br /&gt;
The default is very well-commented, but not really ready to use.&lt;br /&gt;
Here&#039;s a skeleton, loosely based on mine:&lt;br /&gt;
 start		192.168.2.2&lt;br /&gt;
 end		192.168.2.254&lt;br /&gt;
 max_leases	64&lt;br /&gt;
 interface	wlan0&lt;br /&gt;
 static_lease	00:1b:de:ad:be:ef	192.168.2.100&lt;br /&gt;
 opt	dns	192.168.0.1 8.8.8.8&lt;br /&gt;
 opt	subnet	255.255.255.0&lt;br /&gt;
 opt	router	192.168.2.1&lt;br /&gt;
 opt	lease	864000&lt;br /&gt;
&lt;br /&gt;
Note the following:&lt;br /&gt;
*max_leases should be set to at least as many clients as you might have in the lifetime of a lease. If you have any clients connecting via bridges, note that the bridge itself gets a DHCP address.&lt;br /&gt;
*interface is the interface clients will be connecting to (wlan0 or your wireless interface in this example)&lt;br /&gt;
*router should be the static IP address you assign to your wireless interface.&lt;br /&gt;
*start and end should be within the same subnet as the IP address you configure wlan0 with, but the address for wlan0 should be outside the range.&lt;br /&gt;
(e.g. 192.168.2.1 and 192.168.2.255 are both suitable for the router address)&lt;br /&gt;
*set the DNS option to point to any nameservers you want. You can repeat it, but the limit is 3 nameservers.&lt;br /&gt;
*static_lease takes two arguments: a MAC address designating a specific network adaptor, and the IP address that should be assigned to it.&lt;br /&gt;
It can be repeated multiple times, to assign different addresses to different users.&lt;br /&gt;
This comes in handy for printers, if you can trust network users to not do MAC spoofing.&lt;br /&gt;
&lt;br /&gt;
= Configure iptables =&lt;br /&gt;
&lt;br /&gt;
I used raw iptables, configuring it thus:&lt;br /&gt;
{{Cmd|iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;br /&gt;
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT}}&lt;br /&gt;
# this saves the state in a location the service can restore it from&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
service iptables save&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test =&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/etc/init.d/hostapd start&lt;br /&gt;
&lt;br /&gt;
/etc/init.d/udhcpd start&lt;br /&gt;
&lt;br /&gt;
sysctl net.ipv4.ip_forward=1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
and try connecting from another computer.&lt;br /&gt;
&lt;br /&gt;
= Make the changes permanent =&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add hostapd&lt;br /&gt;
rc-update add udhcpd&lt;br /&gt;
rc-update add sysctl}}&lt;br /&gt;
&lt;br /&gt;
== Configuring ifup ==&lt;br /&gt;
Now, the odd parts:&lt;br /&gt;
iptables tries to set net.ipv4.ip_forward to 1 when it&#039;s started, but in&lt;br /&gt;
my experience, this is not reliable.&lt;br /&gt;
You do *not* want to enable the &amp;quot;iptables&amp;quot; service. It starts before&lt;br /&gt;
networking, and may result in your wireless interface not getting configured.&lt;br /&gt;
(Apparently, ifup thinks that wlan0 is up and skips it. This was not something I expected, but it&#039;s the only explanation I have for how things worked...)&lt;br /&gt;
&lt;br /&gt;
Rather, modify /etc/network/interfaces, commenting out any configuration for&lt;br /&gt;
your wireless interface. Then add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto wlan0&lt;br /&gt;
iface wlan0 inet static&lt;br /&gt;
	address 192.168.2.1&lt;br /&gt;
	netmask 255.255.255.0&lt;br /&gt;
	up /etc/init.d/iptables start&lt;br /&gt;
	up sysctl net.ipv4.ip_forward=1&lt;br /&gt;
	down /etc/init.d/iptables stop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(It&#039;s possible to set up everything so that hostapd and udhcpd get&lt;br /&gt;
started and stopped from the wlan0 stanza. I didn&#039;t bother doing that.)&lt;br /&gt;
&lt;br /&gt;
= Finishing touches =&lt;br /&gt;
&lt;br /&gt;
(See [[Setting_up_a_ssh-server]] for alternatives and more information)&lt;br /&gt;
Add dropbear SSH server, configure it to run on only the wireless interface:&lt;br /&gt;
{{Cmd|setup-sshd -c dropbear}}&lt;br /&gt;
edit /etc/conf.d/dropbear to add&lt;br /&gt;
&lt;br /&gt;
 DROPBEAR_OPTS=&amp;quot;-p 192.168.2.1:22&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(assuming the wireless interface has the IP address 192.168.2.1 and you&lt;br /&gt;
want SSH on port 22).&lt;br /&gt;
This is optional, but if you&#039;re using a wireless router it helps to be able&lt;br /&gt;
to administer it, and listening on all addresses is rather risky.&lt;br /&gt;
&lt;br /&gt;
= Things this doesn&#039;t cover but it would be nice to =&lt;br /&gt;
*Some way to get more entropy (see [[Entropy_and_randomness]])&lt;br /&gt;
*DNS server, publishing device names ([[TinyDNS_Format]] looks most useful)&lt;br /&gt;
*use awall instead of raw iptables (and/or switch to nftables)&lt;br /&gt;
*[[Setup-acf]] to manage the router&lt;br /&gt;
This would require:&lt;br /&gt;
**acf-core, acf-alpine-conf, acf-apk-tools&lt;br /&gt;
**acf-iptables, or acf-awall + rewrite&lt;br /&gt;
**acf-ssh + switch to openssh, or new acf-dropbear&lt;br /&gt;
**acf-dhcp + switch to dhcp, or new acf-udhcpd&lt;br /&gt;
**new acf-hostapd (probably hardest part!)&lt;br /&gt;
**acf-tinydns after adding tinydns&lt;/div&gt;</summary>
		<author><name>Anjanmomi</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=22331</id>
		<title>APKBUILD Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=APKBUILD_Reference&amp;diff=22331"/>
		<updated>2022-09-20T03:53:04Z</updated>

		<summary type="html">&lt;p&gt;Anjanmomi: document ~ and &amp;gt;= for $pkgname and $pkgver&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;APKBUILDs are the scripts that are created in order to build Alpine packages using the [[abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
See [[aports]] for details on Alpine&#039;s official ports repository.&lt;br /&gt;
&lt;br /&gt;
This page is intended to serve as a reference for creating APKBUILDs; if this is your first time creating a package for Alpine Linux, please see [[Creating an Alpine package]].&lt;br /&gt;
&lt;br /&gt;
= Legend =&lt;br /&gt;
The following notes will assist you in understanding this document.&lt;br /&gt;
&lt;br /&gt;
In description text:&lt;br /&gt;
* If a variable is not prefixed with a &#039;&#039;$&#039;&#039;, it will be represented by italics (i.e., &#039;&#039;srcdir&#039;&#039; ).&lt;br /&gt;
* Functions will also be represented by italics, but will also end with a pair of parentheses (i.e., &#039;&#039;build()&#039;&#039; ).&lt;br /&gt;
* Shell commands will be represented &amp;lt;code&amp;gt;like this&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variables =&lt;br /&gt;
{{Note|Variables that contain a path (e.g. &#039;&#039;$srcdir&#039;&#039; and &#039;&#039;$pkgdir&#039;&#039;) should always be quoted using double quotes (i.e., &#039;&#039;&amp;quot;$srcdir&amp;quot;&#039;&#039;).  This is done to prevent things from breaking, should the user have the APKBUILD in a directory path that contains spaces.}}&lt;br /&gt;
{{Note|All arbitrary variable and function names should be prefixed with an underscore character ( _ ) to avoid name clashes with the internals of abuild (for example, &#039;&#039;_luaversions&#039;&#039;).}}&lt;br /&gt;
&lt;br /&gt;
== abuild-defined variables ==&lt;br /&gt;
The following variables are defined by abuild:&lt;br /&gt;
&lt;br /&gt;
==== startdir ====&lt;br /&gt;
: The directory where the APKBUILD script is.&lt;br /&gt;
==== srcdir ====&lt;br /&gt;
: The directory where sources, from the &#039;&#039;source&#039;&#039; variable, are downloaded to and unpacked to.&lt;br /&gt;
==== pkgdir ====&lt;br /&gt;
: This directory should receive the files for the main package.  For example, a normal [http://en.wikipedia.org/wiki/GNU_build_system autotools] package would have &amp;lt;code&amp;gt;make DESTDIR=&amp;quot;$pkgdir&amp;quot; install&amp;lt;/code&amp;gt; in the &#039;&#039;package()&#039;&#039; function.&lt;br /&gt;
==== subpkgdir ====&lt;br /&gt;
: This directory should receive the files for a subpackage. This variable should only be used from subpackage functions.&lt;br /&gt;
==== builddir ====&lt;br /&gt;
: This variable should point to the directory inside the &#039;&#039;srcdir&#039;&#039; where the main package source is unpacked.  This is typically &#039;&#039;$srcdir/$pkgname-$pkgver&#039;&#039;.  It’s used by the default &#039;&#039;prepare()&#039;&#039; function as a working directory when applying patches.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User-defined variables ==&lt;br /&gt;
The following variables should be defined by the user:&lt;br /&gt;
==== arch ====&lt;br /&gt;
: Package architecture(s) to build for.  Can be one or several seperated by whitespace of: &#039;&#039;&#039;[[x86]], [[x86_64]], [[armv7]], [[armhf]], [[aarch64]], [[ppc64le]], [[s390x]], [[riscv64]], all&#039;&#039;&#039;, or &#039;&#039;&#039;noarch&#039;&#039;&#039;, where &#039;&#039;&#039;all&#039;&#039;&#039; means all architectures, and &#039;&#039;&#039;noarch&#039;&#039;&#039; means it&#039;s architecture-independent (e.g., a pure-python package). Architectures can be negated using the ! character to exclude them from the list of supported architectures. E.g. &#039;&#039;&#039;arch=&amp;quot;all !ppc64le&amp;quot;&#039;&#039;&#039; means that the package is allowed to be built on all architectures but the ppc64le architecture.&lt;br /&gt;
: {{Tip|To determine if your APKBUILD can use &#039;&#039;&#039;noarch&#039;&#039;&#039;: First specify &#039;&#039;&#039;all&#039;&#039;&#039; and then build the package by executing &amp;lt;code&amp;gt;abuild -r&amp;lt;/code&amp;gt;.  Watch the output towards the end for warnings saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used.  If the main package and all subpackages, if you have any subpackages, give a warning saying that &#039;&#039;&#039;noarch&#039;&#039;&#039; can be used, then you can use &#039;&#039;&#039;noarch&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
==== depends ====&lt;br /&gt;
: Run-time dependency package(s) that are not shared-object dependencies.  Shared objects dependencies are auto-detected and should not be specified here. To specify a conflicting package, add the package name prefixed with a &#039;!&#039;.&lt;br /&gt;
&lt;br /&gt;
==== depends_dev ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
: {{Note|From ncopa on IRC: To find out if you need to add a package to depends_dev have a look at *requires* in usr/lib/pkgconfig/*.pc. With libtool it gets more complicated, but we should delete the .la files. Also check if there are any  /usr/bin/*-configure #!/bin/bash #!/usr/bin/perl or Python. Sometimes scripts or similar are generated at build time (i.e autoconf automake) then you normally don&#039;t need add those to depends_dev. You can also just add all -dev makedepends to depends_dev but it will slow the build process a little bit (more build dependencies).}}&lt;br /&gt;
&lt;br /&gt;
==== depends_doc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_openrc ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_libs ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-libs&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== depends_static ====&lt;br /&gt;
: Run-time dependency package(s) for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; subpackage.&lt;br /&gt;
&lt;br /&gt;
==== checkdepends ====&lt;br /&gt;
: Dependencies that are only required during the check phase, they are only installed if the check option is enabled&lt;br /&gt;
&lt;br /&gt;
==== giturl ====&lt;br /&gt;
:Git repository from which &amp;lt;code&amp;gt;abuild checkout&amp;lt;/code&amp;gt; checks out. You can checkout a specific branch in git by adding &amp;lt;code&amp;gt;-b $branch&amp;lt;/code&amp;gt;.&lt;br /&gt;
==== install ====&lt;br /&gt;
: There are 6 different types of install scripts.  Install scripts are named &#039;&#039;&#039;$pkgname.action&#039;&#039;&#039;, where &#039;&#039;&#039;action&#039;&#039;&#039; can be:  &#039;&#039;&#039;pre-install, post-install, pre-upgrade, post-upgrade, pre-deinstall&#039;&#039;&#039;, or &#039;&#039;&#039;post-deinstall&#039;&#039;&#039;.  For example, if &#039;&#039;pkgname&#039;&#039; is set to &#039;&#039;&#039;mypackage&#039;&#039;&#039; and &#039;&#039;install&#039;&#039; is set to &#039;&#039;&#039;$pkgname.post-install&#039;&#039;&#039;, then a script named &#039;&#039;&#039;mypackage.post-install&#039;&#039;&#039; must exist along-side the APKBUILD.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;{{Note|Always use &amp;lt;code&amp;gt;/bin/sh&amp;lt;/code&amp;gt; for the command-line interpreter on the [http://en.wikipedia.org/wiki/Shebang_%28Unix%29 shebang line] of your install scripts.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are the different types of install scripts in detail:&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-install =====&lt;br /&gt;
: This script is executed &#039;&#039;before installing&#039;&#039; the package.  Typical use is when the package needs a group and a user to be created. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
addgroup -S clamav 2&amp;gt;/dev/null&lt;br /&gt;
adduser -S -D -H -s /sbin/nologin -G clamav -g clamav clamav 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|If the script exits with a failure (e.g., if the user already exists), the package will not be installed and &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will exit with failure, hence the &amp;lt;code&amp;gt;exit 0&amp;lt;/code&amp;gt; at the end.}}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-install =====&lt;br /&gt;
: This script is executed &#039;&#039;after installing&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;before upgrading/downgrading/reinstalling&#039;&#039; the package. Note that exiting with failure will not cause apk to exit with failure, but will mark the package as broken.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-upgrade =====&lt;br /&gt;
: This script is executed &#039;&#039;after upgrading/downgrading/reinstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.pre-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;before uninstalling&#039;&#039; the package.&lt;br /&gt;
: {{Note|If the script exits with failure, &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; will not uninstall the package.}}&lt;br /&gt;
&lt;br /&gt;
===== $pkgname.post-deinstall =====&lt;br /&gt;
: This script is executed &#039;&#039;after uninstalling&#039;&#039; the package.&lt;br /&gt;
&lt;br /&gt;
==== install_if ====&lt;br /&gt;
:install_if can be used when a package needs to be installed when some packages are already installed or are in the dependency tree. It works in reverse to the &#039;&#039;recommends&#039;&#039; feature, that other package managers provide.&lt;br /&gt;
&lt;br /&gt;
: Typically this is used in a subpackage that should provide files which make sense with another package. For example:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
subpackages=&amp;quot;$pkgname-bash-completion:bashcomp:noarch&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
bashcomp() {&lt;br /&gt;
	pkgdesc=&amp;quot;Bash completions for $pkgname&amp;quot;&lt;br /&gt;
	install_if=&amp;quot;$pkgname=$pkgver-r$pkgrel bash-completion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	install -Dm644 &amp;quot;$builddir&amp;quot;/doc/bash_completion/aria2c \&lt;br /&gt;
		&amp;quot;$subpkgdir&amp;quot;/usr/share/bash-completion/completions/_aria2c&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
From the aria2c APKBUILD. Note that the custom bashcomp() function is only necessary, because the files are not in /usr/share/bash-completion.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:In general, install_if should only be used with &#039;&#039;&#039;at least one versioned constraint&#039;&#039;&#039;. Otherwise, a package that was implicitly installed by install_if and then removed from the binary repositories, will not get purged with &amp;lt;code&amp;gt;apk upgrade&amp;lt;/code&amp;gt;. [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10720#note_121298]&lt;br /&gt;
&lt;br /&gt;
==== license ====&lt;br /&gt;
: License(s) for the package, for example &amp;lt;code&amp;gt;GPL-3.0-or-later&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BSD-2-Clause&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;MIT&amp;lt;/code&amp;gt; [[Creating_an_Alpine_package#license|(details)]].&lt;br /&gt;
&lt;br /&gt;
==== makedepends ====&lt;br /&gt;
: Build-time dependency package(s).&lt;br /&gt;
==== md5sums/sha256sums/sha512sums ====&lt;br /&gt;
: Checksums for the files/URLs listed in &#039;&#039;source&#039;&#039;.  The checksums are normally generated and updated by executing &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; and should be the last item in the APKBUILD.&lt;br /&gt;
&lt;br /&gt;
New packages should use only sha512sums.&lt;br /&gt;
&lt;br /&gt;
==== options ====&lt;br /&gt;
: Build-time options for the package.&lt;br /&gt;
&lt;br /&gt;
: {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!archcheck&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to verify that the architecture of the binary files is the same architecture as abuild should build for. One example where it makes sense to set this are packages with firmware files, that get executed on another CPU (such as WiFi firmware).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not try to run the &amp;lt;code&amp;gt;check()&amp;lt;/code&amp;gt; function. Please always add a short comment after the &amp;lt;code&amp;gt;!check&amp;lt;/code&amp;gt; about why it&#039;s disabled. [https://github.com/alpinelinux/aports/pull/2322#discussion_r142545300] Creating a very simple check function, that calls &amp;lt;code&amp;gt;program --version&amp;lt;/code&amp;gt; is worse than disabling tests completely because it gives the false impression that the package is thoroughly tested with the testsuite from upstream. [https://github.com/alpinelinux/aports/pull/7326#discussion_r278797457]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;checkroot&amp;lt;/code&amp;gt;&lt;br /&gt;
| Specifies that the package&#039;s test suite will be run in &#039;&#039;fakeroot&#039;&#039;. This is necessary for some test suites which fail when run as non-root.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;net&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allows network access when run in &#039;&#039;rootbld&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!strip&amp;lt;/code&amp;gt;&lt;br /&gt;
| Avoid stripping symbols from binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;suid&amp;lt;/code&amp;gt;&lt;br /&gt;
| Allow [https://en.wikipedia.org/wiki/Setuid setuid] binaries.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!tracedeps&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not automatically find dependencies (e.g. by using &amp;lt;code&amp;gt;ldd&amp;lt;/code&amp;gt; to find dynamic libraries, which the resulting binary links against).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chmod-clean&amp;lt;/code&amp;gt;&lt;br /&gt;
| Make all files writable in the src/ directory. Useful for packages that make files read-only in the process of building packages (go modules).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;toolchain&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t warn when g++ is in makedepends&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!dbg&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t create debugging subpackage&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ldpath-recursive&amp;lt;/code&amp;gt;&lt;br /&gt;
| Scan directories recursively when creating .so providers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!spdx&amp;lt;/code&amp;gt;&lt;br /&gt;
| Do not check if the license= field has a SPDX compliant license&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;textrels&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out when text relocations are found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;charset.alias&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t error out if /usr/lib/charset.alias is found&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;libtool&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t delete libtool .la files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;!fhs&amp;lt;/code&amp;gt;&lt;br /&gt;
| Don&#039;t enforce checks on path that follow the FHS&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== pkgdesc ====&lt;br /&gt;
: A brief, one-line description of what the package does.&lt;br /&gt;
&lt;br /&gt;
: Here&#039;s an example from the OpenSSH client package:&lt;br /&gt;
: &amp;lt;pre&amp;gt;pkgdesc=&amp;quot;Port of OpenBSD&#039;s free SSH release - client&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== pkggroups ====&lt;br /&gt;
: System group(s) to be created during build-time.  System group(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system group(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgname ====&lt;br /&gt;
: The name of the package.  All letters should be lowercase.&lt;br /&gt;
: {{Note|When creating an APKBUILD of a module or library for another package, we use some common package prefixes, such as: &#039;&#039;lua-&#039;&#039;, &#039;&#039;perl-&#039;&#039;, &#039;&#039;php-&#039;&#039;, and &#039;&#039;py3-&#039;&#039;.  Search aports for other common prefixes.}}&lt;br /&gt;
&lt;br /&gt;
==== pkgrel ====&lt;br /&gt;
: Alpine package release number.  Starts at 0 (zero).  Always increment &#039;&#039;pkgrel&#039;&#039; when making updates to an aport; reset &#039;&#039;pkgrel&#039;&#039; to 0 (zero) when incrementing &#039;&#039;pkgver&#039;&#039;.&lt;br /&gt;
==== pkgusers ====&lt;br /&gt;
: System user(s) to be created during build-time.  System user(s) should also be created in the &#039;&#039;&#039;[[APKBUILD Reference#.24pkgname.pre-install|$pkgname.pre-install]]&#039;&#039;&#039; script, so that the system user(s) are also created prior to package installation for run-time use.&lt;br /&gt;
==== pkgver ====&lt;br /&gt;
: The version of the software being packaged. Format for valid versions: &amp;lt;code&amp;gt;{digit}{.digit}...{letter}{_suf{#}}...{-r#}&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n17]&lt;br /&gt;
: A Suffix &amp;lt;code&amp;gt;suf&amp;lt;/code&amp;gt; in the above format can be one of the following to indicate that the release is &#039;&#039;less recent&#039;&#039; than the version without the suffix: &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;beta&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;pre&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rc&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n75]&lt;br /&gt;
: These are for indicating &#039;&#039;more recent&#039;&#039; releases: &amp;lt;code&amp;gt;cvs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;hg&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; [https://git.alpinelinux.org/cgit/apk-tools/tree/src/version.c#n76]&lt;br /&gt;
: All other suffices are invalid. To package a specific git commit, the date of the commit gets appended to the latest release, e.g. &amp;lt;code&amp;gt;1.0.0_git20180204&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== provides ====&lt;br /&gt;
: List of package names (and optionally version info) this package provides.&lt;br /&gt;
&lt;br /&gt;
: If package with a version is provided (provides=&#039;foo=1.2&#039;) apk will consider it as an alternate name and it will automatically consider the package for installation by the alternate name, and conflict with other packages having the same name, or provides.&lt;br /&gt;
&lt;br /&gt;
: If version is not provided (provides=&#039;foo&#039;), apk will consider it as virtual package name. Several package with same non-versioned provides can be installed simultaneously. However, none of them will be installed by default when requested by the virtual name - instead, error message is given and user is asked to choose which package providing the virtual name should be installed.&lt;br /&gt;
==== provider_priority ====&lt;br /&gt;
: A numeric value which is used by apk-tools to break ties when choosing a virtual package to satisfy a dependency. Higher values have higher priority. The primary use case is to specify the primary package that satisfies a virtual (provider).&lt;br /&gt;
==== replaces ====&lt;br /&gt;
: Allow this package to be installed at the same time as the listed packages, even if they have conflicting files. The files from this package will override (&amp;quot;take over&amp;quot;) the conflicting files.&lt;br /&gt;
&lt;br /&gt;
: This can be used to override config files with &amp;quot;policy packages&amp;quot; [https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/89d003f8c2e5a92655ee778f7bfa5c0e85ddbed4].&lt;br /&gt;
&lt;br /&gt;
: Another use case is renaming packages (or moving files from one package to another): &amp;quot;replaces&amp;quot; will avoid the file conflict error that apk reports if it happens to install the new package before uninstalling the old package [https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10724#note_132872].&lt;br /&gt;
&lt;br /&gt;
: A common misconception is that &amp;quot;replaces&amp;quot; is used to replace packages (like in [https://wiki.archlinux.org/index.php/PKGBUILD#replaces PKGBUILD]). This is not the case, it is only for solving file conflicts. To let apk consider installing one package instead of another one, refer to [[#provides|provides]] (with the version).&lt;br /&gt;
&lt;br /&gt;
==== replaces_priority ====&lt;br /&gt;
: The priority of the replaces. If multiple packages replace files of each other, then the package with the highest &#039;&#039;replaces_priority&#039;&#039; will win.&lt;br /&gt;
&lt;br /&gt;
==== source ====&lt;br /&gt;
: The source variable is not only used to list the remote source files to fetch, it is also used to list the local files that abuild will need in order to build the apk. Examples of such local files include: init.d files, conf.d files, install files (see [[APKBUILD Reference#install|install variable]]), patches, and all other necessary files.&lt;br /&gt;
&lt;br /&gt;
: Here are few things to note:&lt;br /&gt;
&lt;br /&gt;
:* When you are finished adding local and/or remote files to &#039;&#039;source&#039;&#039;, you can execute the following command to add their checksums to the APKBUILD file:&lt;br /&gt;
:: {{Cmd|abuild checksum}}&lt;br /&gt;
:: {{Note|When later updating the content of &#039;&#039;source&#039;&#039;, or updating a file that is listed in &#039;&#039;source&#039;&#039;, you must also update their checksums again with the same command.}}&lt;br /&gt;
&lt;br /&gt;
:* When the remote file is hosted at SourceForge, it&#039;s best to specify the special mirrors link used by SourceForge:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://downloads.sourceforge.net/software/software-$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: (or similar depending on the package).&lt;br /&gt;
&lt;br /&gt;
:* You can set target filename (eg &#039;save as...&#039;) by prefixing the URI with &#039;&#039;filename::&#039;&#039;. This is useful when the remote filename is not specified in the URI (ie, does not end in &#039;/software-1.0.tar.gz&#039;), such as:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;http://oss.example.org/?get=software&amp;amp;ver=1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: or when the filename is braindead, like githubs&#039; download tags:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: The above two examples needs a target filename prefix:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::http://oss.example.org/?get=software&amp;amp;ver=$pkgver&amp;lt;/pre&amp;gt;&lt;br /&gt;
:: and:&lt;br /&gt;
:: &amp;lt;pre&amp;gt;$pkgname-$pkgver.tar.gz::https://github.com/software/software/archive/v$pkgver.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following protocols for remote file retrieval:&lt;br /&gt;
:** http&lt;br /&gt;
:** https&lt;br /&gt;
:** ftp&lt;br /&gt;
&lt;br /&gt;
:* abuild currently supports the following archive types/archive file extensions:&lt;br /&gt;
:** .tar (only in Alpine &amp;gt;= 2.5)&lt;br /&gt;
:** .tar.gz / .tgz&lt;br /&gt;
:** .tar.bz2&lt;br /&gt;
:** .tar.lz (only in Alpine &amp;gt;=3.7)&lt;br /&gt;
:** .tar.lzma&lt;br /&gt;
:** .tar.xz&lt;br /&gt;
:** .zip&lt;br /&gt;
&lt;br /&gt;
:* &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; should only include variables that change often like &amp;lt;code&amp;gt;pkgver&amp;lt;/code&amp;gt; or a commit ID. CI will warn you if you include &amp;lt;code&amp;gt;pkgname&amp;lt;/code&amp;gt; in source. Other variables like for example &amp;lt;code&amp;gt;_pkgname&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;_pyname&amp;lt;/code&amp;gt; do not belong in &amp;lt;code&amp;gt;source&amp;lt;/code&amp;gt; either.&lt;br /&gt;
&lt;br /&gt;
==== subpackages ====&lt;br /&gt;
: Subpackages built from this APKBUILD.  abuild will parse this variable and try to find a subpackage split function.  The split function must &#039;&#039;move&#039;&#039; files that do not belong in the main package, from &#039;&#039;$pkgdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.  Files and directories can also be &#039;&#039;copied&#039;&#039; from &#039;&#039;$startdir&#039;&#039; and &#039;&#039;$srcdir&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: The split function can be specified in 1 of 3 different methods:&lt;br /&gt;
:# subpkgname:&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# $pkgname-&#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
:# &#039;&#039;&#039;splitfunc&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: {{Note|Split function names &#039;&#039;&#039;cannot&#039;&#039;&#039; use hyphens; use the first method above if the subpackage name contains a hyphen (-) character, like this: &#039;&#039;subpkg-name:subpkg_name&#039;&#039;, where &amp;lt;code&amp;gt;subpkg-name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;&#039;&#039; and &amp;lt;code&amp;gt;subpkg_name&amp;lt;/code&amp;gt; is the name of the &#039;&#039;&#039;subpackage&#039;s split function&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
: {{Tip|For more information, see the [[APKBUILD_examples:Subpackages|Subpackages example]].}}&lt;br /&gt;
&lt;br /&gt;
==== triggers ====&lt;br /&gt;
: Apk-tools can &amp;quot;monitor&amp;quot; directories and execute a trigger if any package installed/uninstalled any file in the monitored dir. The triggers are always executed after the apk action (install, uninstall, upgrade).&lt;br /&gt;
&lt;br /&gt;
: The triggers are specified in the format: &#039;&#039;scriptname&#039;&#039;=&#039;&#039;pathlist&#039;&#039; where &#039;&#039;scriptname&#039;&#039; is the (sub)package name + .trigger suffix and pathlist is : separated list of the dirs to monitor.&lt;br /&gt;
&lt;br /&gt;
: The &#039;&#039;&#039;triggers&#039;&#039;&#039; variable must include the triggers for subpackages too if they have any.&lt;br /&gt;
&lt;br /&gt;
: It is possible to use wildcards (*) in the dir list.&lt;br /&gt;
&lt;br /&gt;
==== url ====&lt;br /&gt;
: The homepage for the package.  This is to help users find upstream documentation and other information regarding the package.&lt;br /&gt;
&lt;br /&gt;
==== langdir ====&lt;br /&gt;
: Path to where the language files are located for the &#039;&#039;&#039;-lang&#039;&#039;&#039; subpackage, defaults to &#039;&#039;&#039;/usr/share/locale&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== pcprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing pkg-config Requires: with the value in this variable, example: &#039;&#039;&#039;&#039;pcprefix=&amp;quot;foo:&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;pc:foo:bar&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== sonameprefix ====&lt;br /&gt;
: Prefix all provides derived from parsing shared objects with the value in this variable, example: &#039;&#039;&#039;sonameprefix=&amp;quot;foo&amp;quot;&#039;&#039;&#039; will produce &#039;&#039;&#039;so:foo:bar.so.X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
{{Note|All functions that are not &#039;&#039;prepare()&#039;&#039;, &#039;&#039;build()&#039;&#039;, &#039;&#039;check()&#039;&#039; and &#039;&#039;package()&#039;&#039; should consider the current working directory as undefined, and should therefore use the [[APKBUILD Reference#abuild-defined_variables|abuild-defined directory variables]] to their advantage.}}&lt;br /&gt;
&lt;br /&gt;
 sanitycheck() -&amp;gt; clean()-&amp;gt; fetch() -&amp;gt; verify() -&amp;gt; unpack() -&amp;gt; prepare() -&amp;gt; mkusers() -&amp;gt; build() -&amp;gt; check() -&amp;gt; package() -&amp;gt; subpackages() -&amp;gt; language packs -&amp;gt; apk -&amp;gt; cleanup()&lt;br /&gt;
&lt;br /&gt;
== abuild-defined functions ==&lt;br /&gt;
The following functions are provided by abuild and can be overridden, but it is strongly discouraged on code review for some functions:&lt;br /&gt;
&lt;br /&gt;
==== fetch() ====&lt;br /&gt;
: Downloads remote sources listed in &#039;&#039;source&#039;&#039; to &#039;&#039;SRCDEST&#039;&#039; (&#039;&#039;SRCDEST&#039;&#039; is configured in &#039;&#039;/etc/abuild.conf&#039;&#039;) and creates symlinks in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
==== unpack() ====&lt;br /&gt;
: unpack() will call default_unpack().&lt;br /&gt;
&lt;br /&gt;
: [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L403 default_unpack()] unpacks .tar, .tgz, .tar.gz, .tar.lz (only available in Alpine &amp;gt;=3.7), .tar.bz2, .tar.lzma, .tar.xz, and .zip archives from a symlink in &#039;&#039;$srcdir&#039;&#039; associated with &#039;&#039;$SRCDEST&#039;&#039; (or distfiles folder) resulting in an unpacked folder in &#039;&#039;$srcdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== dev() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-dev&#039;&#039;&#039; package is used to collect developer files and folders for use in other packages in the compilation process nothing more.  Without specifying a custom &#039;&#039;dev()&#039;&#039; function, abuild will call its internal &#039;&#039;dev()&#039;&#039; function, which in turn calls default_dev().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1605 default_dev()]&#039;&#039; will move any &#039;&#039;include&#039;&#039; folder and folders containing &#039;&#039;*.[acho]&#039;&#039; (static archive, c source, c header file, object file), &#039;&#039;*.prl&#039;&#039; file extension patterns in &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr}&#039;&#039; recursively; and &#039;&#039;*.so&#039;&#039; files from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/{lib,usr/lib}&#039;&#039; to &#039;&#039;&amp;quot;$subpkgdir&amp;quot;/{lib,usr/lib}&#039;&#039;.  It will also scan and move &#039;&#039;usr/{include,lib/{pkgconfig,cmake,qt*/mkspecs},share/{aclocal,gettext,vala/vapi,gir-[0-9]*,qt*/mkspecs},bin/*-config}}&#039;&#039; developer only folders in &#039;&#039;$pkgdir&#039;&#039; and transfer them to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: In general, default_dev() will support packages that share pkg-config, C programming language API, shared and static libraries, Autotools, gettext, Vala programming language bindings, Python GObject introspection, a provided custom pkg-config like command (*-config), Qt, and CMake.  If you have packages that have C++, other languages, other build system, etc; you need to manually move those developer files only if they are to be used in other packages.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_dev() to be called as in no dev(), you need to explicitly add subpackages=&amp;quot;$pkgname-dev&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== doc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-doc&#039;&#039;&#039; package whose job is only to collect documentation folders from $pkgdir nothing more.  Without specifying a custom &#039;&#039;doc()&#039;&#039; function, abuild will call its internal &#039;&#039;doc()&#039;&#039; function, which in turn calls default_doc().&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1519 default_doc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/share/{doc,man,info,html,sgml,licenses,gtk-doc,ri,help}&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged.  Packaging docs should be done in the package() function while letting abuild automatically collect the doc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: For default_doc() to be called as in no doc(), you need to explicitly add subpackages=&amp;quot;$pkgname-doc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== openrc() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-openrc&#039;&#039;&#039; package whose job is to collect OpenRC service files that are in /etc/init.d and /etc/conf.d.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L1661 default_openrc()]&#039;&#039; will move &#039;&#039;&amp;quot;$pkgdir&amp;quot;/etc/{conf,init}.d&#039;&#039; to &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging OpenRC service definitions should be in the package() function while letting abuild automatically collect the openrc folders.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_openrc() to be called as in no openrc(), you need to explicitly add subpackages=&amp;quot;$pkgname-openrc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== static() ====&lt;br /&gt;
: Subpackage function for the &#039;&#039;&#039;$pkgname-static&#039;&#039;&#039; package whose job is to collect static libraries that are stored in /lib and /usr/lib.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;[https://github.com/alpinelinux/abuild/blob/v3.4.0_rc4/abuild.in#L1748 default_static()]&#039;&#039; will move all static libraries (files ending with .a) from &#039;&#039;&amp;quot;$pkgdir&amp;quot;/lib&#039;&#039; and &#039;&#039;&amp;quot;$pkgdir&amp;quot;/usr/lib&#039;&#039; to their equivalents in &#039;&#039;$subpkgdir&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: Overriding this function is strongly discouraged. Packaging static libraries should be done in the package() function while letting abuild automatically collect the static libraries.&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Important&#039;&#039;&#039;: for default_static() to be called as in no static(), you need to explicitly add subpackages=&amp;quot;$pkgname-static&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== snapshot() ====&lt;br /&gt;
: &#039;&#039;&#039;Optional&#039;&#039;&#039;.  For live APKBUILDs or those with a _cvs, _svn, _git, _hg in their version number, you should create a snapshot function only if there is no download link to an archive file (.zip, .tar.gz, ...) to the commit/hash/tag.  The purpose of the snapshot function is to create an archive of the source code so that the package source code is deterministic, and it doesn&#039;t waste time to fetch the source code but bypasses the download step after snapshotting.  Those that download the source code from a git repository will follow head or the latest change to the source code.  It is better to archive the source code as a zip / tar.gz / tar.bz2 up to the commit or the tag which you are trying to build a package.  If it is not deterministic or not every part of the code frozen in time for every dependency and the main project, then the patches will fail or the package may fail to compile when you revisit the package months or years to backport a patch.&lt;br /&gt;
&lt;br /&gt;
: The default [https://github.com/alpinelinux/abuild/blob/v3.1.0/abuild.in#L2310 snapshot()] function has variables associated with it:&lt;br /&gt;
:* $disturl - the base-url of the place to autoupload the snapshot&lt;br /&gt;
:* $svnurl - Subversion repository &lt;br /&gt;
:* $giturl - Git repository&lt;br /&gt;
&lt;br /&gt;
: The default snapshot() can only support one repository.  It is better to override it if there are multiple repositories involved in your package.  CVS, Mercurial (hg), and alternative version control systems must override the default snapshot().&lt;br /&gt;
&lt;br /&gt;
: See [[APKBUILD_examples:Git_checkout]] to how to use it with git.  It takes 2-3 general steps.  Clone the repository; check it out at a specific revision/commit or tag; then you use an archiver to dump it in the &#039;&#039;$SRCDEST&#039;&#039; variable which points to the distfiles folder and the base path to the full path to the archive that you want to create.  You do this for every internal dependency that the package pulls.&lt;br /&gt;
&lt;br /&gt;
: After you have created your snapshot function, you use &amp;lt;code&amp;gt;abuild snapshot&amp;lt;/code&amp;gt; to run it.  &lt;br /&gt;
&lt;br /&gt;
: The archives produced by the snapshot will be saved in &#039;&#039;/var/cache/distfiles&#039;&#039; or whatever you set for &#039;&#039;$SRCDEST&#039;&#039;.  You may need to create symlinks to the archive if the archive is not saved to the Alpine server.&lt;br /&gt;
&lt;br /&gt;
: After you snapshot it, you need to produce the checksums with &amp;lt;code&amp;gt;abuild checksum&amp;lt;/code&amp;gt; to use it in the APKBUILD creation process.&lt;br /&gt;
&lt;br /&gt;
: This feature is available since Alpine &amp;gt;=2.6.&lt;br /&gt;
&lt;br /&gt;
==== default_prepare() ====&lt;br /&gt;
&lt;br /&gt;
:  Before build preparation it handles set of patches inside &amp;lt;code&amp;gt;$srcdir&amp;lt;/code&amp;gt; and prints failed ones.&lt;br /&gt;
&lt;br /&gt;
== User-defined functions ==&lt;br /&gt;
The following functions should be defined by the user: &lt;br /&gt;
&lt;br /&gt;
==== prepare() ====&lt;br /&gt;
: {{note|Please adjust old APKBUILDs, which still have a &#039;&#039;prepare()&#039;&#039; function that does the same as the &#039;&#039;default_prepare()&#039;&#039; when you edit them anyway.}}&lt;br /&gt;
: &#039;&#039;&#039;&#039;&#039;Optional&#039;&#039;.&#039;&#039;&#039;  Used for build preparation: patches, etc, should be applied here. When you don&#039;t specify a custom &#039;&#039;prepare()&#039;&#039;, the built-in &#039;&#039;default_prepare()&#039;&#039; from abuild will be used. It applies patches already (always prepare them in the &amp;lt;code&amp;gt;-p1&amp;lt;/code&amp;gt; format), so &#039;&#039;&#039;usually it makes sense to not create a custom &#039;&#039;prepare()&#039;&#039; function at all!&#039;&#039;&#039; If you do create one, call &#039;&#039;default_prepare()&#039;&#039; inside it:&lt;br /&gt;
&lt;br /&gt;
: Before default_prepare gets called, you can define &#039;&#039;patch_args&#039;&#039; to supply the argument to the patch command in global scope then throw away prepare() so it is unnecessary to use the old template code floating around to patch.  patch_args and autopatching is only available in Alpine &amp;gt;=3.4.  See [[Creating_an_Alpine_package#Patches]] to fix the patch that uses a different patch level (-pX).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prepare() {&lt;br /&gt;
    default_prepare&lt;br /&gt;
    # your custom code here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== build() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the compilation stage.  This function will be called as the current user (unless the &#039;&#039;package()&#039;&#039; function is missing - for compatibility reasons).  If no compilation is needed, this function can contain a single line: &amp;lt;code&amp;gt;return 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: To enable or disable CFLAGS, CXXFLAGS, CMake with option, or configure option per arch, use the CARCH variable:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local cmakeoptions=&lt;br /&gt;
case &amp;quot;$CARCH&amp;quot; in&lt;br /&gt;
        aarch64*|arm*|ppc64le|x86|s390x) cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=OFF&amp;quot; ;;&lt;br /&gt;
        x86_64)                          cmakeoptions=&amp;quot;$cmakeoptions -DWITH_OPENMP=ON&amp;quot; ;;&lt;br /&gt;
        *)                               msg &amp;quot;Unable to determine architecture from (CARCH=$CARCH)&amp;quot; ; return 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: The block can be used in other parts of the APKBUILD even in global.&lt;br /&gt;
&lt;br /&gt;
==== check() ====&lt;br /&gt;
: &#039;&#039;&#039;Required if functionality exists.&#039;&#039;&#039; This function is called right after the build stage.  It should check that the packaged thing is actually working, typically by running (integration) tests, if provided by upstream.  If there’s no (easy) way how to test the package, you can declare that it does not want to use &#039;&#039;check()&#039;&#039; by adding &amp;quot;!check&amp;quot; into the &#039;&#039;options&#039;&#039; variable (&amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
: default_check() does nothing.  You need to manually explicitly call the unit tests or test suite yourself.  When you run the test, the program should return with an exit code of 0, indicating the tests were a success.  Unit tests or test suites will do feature tests, per function correctness check, fuzz testing, benchmarks.&lt;br /&gt;
&lt;br /&gt;
: A package may also require additional testing frameworks packages that are external dependencies.  You should add those to the &#039;&#039;checkdepends=&#039;&#039; in Alpine &amp;gt;=3.6 or &#039;&#039;makedepends=&#039;&#039; for older for backporters.  If the testing framework is not available, you need to create a package for it.  If it requires a specific version of a testing framework, consider making it an internal dependency or a new package with a package name containing the major and minor version number like the python packages.&lt;br /&gt;
&lt;br /&gt;
: Generally speaking, you should define the check functions for libraries, large programs like web browsers, or compilers and interpreters, cryptographic/security/anonymity stuff, mission critical stuff, PCI compliance/money/accounting software, server software with a lot of stakeholders or consumers.  Soon for the new policy change will have virtually &#039;&#039;&#039;all packages with testing capabilities be required to have a working and defined check() function&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
: There are times when the unit tests do not work, just because the test itself is broken, new unimplemented feature, external factors not taken into consideration, unbundling path differences, breakage caused by ccache, missing test dependency or version mismatch dependency as in python2 vs python3, test scripts only work for particular language implementation like only supporting python2 but not python3 having used the 2to3 conversion script.  If a unit test is known not to work, you may need to patch it to omit that test or fix it; but, certain tests should not be disabled if it is important.  You may need to alter the references to uncompiled internal dependencies to work with the external dependencies instead.  For ccache, you can either disable it or remove it from the PATH environmental variable before running tests.&lt;br /&gt;
&lt;br /&gt;
{{Note|Tests for graphical applications and toolkits might work on a X11 user setup but will fail on the server unless run with xvfb-run.}}&lt;br /&gt;
&lt;br /&gt;
: If you don&#039;t add the &#039;&#039;check()&#039;&#039; and the &#039;&#039;options=&#039;&#039;, this is what you will see:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt;&amp;gt;&amp;gt; WARNING: py-webtest*: APKBUILD does not run any tests!&lt;br /&gt;
    Alpine policy will soon require that packages have any relevant testsuites run during the build process.&lt;br /&gt;
    To fix, either define a check() function, or declare !check in $options to indicate the package does not have a testsuite.&lt;br /&gt;
&lt;br /&gt;
: If you do not do a check or disable it, you must state there is no testsuite in comment form (#) next to options=&amp;quot;!check&amp;quot; for the code reviewers.&lt;br /&gt;
&lt;br /&gt;
: To run test suite with autotools do:&lt;br /&gt;
&lt;br /&gt;
  make check&lt;br /&gt;
&lt;br /&gt;
: To run the test suite with python setuptools:&lt;br /&gt;
&lt;br /&gt;
  python2 setup.py test&lt;br /&gt;
  python3 setup.py test&lt;br /&gt;
&lt;br /&gt;
: For python it should be &#039;&#039;&#039;test&#039;&#039;&#039; not check.  Check for python setuptools will check the packaging metadata fields[https://docs.python.org/3/distutils/examples.html#checking-a-package] only but not run the unit tests.  There should be verbose output also.  The dependencies for the tests are found in test_require in the setup.py.&lt;br /&gt;
&lt;br /&gt;
: If it says &amp;lt;code&amp;gt;Ran 0 tests in 0.000s&amp;lt;/code&amp;gt; that is not acceptable.  check() will say it was good but it is not actually correct.  It needs to run the test suite with an alternative method like &amp;lt;code&amp;gt;tox -e py27,py36&amp;lt;/code&amp;gt; if you see a tox.ini file.&lt;br /&gt;
&lt;br /&gt;
: You want to do it for each implementation to ensure that the API calls are correct per implementation but ncopa said it was just fine with python3.&lt;br /&gt;
&lt;br /&gt;
: If there is a circular dependency for the checkdepends=, you need to disable the check and put the reason next to &amp;lt;code&amp;gt;options=&amp;quot;!check&amp;quot;&amp;lt;/code&amp;gt; that there is a circular dependency.  You should disable it for the package that package that is least important or least security risk.  The other solution is to make the conflicting dependency an internal dependency but making sure that it doesn&#039;t pull it at check time.  This way they can both preform tests properly.&lt;br /&gt;
&lt;br /&gt;
==== package() ====&lt;br /&gt;
: &#039;&#039;&#039;Required.&#039;&#039;&#039;  This is the packaging stage.  Here, the built application and support files should be installed into &#039;&#039;&#039;$pkgdir&#039;&#039;&#039;.  If this is a metapackage, this function can contain a single line: &amp;lt;code&amp;gt;mkdir -p &amp;quot;$pkgdir&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Building in fakeroot will reduce performance for parallel builds dramatically.  It is for this reason that we split the build and package process into two separate functions.}}&lt;br /&gt;
&lt;br /&gt;
= Special Operators =&lt;br /&gt;
&lt;br /&gt;
== $pkgname~$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies a required &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement. &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; ignores revisions of the package version. For example &amp;lt;code&amp;gt;superd~0.6&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;$depends&amp;lt;/code&amp;gt; will ensure superd with package version 0.6 is installed as a run-time dependency for the package.&lt;br /&gt;
&lt;br /&gt;
== $pkgname&amp;gt;=$pkgver ==&lt;br /&gt;
&lt;br /&gt;
Specifies the installed package version must be greater than or equal to &amp;lt;code&amp;gt;$pkgver&amp;lt;/code&amp;gt; for [[apk]] to satisfy the &amp;lt;code&amp;gt;$pkgname&amp;lt;/code&amp;gt; requirement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
The [[APKBUILD examples]] page will assist you in understanding how to create an APKBUILD.&lt;br /&gt;
&lt;br /&gt;
= Version =&lt;br /&gt;
&lt;br /&gt;
This document assumes abuild for Alpine Edge.  For older releases of abuild, some of these features may not be available if you are using an older release.  A link to the implementation is linked for researchers and backporters.&lt;br /&gt;
&lt;br /&gt;
For more information see [[APKBUILD_versions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Anjanmomi</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=NetworkManager&amp;diff=22249</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=NetworkManager&amp;diff=22249"/>
		<updated>2022-08-20T14:33:04Z</updated>

		<summary type="html">&lt;p&gt;Anjanmomi: Add nm-applet not authorized to control networking&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://networkmanager.dev/ NetworkManager] is a program  that provides automatic detection and configuration for systems to connect to networks.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add {{Pkg|networkmanager}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NetworkManager comes with a command line interface and a curses-based interface, &amp;lt;code&amp;gt;nmcli&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;nmtui&amp;lt;/code&amp;gt; respectively or you can use a additional gui interface:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|plasma-nm}} for Plasma integration and applet&lt;br /&gt;
* {{Pkg|network-manager-applet}} for a GTK system tray applet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After installation start NetworkManager:&lt;br /&gt;
{{Cmd|# rc-service networkmanager start}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also your user needs to be in the &amp;lt;code&amp;gt;plugdev&amp;lt;/code&amp;gt; group:&lt;br /&gt;
{{Cmd|# adduser &amp;lt;YourUsername&amp;gt; plugdev}}&lt;br /&gt;
&lt;br /&gt;
{{Note|you will need to log out for the new group to take effect}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Wireless networks ==&lt;br /&gt;
&lt;br /&gt;
==== wpa_supplicant backend ====&lt;br /&gt;
&lt;br /&gt;
{{Todo|([[KDE|KDE Plasma]] Desktop) find out if it is possible to prevent requesting the password for &#039;&#039;&#039;KDE Wallet&#039;&#039;&#039; on login}}&lt;br /&gt;
&lt;br /&gt;
* Follow: [[Wi-Fi#wpa_supplicant]] and [[Wi-Fi#Automatic_Configuration_on_System_Boot]]&lt;br /&gt;
{{Note|{{Pkg|wpa_supplicant}} configuration might not be required, if it isnt it may be a good idea to have it setup just as a fallback}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now open &amp;lt;code&amp;gt;/etc/NetworkManager/NetworkManager.conf&amp;lt;/code&amp;gt; in a text editor and change it to something like this:&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/NetworkManager/NetworkManager.conf|&amp;lt;nowiki&amp;gt;[main] &lt;br /&gt;
dhcp=internal&lt;br /&gt;
plugins=ifupdown,keyfile&lt;br /&gt;
&lt;br /&gt;
[ifupdown]&lt;br /&gt;
managed=true&lt;br /&gt;
&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=yes&lt;br /&gt;
wifi.backend=wpa_supplicant&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|if these options dont work on your system you can change them as necessary}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to stop conflicting services:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-service networking stop}}&lt;br /&gt;
{{Cmd|# rc-service wpa_supplicant stop}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart NetworkManager:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-service networkmanager restart}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now connect to a network using one of the interfaces mentioned in [[NetworkManager#Installation|Installation]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If that connects and stays connected with no issues enable the &amp;lt;code&amp;gt;networkmanager&amp;lt;/code&amp;gt; service and disable the &amp;lt;code&amp;gt;networking&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wpa_supplicant&amp;lt;/code&amp;gt; boot services:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rc-update add networkmanager}}&lt;br /&gt;
{{Cmd|# rc-update del networking boot}}&lt;br /&gt;
{{Cmd|# rc-update del wpa_supplicant boot}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== iwd backend ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager supports wireless networks through {{Pkg|iwd}}, however, consider [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues?scope=all&amp;amp;utf8=%E2%9C%93&amp;amp;state=opened&amp;amp;search=iwd existing issues] before using it. After installation, enable the server and restart NetworkManager:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-service iwd start&lt;br /&gt;
rc-service networkmanager restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use {{Pkg|iwd}} though, you&#039;ve have to edit NetworkManager&#039;s configuration because it still defaults to {{Pkg|wpa_supplicant}} instead. Add the following to {{Path|/etc/NetworkManager/NetworkManager.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[device]&lt;br /&gt;
wifi.backend=iwd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== VPN support ==&lt;br /&gt;
Since version 1.16, NetworkManager has support for Wireguard[https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/NEWS?id=1.16.0].&lt;br /&gt;
&lt;br /&gt;
Support for other VPN types is provided by plugins. They are provided in the following packages:&lt;br /&gt;
* {{Pkg|networkmanager-openvpn}} for OpenVPN&lt;br /&gt;
&lt;br /&gt;
== nm-applet ==&lt;br /&gt;
=== not authorized to control networking ===&lt;br /&gt;
&lt;br /&gt;
You can enable all users to edit connections without adding polkit.&lt;br /&gt;
First, make the &amp;lt;code&amp;gt;conf.d&amp;lt;/code&amp;gt; directory for networkmanager:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# mkdir -p /etc/NetworkManager/conf.d}}&lt;br /&gt;
&lt;br /&gt;
Then, add following content to &amp;lt;code&amp;gt;/etc/NetworkManager/conf.d/any-user.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
auth-polkit=false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, restart networkmanager:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# /etc/init.d/networkmanager restart}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Anjanmomi</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Include:Setup_your_system_and_account_for_building_packages&amp;diff=20767</id>
		<title>Include:Setup your system and account for building packages</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Include:Setup_your_system_and_account_for_building_packages&amp;diff=20767"/>
		<updated>2021-12-11T20:12:34Z</updated>

		<summary type="html">&lt;p&gt;Anjanmomi: recommend users use doas with abuild-keygen&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The {{Pkg|alpine-sdk}} is a metapackage that pulls in the most essential packages used to build new packages. We&#039;ll also install doas to perform superuser operations, and nano to allow us to edit text:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add alpine-sdk doas nano}}&lt;br /&gt;
&lt;br /&gt;
This would be a good time to [[Setting_up_a_new_user|create a normal user account for you to work in]]. To make life easier later, it&#039;s a good idea to add this user to the wheel group; operations that require superuser privileges can now be done with doas.&lt;br /&gt;
&lt;br /&gt;
The [[Aports_tree|aports tree]] is in git so before we clone the it, let&#039;s configure git.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git config --global user.name &amp;quot;Your Full Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;your@email.address&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Read carefully [[Development using git]] to grasp basic Git operations and how to configure for sending email patches.&lt;br /&gt;
&lt;br /&gt;
Now we can clone the [[Aports_tree|aports tree]]. &lt;br /&gt;
&lt;br /&gt;
{{Cmd|git clone https://gitlab.alpinelinux.org/alpine/aports}}&lt;br /&gt;
&lt;br /&gt;
Before we start creating or modifying [[APKBUILD_Reference|APKBUILD]] files, we need to setup abuild for our system and user. Edit the file {{Path|abuild.conf}} to your requirements:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|doas nano /etc/abuild.conf}}&lt;br /&gt;
&lt;br /&gt;
Most of the defaults can be left alone, unless you are developing for a custom platform, in which case the comments in the file should guide you. The one field to edit is PACKAGER, so that you can get credit (or blame) for packages you create.&lt;br /&gt;
&lt;br /&gt;
To use &#039;abuild -r&#039; command to install dependency packages automatically.&lt;br /&gt;
{{Cmd|doas addgroup &amp;lt;yourusername&amp;gt; abuild}}&lt;br /&gt;
&lt;br /&gt;
We also need to prepare the location where the build process caches files when they are downloaded. By default this is {{Path|/var/cache/distfiles/}}. To create this directory and ensure that it is writeable, enter the following commands:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|doas mkdir -p /var/cache/distfiles&lt;br /&gt;
doas chmod a+w /var/cache/distfiles}}&lt;br /&gt;
&lt;br /&gt;
As an alternative to the second command, you can add yourself to the abuild group:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|doas chgrp abuild /var/cache/distfiles&lt;br /&gt;
doas chmod g+w /var/cache/distfiles}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Remember to logout and login again for the group change to have effect.}}&lt;br /&gt;
&lt;br /&gt;
The last step is to configure the security keys with the [[Abuild-keygen|abuild-keygen]] script for [[Abuild|abuild]] with the command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|SUDO=doas abuild-keygen -a -i}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Anjanmomi</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=PipeWire&amp;diff=20394</id>
		<title>PipeWire</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=PipeWire&amp;diff=20394"/>
		<updated>2021-12-02T01:12:36Z</updated>

		<summary type="html">&lt;p&gt;Anjanmomi: package name is pipewire-pulse not pipewire-pulseaudio&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft|The instructions below have not been thoroughly tested and may break things.}}&lt;br /&gt;
&lt;br /&gt;
[https://pipewire.org/ PipeWire] is a multimedia processing engine that aims to improve audio and video handling on Linux.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Audio Group ===&lt;br /&gt;
&lt;br /&gt;
When elogind is not available, the user has to be added to the &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; group. The user must log in for this to take effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# addgroup &amp;lt;user&amp;gt; audio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D-Bus ===&lt;br /&gt;
&lt;br /&gt;
PipeWire requires a running [https://www.freedesktop.org/wiki/Software/dbus/ D-Bus] session. If you use a full desktop environment this will probably be started automatically, but with minimal window managers it must be done manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add dbus dbus-openrc dbus-x11&lt;br /&gt;
# rc-service dbus start&lt;br /&gt;
# rc-update add dbus default&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;code&amp;gt;dbus-launch&amp;lt;/code&amp;gt; whenever you start an X or Wayland session. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XDG_RUNTIME_DIR ===&lt;br /&gt;
&lt;br /&gt;
If you are not using a Desktop Manager, ensure that your &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; is set to a user-writable location. By default for pulseaudio this is {{Path|/run/user/1000/}} or {{Path|/tmp}}. If this is not set, pipewire will create a directory in your home folder instead, called &amp;lt;code&amp;gt;~/pulse&amp;lt;/code&amp;gt;, and on attempting to run Pavucontrol or pactl, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pactl list&lt;br /&gt;
Connection failure: Connection refused&lt;br /&gt;
pa_context_connect() failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire wireplumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Using [https://gitlab.freedesktop.org/pipewire/wireplumber WirePlumber] rather than the pipewire-media-session (which comes with pipewire) is [https://gitlab.freedesktop.org/pipewire/media-session/-/blob/master/README.md recommended] but not required.}}&lt;br /&gt;
&lt;br /&gt;
Create a custom configuration file in {{Path|/etc/pipewire/pipewire.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /etc/pipewire&lt;br /&gt;
# cp /usr/share/pipewire/pipewire.conf /etc/pipewire/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following line to the &amp;lt;code&amp;gt;context.exec&amp;lt;/code&amp;gt; section at the bottom of {{Path|/etc/pipewire/pipewire.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ path = &amp;quot;wireplumber&amp;quot;  args = &amp;quot;&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the &amp;lt;code&amp;gt;snd_seq&amp;lt;/code&amp;gt; kernel module for ALSA support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe snd_seq&lt;br /&gt;
# echo snd_seq &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ALSA ===&lt;br /&gt;
&lt;br /&gt;
If you use neither Jack nor PulseAudio and you don&#039;t intend to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# touch /etc/pipewire/media-session.d/with-alsa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PulseAudio ===&lt;br /&gt;
&lt;br /&gt;
PipeWire can run a [https://www.freedesktop.org/wiki/Software/PulseAudio/ PulseAudio] daemon which should allow all existing PulseAudio applications to be used with the PipeWire backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-pulse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uncomment the following line in {{Path|/etc/pipewire/pipewire.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ path = &amp;quot;/usr/bin/pipewire&amp;quot; args = &amp;quot;-c pipewire-pulse.conf&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should be automatically enabled.&lt;br /&gt;
&lt;br /&gt;
=== JACK ===&lt;br /&gt;
&lt;br /&gt;
If you will be using PipeWire for [https://jackaudio.org/ JACK] applications install the required package and make system wide links to the PipeWire replacement JACK libraries (I have not had success using &amp;lt;code&amp;gt;pw-jack&amp;lt;/code&amp;gt;). You will not need to start a JACK server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-jack&lt;br /&gt;
# ln -sf /usr/lib/pipewire-0.3/jack/libjackserver.so.0 /usr/lib/libjackserver.so.0&lt;br /&gt;
# ln -sf /usr/lib/pipewire-0.3/jack/libjacknet.so.0 /usr/lib/libjacknet.so.0&lt;br /&gt;
# ln -sf /usr/lib/pipewire-0.3/jack/libjack.so.0 /usr/lib/libjack.so.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|These symlinks might be overwritten during updates.}}&lt;br /&gt;
&lt;br /&gt;
=== Video ===&lt;br /&gt;
&lt;br /&gt;
Video should work out-of-the-box with v4l2 devices (e.g. a lot of webcams) and [https://gstreamer.freedesktop.org/ GStreamer] applications.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth headset ===&lt;br /&gt;
&lt;br /&gt;
Requires &amp;lt;code&amp;gt;pipewire-spa-bluez&amp;lt;/code&amp;gt; package in addition to &amp;lt;code&amp;gt;pipewire-pulse&amp;lt;/code&amp;gt; daemon to be installed.&lt;br /&gt;
&lt;br /&gt;
=== Automatic bluetooth profile selection ===&lt;br /&gt;
&lt;br /&gt;
To automatically switch between HSP/HFP and A2DP profiles when an input stream is detected, set the bluez5.autoswitch-profile property to true:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/pipewire/media-session.d/bluez-monitor.conf&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rules = [&lt;br /&gt;
    {&lt;br /&gt;
        ...&lt;br /&gt;
        actions = {&lt;br /&gt;
            update-props = {&lt;br /&gt;
                ...&lt;br /&gt;
                bluez5.autoswitch-profile = true&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Screen sharing on Wayland ===&lt;br /&gt;
&lt;br /&gt;
You will need the right [https://github.com/flatpak/xdg-desktop-portal xdg-desktop-portal] backend for your desktop environment. Screen sharing is known to work on:&lt;br /&gt;
* GNOME with &amp;lt;code&amp;gt;xdg-desktop-portal-gtk&amp;lt;/code&amp;gt;&lt;br /&gt;
* KDE Plasma with &amp;lt;code&amp;gt;xdg-desktop-portal-kde&amp;lt;/code&amp;gt; and Firefox&lt;br /&gt;
* Sway with &amp;lt;code&amp;gt;xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; and Firefox&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Start the PipeWire media server. You&#039;ll probably get quite a few errors but just ignore them for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pipewire&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a different terminal window check the default output device. I don&#039;t yet know how this default can be changed for all applications, so you&#039;d better hope it&#039;s right!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-tools&lt;br /&gt;
$ pw-cat -p --list-targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test sound is working using an audio file in a format supported by [http://www.mega-nerd.com/libsndfile/ libsndfile] (e.g. flac, opus, ogg, wav).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pw-cat -p test.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have a microphone test audio recording is working.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pw-cat -r --list-targets&lt;br /&gt;
$ pw-cat -r recording.flac&lt;br /&gt;
(Speak for a while then stop it with Ctrl+c)&lt;br /&gt;
$ pw-cat -p recording.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test PulseAudio clients using a media player (most use PulseAudio) and if you use JACK test that too:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add jack-example-clients&lt;br /&gt;
$ jack_simple_client&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should hear a sustained beep.&lt;br /&gt;
&lt;br /&gt;
If you are happy everything is working, make PipeWire start automatically when your X or Wayland session starts. For example, you could add the &amp;lt;code&amp;gt;pipewire&amp;lt;/code&amp;gt; command to &amp;lt;code&amp;gt;~/.xinitrc&amp;lt;/code&amp;gt; or your window manager&#039;s config file.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== `pw-cat -p --list-targets` shows no targets ===&lt;br /&gt;
&lt;br /&gt;
First, check whether ALSA knows about your sound card:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aplay -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If sound devices are found, the issue is with your pipewire configuration.  Consider double-checking the instructions above.&lt;br /&gt;
&lt;br /&gt;
Otherwise, your sound card may not be supported in the version of the Linux Kernel you&#039;re running.  You should search online for fixes relating to your current kernel version and the codec of your sound card.  You can find each of these with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uname -r&lt;br /&gt;
cat /proc/asound/card0/codec* | grep Codec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [https://gitlab.freedesktop.org/pipewire/pipewire PipeWire source repository]&lt;br /&gt;
* [https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home PipeWire Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/PipeWire PipeWire on the ArchWiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Pipewire PipeWire on the Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Multimedia]]&lt;/div&gt;</summary>
		<author><name>Anjanmomi</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=How_to_get_regular_stuff_working&amp;diff=17773</id>
		<title>How to get regular stuff working</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=How_to_get_regular_stuff_working&amp;diff=17773"/>
		<updated>2020-07-02T05:22:07Z</updated>

		<summary type="html">&lt;p&gt;Anjanmomi: man package is now mandoc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Man pages ==&lt;br /&gt;
&lt;br /&gt;
Not all man-pages are in Alpine, but this will get you most of the way there:&lt;br /&gt;
&lt;br /&gt;
    &#039;&#039;&#039;apk add mandoc man-pages mdocml-apropos less less-doc&#039;&#039;&#039;&lt;br /&gt;
    &#039;&#039;&#039;export PAGER=less&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above only provides &#039;&#039;core&#039;&#039; man pages. Other packages typically don&#039;t include their own man pages (nor other documentation). Rather, they provide an associated package that carries such stuff. For example:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;apk add curl&#039;&#039;&#039;&lt;br /&gt;
    $ &#039;&#039;&#039;man curl&#039;&#039;&#039;&lt;br /&gt;
    man: No entry for curl in the manual.&lt;br /&gt;
    $ &#039;&#039;&#039;apropos curl | wc -l&#039;&#039;&#039;&lt;br /&gt;
    0    &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;&#039;&#039;After adding curl, there are no man pages&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
    $ &#039;&#039;&#039;apk add curl-doc&#039;&#039;&#039;&lt;br /&gt;
    (1/1) Installing curl-doc (7.52.1-r2)&lt;br /&gt;
    Executing mdocml-apropos-1.13.3-r6.trigger&lt;br /&gt;
    OK: 60 MiB in 31 packages&lt;br /&gt;
    $ &#039;&#039;&#039;apropos curl | wc -l&#039;&#039;&#039;&lt;br /&gt;
    366  &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;&#039;&#039;Now, with curl-doc installed, there&#039;s a boatload of pages!&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Not all packages separate out their documentation, but it is the &#039;&#039;Alpine Way&#039;&#039; (e.g. small footprint). Some packages don&#039;t provide any installable documentation at all, neither within themselves nor an associated doc packages. Further, appending &amp;quot;-doc&amp;quot; is merely a convention. In fact, the core man documentations are in man-pages (as in the &#039;&#039;apk add ...&#039;&#039; command, above). To find the right documentation package, try something like:&lt;br /&gt;
&lt;br /&gt;
    $ &#039;&#039;&#039;apk search gcc | grep ^gcc&#039;&#039;&#039;&lt;br /&gt;
    gcc-objc-5.3.0-r0&lt;br /&gt;
    gcc-gnat-5.3.0-r0&lt;br /&gt;
    gcc-5.3.0-r0&lt;br /&gt;
    gcc-java-5.3.0-r0&lt;br /&gt;
    gcc-doc-5.3.0-r0    &amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;&#039;&#039;Here it is!&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINALLY:&#039;&#039;&#039; If you&#039;re wondering why I&#039;ve added &#039;&#039;less&#039;&#039; (and &#039;&#039;less-doc&#039;&#039;), it&#039;s because &#039;&#039;man&#039;&#039; doesn&#039;t work correctly with &#039;&#039;more&#039;&#039; (the default pager). Don&#039;t fret too much about bloating up Alpine, though - adding man pages has a bigger footprint than less (&#039;&#039;&amp;quot;less is more than man&amp;quot;???&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
== Operational hints ==&lt;br /&gt;
&lt;br /&gt;
==== Shell @ commandline ====&lt;br /&gt;
&lt;br /&gt;
Alpine comes with busybox by default.  Busybox is an endpoint for numerous symlinks for various utilities. Though busybox is not that bad, the commands are impaired in functionality.&lt;br /&gt;
&lt;br /&gt;
* Funny characters at the console&lt;br /&gt;
Edit the file at {{Path|/etc/rc.conf}} and change line 92 to:&lt;br /&gt;
  unicode=&amp;quot;YES&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Bash&lt;br /&gt;
It is easy enough to have bash installed, but this does not mean the symlinks to busybox are gone.&lt;br /&gt;
&lt;br /&gt;
Install bash with:   &lt;br /&gt;
   apk add bash bash-doc bash-completion&lt;br /&gt;
&lt;br /&gt;
* Shell utilities (things like grep, [[awk]], ls are all busybox symlinks)&lt;br /&gt;
   apk add util-linux pciutils usbutils coreutils binutils findutils grep&lt;br /&gt;
&lt;br /&gt;
* /etc/{shadow,group} manipulation requires&lt;br /&gt;
   apk add shadow&lt;br /&gt;
&lt;br /&gt;
==== Disk Management ==== &lt;br /&gt;
&lt;br /&gt;
Disk management is so much easier with udisks or udisks2&lt;br /&gt;
&lt;br /&gt;
Installation     &lt;br /&gt;
&lt;br /&gt;
   apk add udisks2 udisks2-doc&lt;br /&gt;
&lt;br /&gt;
See the mounted disks&lt;br /&gt;
&lt;br /&gt;
   udisksctl status&lt;br /&gt;
&lt;br /&gt;
== Compiling : a few notes and a reminder  ==&lt;br /&gt;
&lt;br /&gt;
Compiling in Alpine may be more challenging because it uses [http://www.musl-libc.org/ musl-libc] instead of glibc. Please review [http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc &#039;The functional differences with glibc&#039; ] if you think of porting packages or just for the sake of knowing, of course.&lt;br /&gt;
&lt;br /&gt;
Alpine offers the regular compiler stuff like gcc and cmake ... possible others&lt;br /&gt;
&lt;br /&gt;
==== (unvalidated) apk packages to install so one can start building software ====&lt;br /&gt;
   apk add build-base gcc abuild binutils binutils-doc gcc-doc&lt;br /&gt;
&lt;br /&gt;
==== a complete install for cmake looks like ====&lt;br /&gt;
&lt;br /&gt;
   apk add cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc&lt;br /&gt;
&lt;br /&gt;
==== ccache is also available ====&lt;br /&gt;
&lt;br /&gt;
   apk add ccache ccache-doc&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Anjanmomi</name></author>
	</entry>
</feed>