summaryrefslogtreecommitdiff
path: root/create_ca-certificates-utils_shim.sh
blob: 2f7310298f81fcc69c9cfd398934440d33a08d03 (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
#!/bin/sh

. "./default.conf"

# the ca-certificates-utils-shim shim

if test ! -f $STAGE1_CHROOT/packages/$TARGET_CPU/ca-certificates-utils-shim-20170307-1-any.pkg.tar.xz; then

	cd $STAGE1_BUILD || exit 1
	rm -rf ca-certificates-utils-shim
	
	mkdir ca-certificates-utils-shim
	cd ca-certificates-utils-shim || exit 1
	mkdir -p pkg/ca-certificates-utils-shim/etc/ssl/certs/
	cp /etc/ssl/certs/ca-certificates.crt pkg/ca-certificates-utils-shim/etc/ssl/certs/.

	BUILDDATE=$(date '+%s')
	size=$(du -sk --apparent-size pkg/)
	size="$(( ${size%%[^0-9]*} * 1024 ))"
	cat > pkg/ca-certificates-utils-shim/.PKGINFO <<EOF
pkgname = ca-certificates-utils-shim
pkgver = 20170307-1
pkgdesc = Common CA certificates (utilities, from host machine)
url = http://pkgs.fedoraproject.org/cgit/rpms/ca-certificates.git
builddate = $BUILDDATE
size = $size
arch = any
provides = ca-certificates-utils
conflict = ca-certificates-utils
EOF

	cd pkg/ca-certificates-utils-shim || exit 1
	tar cJvf - .PKGINFO ./* | xz > ../../ca-certificates-utils-shim-20170307-1-any.pkg.tar.xz
	cd ../.. || exit 1

	cp -v ./*.pkg.tar.xz $STAGE1_CHROOT/packages/$TARGET_CPU/.
	rm -rf $STAGE1_CHROOT/var/cache/pacman/pkg/*
	rm -rf  $STAGE1_CHROOT/packages/$TARGET_CPU/temp.db*
	rm -rf  $STAGE1_CHROOT/packages/$TARGET_CPU/temp.files*
	repo-add $STAGE1_CHROOT/packages/$TARGET_CPU/temp.db.tar.gz $STAGE1_CHROOT/packages/$TARGET_CPU/*pkg.tar.xz
	sudo pacman --force --noconfirm --config $STAGE1_CHROOT/etc/pacman.conf -r $STAGE1_CHROOT -Syy ca-certificates-utils-shim

fi

echo "ca-certificate shim exists."