50 lines
2.5 KiB
Makefile
50 lines
2.5 KiB
Makefile
02firstboot = $(CHROOT)/usr/local/bin/02firstboot.start
|
|
cert-renew.sh = $(CHROOT)/etc/ssl/cert-renew.sh
|
|
apache_conf = $(CHROOT)/etc/apache2/vhosts.d/default_vhost.include.applorig
|
|
|
|
systemd-units: appliance/MySQL-Backup.sh appliance/backup.service appliance/backup.timer appliance/cert-renew.service appliance/cert-renew.timer
|
|
cp appliance/MySQL-Backup.sh $(CHROOT)/usr/local/bin/
|
|
cp appliance/backup.service appliance/backup.timer appliance/cert-renew.service appliance/cert-renew.timer $(CHROOT)/etc/systemd/system/
|
|
|
|
$(02firstboot): appliance/02firstboot.start
|
|
mkdir -p $(CHROOT)/etc/local.d
|
|
cp $< $@
|
|
touch $(CHROOT)/02firstboot
|
|
|
|
$(cert-renew.sh): appliance/cert-renew.sh
|
|
mkdir -p $(CHROOT)/etc/ssl
|
|
cp $< $@
|
|
|
|
$(apache_conf): apache/default_vhost.include
|
|
sed -i 's/-D LANGUAGE/-D LANGUAGE -D PROXY/' $(CHROOT)/etc/conf.d/apache2
|
|
mv $(CHROOT)/etc/apache2/vhosts.d/default_vhost.include $@
|
|
cp $< $(CHROOT)/etc/apache2/vhosts.d/default_vhost.include
|
|
|
|
$(CHROOT)/var/lib/mysql: mariadb/my.cnf.root
|
|
# MariaDB-Konfiguration ($$, weil make ein $ entfernt)
|
|
sed -i "s/^character-set-server.*$$/character-set-server = utf8mb4/" $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
sed -iE 's/^\(log-bin\)/#\1/' $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "collation-server = utf8mb4_general_ci" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "transaction_isolation = READ-COMMITTED" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "binlog_format = ROW" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "expire_logs_days = 3" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "innodb_file_per_table = 1" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "innodb_large_prefix = on" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "innodb_buffer_pool_size = 2G" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
echo "innodb_strict_mode = OFF" >> $(CHROOT)/etc/mysql/mariadb.d/50-distro-server.cnf
|
|
cp mariadb/my.cnf.root $(CHROOT)/root/.my.cnf
|
|
chmod 0600 $(CHROOT)/root/.my.cnf
|
|
rm -rf $(CHROOT)/var/lib/mysql/*
|
|
RUN bash -c 'yes gentoo | emerge --config dev-db/mariadb'
|
|
|
|
preinstall:
|
|
|
|
postinstall: systemd-units $(apache_conf) $(02firstboot) $(cert-renew.sh) $(CHROOT)/var/lib/mysql
|
|
|
|
|
|
# Apache-Konfiguration
|
|
sed -i 's/-D LANGUAGE/-D LANGUAGE -D PROXY/' $(CHROOT)/etc/conf.d/apache2
|
|
mv $(CHROOT)/etc/apache2/vhosts.d/default_vhost.include $(CHROOT)/etc/apache2/vhosts.d/default_vhost.include.orig
|
|
cp apache/default_vhost.include $(CHROOT)/etc/apache2/vhosts.d/
|