# # Build distribution files. VER?= 2.7-beta3 PKG= wordpress-${VER} TGZDIR?= ${CURDIR} TGZ= ${TGZDIR}/${PKG}.tar.gz POT_DIR?=${HOME}/wordpress-i18n/pot/trunk POT_FILE?=wordpress.pot KUBRICK_POT_DIR?=${HOME}/wordpress-i18n/theme/trunk KUBRICK_POT_FILE?=kubrick.pot WEB_DIR?= /www PREFIX?= wp_ DB_USER?= root DB_HOST?= localhost DB_DB?= wpbg MSG= echo "*" updatepo: @${MSG} getting current POT file @svn up ${POT_DIR}/${POT_FILE} @${MSG} updating bg_BG.po from ${POT_DIR}/${POT_FILE} @msgmerge -q messages/bg_BG.po ${POT_DIR}/${POT_FILE} -o messages/bg_BG.po @${MSG} updating kubrick/bg_BG.po from ${KUBRICK_POT_DIR}/${KUBRICK_POT_FILE} @msgmerge -q messages/kubrick/bg_BG.po ${KUBRICK_POT_DIR}/${KUBRICK_POT_FILE} -o messages/kubrick/bg_BG.po buildmo: @msgfmt -c --statistics messages/bg_BG.po -o messages/bg_BG.mo @msgfmt -c --statistics messages/kubrick/bg_BG.po -o messages/kubrick/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} reinstall: uninstall install