# Maintainer: Que Quotion ( quequotion@bugmenot.com ) # Contributor: bartus ( aur\at\bartus.33mail.com ) pkgname=makepkg-optimize pkgver=18 pkgrel=1 pkgdesc='Supplemental build and packaging optimizations for makepkg' arch=('any') license=('GPL') url='https://wiki.archlinux.org/index.php/Makepkg-optimize' depends=('pacman') optdepends=('upx' 'optipng' 'nodejs-svgo' 'openmp') backup=(etc/makepkg-optimize.conf) _buildenv=({pgo,ZZ-lto,graphite,rice}.sh.in) _executable=({upx,optipng,svgo}-exec.sh.in) _tidy=({upx,optipng,svgo}.sh.in) _conf=({{c,cxx,make,ld,debug-make,cmake-}flags,{buildenv,destdirs,pkgopts{,-param}}_ext,compress-param_max}.conf) source=(${_buildenv[@]} ${_executable[@]} ${_tidy[@]} ${_conf[@]}) sha1sums=('2b746b2d8bf57691f1b25afce96a2752f6eee7e5' '61c765080f3d41dbae15be9212667f9e6364550b' 'd7a3801037333c582dba976db27cf8896bc1b401' 'c99d9cb49dd31924a1cb298bcfe142cef31a9fd3' 'a893c32f2a3fff8b279025ec60f0c3d88143dc1e' '9270b5e33d4508a959688a10c20dec3732763937' '34a33b47a8b667f9dc810737c0f598660b962d4c' '2e69ac6c8e3674faf7e5d1739f9d772d50332fc0' '0022423564ed30dfe91bb3faa7f0c03ddcf4f25f' 'fbd6ee512b6486320d41a007b9670dcf5a3430b6' '4d11331aeff1c1ec3de3759710acc060769ef274' '83a6d62b19184cac1de02c957cd4ea7bbdac9ddb' 'dea4d727d81ac040846555e59ac7c34eb0978233' 'eef21d80145bf64133206beba26fd7fab5a8f5bc' '2e2cd8c680a86518652543fda9092bf2ab594660' '981eab856abb43c5e093620cdf4d8bfa2d690805' '540ce964ef6f3bdda1d7b7fd6297866b1ee895b1' 'efb3ed7d7d5516259709149d7bcd6ec208c07593' '1fc8035e64b739e20c70fbb4eaa5cb7aa1c63c90' '5d0cde13b50641371e4ec4d813d6b2dfae493889' '67801619b39ea4542829a4b715034a9f7ac7cf2c') prepare() { # Use the current makepkg config as a base cp /etc/makepkg.conf ./makepkg-optimize.conf # How to check for the unlikely possiblity that the directory was changed? sed -i "s|@libmakepkgdir@|/usr/share/makepkg|g" *.sh.in for file in *.sh.in; do mv $file ${file%.in}; done #Extra ricer and debugging CFLAGS sed -i "/^CFLAGS/r cflags.conf" makepkg-optimize.conf #Mirror CFLAGS into CXXFLAGS sed -i "/^CXXFLAGS/r cxxflags.conf" makepkg-optimize.conf #Extra ricer Makeflags sed -i "/^MAKEFLAGS/r makeflags.conf" makepkg-optimize.conf #Extra ricer LDFLAGS sed -i "/^LDFLAGS/r ldflags.conf" makepkg-optimize.conf #Debugging flags for make (note, DEBUG_MAKEFLAGS isn't a real thing) sed -i "/^DEBUG_CXXFLAGS/r debug-makeflags.conf" makepkg-optimize.conf #Cmake is a build obfuscation system sed -i "/^#DEBUG_MAKEFLAGS/r cmake-flags.conf" makepkg-optimize.conf #Additional BUIDENV macros sed -i "/^#-- sign/r buildenv_ext.conf" makepkg-optimize.conf #Additional DEST directories sed -i "/^#*SRCPKGDEST=/r destdirs_ext.conf" makepkg-optimize.conf #Additional OPTIONS macros sed -i "/^#-- debug/r pkgopts_ext.conf" makepkg-optimize.conf #Additional OPTIONS parameters sed -i "/^#*PURGE_TARGETS=/r pkgopts-param_ext.conf" makepkg-optimize.conf #Maximum COMPRESS parameters sed -i "/^COMPRESSLZ=/r compress-param_max.conf" makepkg-optimize.conf } package() { # BUILDENV extension scripts install -m644 -D -t ${pkgdir}/usr/share/makepkg/buildenv/ ${_buildenv[@]%.in} # Executable finding scripts install -m644 -D -t ${pkgdir}/usr/share/makepkg/executable/ ${_executable[@]//-exec.sh.in/.sh} # Supplemental Tidy scripts install -m644 -D -t ${pkgdir}/usr/share/makepkg/tidy/ ${_tidy[@]%.in} # Separate config file install -m644 -D -t ${pkgdir}/etc/ makepkg-optimize.conf }