summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 917da54b5a20056c0e6c7329792b961ee98b977d (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
49
50
51
52
53
54
55
56
57
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=tftp-hpa-git
pkgver=5.2.r10.gb2b34ce
pkgrel=3
pkgdesc="Official tftp server"
arch=('i686' 'x86_64')
url="https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git"
license=('BSD')
depends=('glibc' 'readline>=6.0.00')
makedepends=('git')
provides=("tftp-hpa=$pkgver")
conflicts=('tftp-hpa')
backup=('etc/conf.d/tftpd')
source=("git+https://git.kernel.org/pub/scm/network/tftp/tftp-hpa.git"
        "tftpd.conf::https://gitlab.archlinux.org/archlinux/packaging/packages/tftp-hpa/-/raw/main/tftpd.conf"
        "tftpd.service::https://gitlab.archlinux.org/archlinux/packaging/packages/tftp-hpa/-/raw/main/tftpd.service"
        "tftpd.socket::https://gitlab.archlinux.org/archlinux/packaging/packages/tftp-hpa/-/raw/main/tftpd.socket")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP')


pkgver() {
  cd "tftp-hpa"

  git describe --long --tags | sed 's/^tftp-hpa-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "tftp-hpa"

  ./autogen.sh
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  ./configure \
    --prefix="/usr" \
    --sbindir="/usr/bin"
  make
}

package() {
  cd "tftp-hpa"

  make INSTALLROOT="$pkgdir" install

  install -Dm644 "$srcdir/tftpd.conf" "$pkgdir/etc/conf.d/tftpd"
  install -d "$pkgdir/srv/tftp"
  install -Dm644 "$srcdir/tftpd.service" -t "$pkgdir/usr/lib/systemd/system"
  install -Dm644 "$srcdir/tftpd.socket" -t "$pkgdir/usr/lib/systemd/system"

  sed -n '/Copyright (c) 1983/,/SUCH DAMAGE./p' "tftpd/tftpd.c" > "LICENSE"
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/tftp-hpa"

  # Remove conflict with iputils
  rm "$pkgdir/usr/share/man/man8/tftpd.8"
}