summaryrefslogtreecommitdiff
path: root/nonprism/your-privacy/PKGBUILD
blob: 6b4f52e3825a9db171140069fcd5ac0e7712ff5c (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
58
59
60
# SPDX-License-Identifier: CC0-1.0
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>


# NOTE: This PKGBUILD does not need to be edited manually.
#       The package is normally built automatically by autobuilder.
#       To generate a new package, simply push changes to blacklist.git.
#       The autobuilder will modify this PKGBUILD,
#       replacing $pkgver, $_gitver, and the checksum (updpkgsums),
#       build and publish the package,
#       and commit the modified PKGBUILD to abslibre.


pkgname=your-privacy
pkgver=20221006
pkgrel=1
_gitver=ab32447a5a47a2a5ec5a3fa6043dc6b9024e3674
pkgdesc="This package will remove support for protocols and services known to endanger privacy."
arch=(any)
url=https://wiki.parabola.nu/Blacklist
license=(GPL3)

makedepends=(librelib)
backup=(etc/NetworkManager/conf.d/20-connectivity.conf)
install=${pkgname}.install

source=(${pkgname}-blacklist-${_gitver}.txt::https://git.parabola.nu/blacklist.git/plain/${pkgname}-blacklist.txt?id=${_gitver}
        archlinux-keyring.hook)

sha512sums=('9ab837a9ca351bb844ecdfc147d69ec1f0d1971fbe12ceeed3b837fc59c54b10d2476901e60f677b0f53166a805b493b0a8bcd638e9e6638012dd454c7930cf8'
            '4f0e63c89ceb06ac976902355e2b0f9607abc3f910ac16cf90fefb46b70ba5a8c7b4c196a1767bf9b4a274da3b97faa54bed039e83f483dc2bc6d7daa3f20d91')


package()
{
  # collect blacklisted package names as pacman conflicts
  conflicts=( $( libreblacklist normalize < blacklist-${_gitver}.txt | \
                 cut -d: -f1,2                                       | \
                 sed -n 's/:$//p'                                    | \
                 sort -u                                             ) )

  install -Dm644 ${pkgname}-blacklist-${_gitver}.txt "${pkgdir}"/usr/share/doc/${pkgname}/blacklist.txt

  # disable automatic archlinux-keyring refresh
  install -Dm644 archlinux-keyring.hook "${pkgdir}"/usr/share/libalpm/hooks/archlinux-keyring.hook

  # disable NetworkManager connectviity check
  # TODO: This may disable some user-friendliness features.
  #       Something a bit more sophisticated may be needed,
  #       such as a source-level replacement check:
  #         $ dns_ip=$(sed 's|^nameserver ||p;d' /etc/resolv.conf) ; [[ -n "${dns_ip}" ]] && ping -c 1 ${dns_ip} &> /dev/null ;
  #       As of now, we are over-riding 'networkmanager' only for [nonsystemd],
  #       which already changes the target URI to parabola.nu.
  #       This simple solution is an attempt to avoid also packaging it for [nonprism].
  install -Dm644 /dev/stdin "${pkgdir}"/etc/NetworkManager/conf.d/20-connectivity.conf <<EOF
[connectivity]
uri=https://www.parabola.nu/static/nm-check.txt
enabled=false
EOF
}