summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1b83cd70ebf18cf60d34f09a59566214233b906c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: justforlxz <justforlxz@gmail.com>

pkgname=deepin-pw-check-git
pkgver=5.0.11.r12.g5131a8b
pkgrel=1
pkgdesc='deepin-pw-check is a tool to verify the validity of the password'
arch=('x86_64')
url="https://github.com/linuxdeepin/deepin-pw-check"
license=('GPL3')
depends=('cracklib' 'iniparser' 'pam')
makedepends=('git' 'go' 'golang-github-linuxdeepin-go-dbus-factory-git' 'deepin-gettext-tools')
groups=('deepin-git')
provides=('deepin-pw-check')
conflicts=('deepin-pw-check')
source=("$pkgname::git://github.com/linuxdeepin/deepin-pw-check")
sha512sums=('SKIP')

pkgver() {
    cd $pkgname
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd $pkgname
    export GOPATH="$srcdir/build:/usr/share/gocode"
    export GO111MODULE=off
    go get -v github.com/godbus/dbus
    go get -v github.com/fsnotify/fsnotify
    go get -v gopkg.in/yaml.v3
    sed -i 's/<iniparser\//</g' lib/deepin_pw_check.c
    sed -i 's/<iniparser\//</g' tool/pwd_conf_update.c
    sed -i 's/local\///g' Makefile
}

build() {
  cd $pkgname
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}