···11-#!/hint/bash
22-#
33-# /etc/makepkg.conf
44-#
55-66-#########################################################################
77-# SOURCE ACQUISITION
88-#########################################################################
99-#
1010-#-- The download utilities that makepkg should use to acquire sources
1111-# Format: 'protocol::agent'
1212-DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
1313- 'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
1414- 'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
1515- 'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
1616- 'rsync::/usr/bin/rsync --no-motd -z %u %o'
1717- 'scp::/usr/bin/scp -C %u %o')
1818-1919-# Other common tools:
2020-# /usr/bin/snarf
2121-# /usr/bin/lftpget -c
2222-# /usr/bin/wget
2323-2424-#-- The package required by makepkg to download VCS sources
2525-# Format: 'protocol::package'
2626-VCSCLIENTS=('bzr::breezy'
2727- 'fossil::fossil'
2828- 'git::git'
2929- 'hg::mercurial'
3030- 'svn::subversion')
3131-3232-#########################################################################
3333-# ARCHITECTURE, COMPILE FLAGS
3434-#########################################################################
3535-#
3636-CARCH="x86_64"
3737-CHOST="x86_64-pc-linux-gnu"
3838-3939-#-- Compiler and Linker Flags
4040-#CPPFLAGS=""
4141-CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
4242- -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
4343- -fstack-clash-protection -fcf-protection"
4444-CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
4545-LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
4646-LTOFLAGS="-flto=auto"
4747-#RUSTFLAGS="-C opt-level=2"
4848-#-- Make Flags: change this for DistCC/SMP systems
4949-MAKEFLAGS="-j8"
5050-#-- Debugging flags
5151-DEBUG_CFLAGS="-g"
5252-DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
5353-#DEBUG_RUSTFLAGS="-C debuginfo=2"
5454-5555-#########################################################################
5656-# BUILD ENVIRONMENT
5757-#########################################################################
5858-#
5959-# Makepkg defaults: BUILDENV=(!distcc !color !ccache check !sign)
6060-# A negated environment option will do the opposite of the comments below.
6161-#
6262-#-- distcc: Use the Distributed C/C++/ObjC compiler
6363-#-- color: Colorize output messages
6464-#-- ccache: Use ccache to cache compilation
6565-#-- check: Run the check() function if present in the PKGBUILD
6666-#-- sign: Generate PGP signature file
6767-#
6868-BUILDENV=(!distcc color !ccache check !sign)
6969-#
7070-#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
7171-#-- specify a space-delimited list of hosts running in the DistCC cluster.
7272-#DISTCC_HOSTS=""
7373-#
7474-#-- Specify a directory for package building.
7575-#BUILDDIR=/tmp/makepkg
7676-7777-#########################################################################
7878-# GLOBAL PACKAGE OPTIONS
7979-# These are default values for the options=() settings
8080-#########################################################################
8181-#
8282-# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
8383-# A negated option will do the opposite of the comments below.
8484-#
8585-#-- strip: Strip symbols from binaries/libraries
8686-#-- docs: Save doc directories specified by DOC_DIRS
8787-#-- libtool: Leave libtool (.la) files in packages
8888-#-- staticlibs: Leave static library (.a) files in packages
8989-#-- emptydirs: Leave empty directories in packages
9090-#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
9191-#-- purge: Remove files specified by PURGE_TARGETS
9292-#-- debug: Add debugging flags as specified in DEBUG_* variables
9393-#-- lto: Add compile flags for building with link time optimization
9494-#
9595-OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
9696-9797-#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
9898-INTEGRITY_CHECK=(sha256)
9999-#-- Options to be used when stripping binaries. See `man strip' for details.
100100-STRIP_BINARIES="--strip-all"
101101-#-- Options to be used when stripping shared libraries. See `man strip' for details.
102102-STRIP_SHARED="--strip-unneeded"
103103-#-- Options to be used when stripping static libraries. See `man strip' for details.
104104-STRIP_STATIC="--strip-debug"
105105-#-- Manual (man and info) directories to compress (if zipman is specified)
106106-MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
107107-#-- Doc directories to remove (if !docs is specified)
108108-DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
109109-#-- Files to be removed from all packages (if purge is specified)
110110-PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
111111-#-- Directory to store source code in for debug packages
112112-DBGSRCDIR="/usr/src/debug"
113113-114114-#########################################################################
115115-# PACKAGE OUTPUT
116116-#########################################################################
117117-#
118118-# Default: put built package and cached source in build directory
119119-#
120120-#-- Destination: specify a fixed directory where all packages will be placed
121121-#PKGDEST=/home/packages
122122-#-- Source cache: specify a fixed directory where source files will be cached
123123-#SRCDEST=/home/sources
124124-#-- Source packages: specify a fixed directory where all src packages will be placed
125125-#SRCPKGDEST=/home/srcpackages
126126-#-- Log files: specify a fixed directory where all log files will be placed
127127-#LOGDEST=/home/makepkglogs
128128-#-- Packager: name/email of the person or organization building packages
129129-#PACKAGER="John Doe <john@doe.com>"
130130-#-- Specify a key to use for package signing
131131-#GPGKEY=""
132132-133133-#########################################################################
134134-# COMPRESSION DEFAULTS
135135-#########################################################################
136136-#
137137-#COMPRESSGZ=(gzip -c -f -n)
138138-COMPRESSGZ=(pigz -c -f -n)
139139-#COMPRESSBZ2=(bzip2 -c -f)
140140-COMPRESSBZ2=(lbzip2 -c -f)
141141-COMPRESSXZ=(xz -c -z -)
142142-COMPRESSZST=(zstd -c -z -q -)
143143-COMPRESSLRZ=(lrzip -q)
144144-COMPRESSLZO=(lzop -q)
145145-COMPRESSZ=(compress -c -f)
146146-COMPRESSLZ4=(lz4 -q)
147147-#COMPRESSLZ=(lzip -c -f)
148148-COMPRESSLZ=(plzip -c -f)
149149-150150-#########################################################################
151151-# EXTENSION DEFAULTS
152152-#########################################################################
153153-#
154154-PKGEXT='.pkg.tar.zst'
155155-SRCEXT='.src.tar.gz'
156156-157157-#########################################################################
158158-# OTHER
159159-#########################################################################
160160-#
161161-#-- Command used to run pacman as root, instead of trying sudo and su
162162-#PACMAN_AUTH=()