# # Build distribution files. VER?= 2.2.2 PKG= wordpress-${VER} TGZDIR?= ${CURDIR} TGZ= ${TGZDIR}/${PKG}.tar.gz POT_DIR?=/home/nb/wordpress-i18n/pot/tags/2.2.2 POT_FILE?=wordpress.pot WEB_DIR?= /var/www PREFIX?= wp_ DB_USER?= root DB_HOST?= localhost DB_DB?= wp22bg MSG= echo "*" updatepo: @msgmerge -qU messages/bg_BG.po ${POT_DIR}/${POT_FILE} buildmo: @msgfmt messages/bg_BG.po -o messages/bg_BG.mo build: @${MSG} building ${PKG} localized packages @sh build.sh -d ${TGZ} -b ${VER} . clean: @${MSG} cleaning for ${PKG} @rm -f ${PKG}-* install: @${MSG} installing localized ${PKG} into ${WEB_DIR} @tar -C ${WEB_DIR} -xzf ${CURDIR}/${PKG}-bg_BG.tar.gz @${MSG} configuring the installation @cp ${WEB_DIR}/wordpress/wp-config-sample.php ${WEB_DIR}/wordpress/wp-config.php @sed -i -e "s/'DB_NAME', 'wordpress'/'DB_NAME', '${DB_DB}'/" ${WEB_DIR}/wordpress/wp-config.php @sed -i -e "s/'DB_USER', 'username'/'DB_USER', '${DB_USER}'/" ${WEB_DIR}/wordpress/wp-config.php @sed -i -e "s/'DB_PASSWORD', 'password'/'DB_PASSWORD', '${DB_PASS}'/" ${WEB_DIR}/wordpress/wp-config.php @sed -i -e "s/'DB_HOST', 'username'/'DB_HOST', '${DB_HOST}'/" ${WEB_DIR}/wordpress/wp-config.php uninstall: uninstall-dir uninstall-db uninstall-dir: @${MSG} removing wordpress directory @rm -rf ${WEB_DIR}/wordpress/ uninstall-db: @${MSG} removing database tables @echo 'SHOW TABLES;' | mysql -u${DB_USER} -h${DB_HOST} --password=${DB_PASS} ${DB_DB} \ | perl -ne 'chomp; print "DROP TABLE $$_;\n" if /^${PREFIX}/;' \ | mysql -u${DB_USER} -h${DB_HOST} --password=${DB_PASS} ${DB_DB}