archrelease: copy trunk to community-any
[ArchLinux/community.git] / pesign / trunk / PKGBUILD
blobc7267ef1f1344897296346558cc28d34c3b59ffe
1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: Bruno Pagani <archange@archlinux.org>
3 # Contributor: Mirco Tischler <mt-ml at gmx dot de>
5 pkgname=pesign
6 pkgver=116
7 pkgrel=1
8 pkgdesc="Linux tools for signed PE-COFF binaries"
9 arch=(x86_64)
10 url="https://github.com/rhboot/pesign"
11 license=(GPL3)
12 depends=(
13   bash
14   gcc-libs
15   glibc
16   efivar
17   util-linux-libs
18   nspr
19   nss
20   popt
22 makedepends=(mandoc)
23 options=(debug)
24 source=(
25   $pkgname-$pkgver.tar.gz::https://github.com/rhboot/$pkgname/archive/$pkgver.tar.gz
26   $pkgname-116-remove_root_check.patch
27   $pkgname.sysusers
28   $pkgname.tmpfiles
29   $pkgname.service
30   $pkgname-create-db.service
32 sha512sums=('c76a67e6ce59911ccde371080b38c08d17f5e418bf415ee112cc433f1b27ccf56c5f5580c21b17354f5d3017c2e6f13af31958179a6ad80e5e908535d215227c'
33             'c79365268a56111af98b5ed20518df9ab955531d4a3978de83b2491ae9b96643cc7bfb6f24ca493885275429a4ecb79e6edb8135206ea65c4147d63727aa8f3a'
34             '46c9958170924632fdf8fdf7b07eac5b35fc2a9292c84e346d9fc69cbedbfb762fc911c5c5dbf6e8391fa38a4f747b891dd295f14b47f594814572a07fcbc44c'
35             '2dca9a1aba9485afe6f07b7a3d9ee1dd0cd7640264f7584e739cab126b501ac1962a3b37509744a2b77abc613c75222801daf2e4fd97dd5211d19fbb7bd9ec33'
36             '5e4eb101b01fd688ca915051e25978e6b7a27ad2588c6b04ed52c179a00c04c1298080f9c2c0ae982cd0d861c649e5e6c244e54cb4962ca39c1d2264d1ec12df'
37             '14a161ec3a883d5c17581a6743a9b5e67e1617228966c4972933a055618f157aafefe8b0f648cb07251f0076384dd19be605acc6b1d31e7dec67749a682f505c')
38 b2sums=('41c6cba82d34b13406167ea171d1630b158246259c242bd0f339da45d86a66789940f9d5361199efbf52f181bbc1653b7e1807039bcb829b26d73c7f92bfc1b5'
39         '77edd4517c46c71d63c8003045ae16b9a252bf9e0e070066142f397b21d2a3634d4c4e72d1eab0a32aed441d860db7c7b9546d6b018200a6d85f9b32bf577ec2'
40         'c4a1934f747207ffc6414db831ef138318a062e3b7186891e5294b7fb87b843204070573c762aa8da519f9c076601d8d343fcd2c336c9f7f78ee32781e930def'
41         'ea7e579848648df60da248f657402cdbe3b0b866e6dcf7c062a39914e297f1dde91ec8a7d7dcfa3081c4309604c464a9e3f1263795cc3001fdbaef711028d3e5'
42         '8daa7a7b5042a1d19ef53092b4c200d5ce12736d72dd561fac1adf6262db18dfc54eeaad7cf28365e06dc8322ba435674d608fdeb165c86c9f148852c2e48cea'
43         '94bb44d1a95a31958b2808ae70782c3f3e38c26a132659ded7cf7ba5548e39b790bf54e6e62f0b3634fbcd21d68b62108e2ce18b0689500982225f45ca5a3b2e')
45 prepare() {
46   # -Werror, not even once
47   sed -e 's/\-Werror//g' -i $pkgname-$pkgver/Make.defaults
48   # remove root check so that we may run as unprivileged user: https://github.com/rhboot/pesign/issues/57
49   patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-116-remove_root_check.patch
52 build() {
53   make -C $pkgname-$pkgver
56 package() {
57   local make_options=(
58     DESTDIR="$pkgdir"
59     rundir=/run/
60     libdir=/usr/lib/
61     libexecdir=/usr/lib/
62     install
63     -C $pkgname-$pkgver
64   )
66   make "${make_options[@]}"
68   # remove a lot of stuff that we don't need
69   # rm -rfv "$pkgdir/"{run,var,etc/{rpm,pesign,pki},usr/lib}
70   rm -frv "$pkgdir/"{run,etc/{rpm,pki/pesign-rh-test/}}
72   install -vDm 644 $pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
73   install -vDm 644 $pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
75   # install custom service, that can run as separate user
76   install -vDm 644 $pkgname*.service -t "$pkgdir/usr/lib/systemd/system/"
77   install -vdm 755 "$pkgdir/etc/pki/pesign"