mkdir -p /home/znc/usr/lib/
mkdir -p /home/znc/usr/local/lib/pkgconfig
mkdir -p /home/znc/usr/local/bin/
mkdir -p /home/znc/usr/local/share/
mkdir -p /home/znc/usr/local/man/man1/
mkdir -p /home/znc/usr/libexec/
mkdir -p /home/znc/etc/ssl
mkdir -p /home/znc/dev/
mkdir -p /home/znc/var/run/
mkdir -p /home/znc/home/znc/.znc
mknod -m 644 /home/znc/dev/random c 45 0
mknod -m 644 /home/znc/dev/urandom c 45 2
mknod -m 666 /home/znc/dev/null c 2 2
cp /usr/lib/lib{c++,c++abi,c,crypto,m,pthread,ssl,z}.so.* /home/znc/usr/lib/
cp /usr/libexec/ld.so /home/znc/usr/libexec/
cp /etc/resolv.conf /home/znc/etc/
cp /etc/ssl/cert.pem /home/znc/etc/ssl/
cp /var/run/ld.so.hints /home/znc/var/run/
cp /usr/local/bin/znc /home/znc/usr/local/bin/
cp /usr/local/man/man1/znc.1 /home/znc/usr/local/man/man1/
cp /usr/local/man/man1/znc-buildmod.1 /home/znc/usr/local/man/man1/
cp /usr/local/bin/znc-buildmod /home/znc/usr/local/bin/
cp /usr/local/lib/pkgconfig/znc.pc /home/znc/usr/local/lib/pkgconfig/
cp /usr/local/lib/libicu{uc,data,i18n}.so.* /home/znc/usr/local/lib/
cp /usr/local/lib/libboost_{locale,chrono,system,thread}-mt.so.* /home/znc/usr/local/lib/
cp /usr/local/lib/libargon2.so.* /home/znc/usr/local/lib/
cp -R /usr/local/share/znc               /home/znc/usr/local/share/
cp -R /usr/local/lib/znc                 /home/znc/usr/local/lib/
cp -R /usr/local/share/icu /home/znc/usr/local/share/
cp -R /usr/local/lib/icu   /home/znc/usr/local/lib/
cp -R /usr/local/include/znc             /home/znc/usr/local/include/
for LANG in pt_BR bg_BG de_DE el_GR es_ES fr_FR id_ID it_IT nl_NL pl_PL ru_RU
do
        mkdir -p /home/znc/usr/local/share/locale/$LANG/LC_MESSAGES
	cp -R /usr/local/share/locale/$LANG/LC_MESSAGES/znc*.mo /home/znc/usr/local/share/locale/$LANG/LC_MESSAGES
done
chown -R znc:znc /home/znc/
chown -R root:wheel /home/znc/dev /home/znc/etc /home/znc/usr /home/znc/var
chmod -R o-rx /home/znc/home/znc/.znc/
usermod -G znc _identd

