# The core of this script is the CGI script, which, as with most things # now-a-days, comes with a handful of pretty (or not so, depending on your # point of view) graphics. Because of that, it and this Makefile need to # know about the web server installation in order to properly insert itself # into the web tree. TOP_WEB = /home/httpd/html/ TOP_URL = http://www.mydomain.com # Somewhat obvious, but this is where you have installed PERL. All of the # scripts, including this Makefile, rely on it. PERL = /usr/bin/perl # What user does your webserver run as? WEBUSER = nobody WEBGROUP= nobody WEBHOST = localhost # We need to know the attributes about the database server and the user # account that has access to create our database. DBHOST = localhost # We need to know what the root account is and password to the database so # we can create the database and the DB user account which will have access # to modify/update the database. DBROOT = root DBROOTPW= # Finally, we need to create an account that will be accessing the database # on a regular database. DBUSER = stnick DBPASS = stnick ##### No User Servicable Parts Below This Line ##### #################################################### ##### !!!!!!!!!!Edit At Your Own Risk!!!!!!!!! ##### DB = secretsanta MYNAME = SecretSanta.php VERSION = 0.80 all: build_files build_templates install: all install_files install_templates install_images finalize_install sql_install echo "Installation Completed" echo sql_install: create_db create_db_user upgrade: all install_files install_templates install_images sql_upgrade echo "Upgrade Completed." build_files: -${PERL} -p -e "s'@@DBHOST@@'${DBHOST}'g; \ s'@@DBUSER@@'${DBUSER}'g; \ s'@@DB@@'${DB}'g; \ s'@@DBPASS@@'${DBPASS}'g; \ " src/connect.php > build/connect.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ s'@@DB@@'${DB}'g; \ s'@@VERSION@@'${VERSION}'g; \ s'@@TOP_URL@@'${TOP_URL}'g; \ " src/core_functions.php > build/core_functions.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ s'@@DB@@'${DB}'g; \ " src/SecretSanta.php > build/SecretSanta.php build_templates: -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/add_to_group.php > build/add_to_group.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/register.php > build/register.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/main.php > build/main.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/menu.php > build/menu.php -${PERL} -p -e "s'@@VERSION@@'${VERSION}'g; \ " src/templates/header_footer.php > build/header_footer.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/login_screen.php > build/login_screen.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/password_screen.php > build/password_screen.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/relationships.php > build/relationships.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/accounts.php > build/accounts.php -${PERL} -p -e "s'@@MYNAME@@'${MYNAME}'g; \ " src/templates/lists.php > build/lists.php fixperms: chown -R ${WEBUSER}:${WEBGROUP} ${TOP_WEB}/secret_santa install_files: install -d ${TOP_WEB}/secret_santa install -m 755 build/core_functions.php ${TOP_WEB}/secret_santa/core_functions.php install -m 755 build/connect.php ${TOP_WEB}/secret_santa/connect.php install -m 755 src/display.php ${TOP_WEB}/secret_santa/display.php install -m 755 build/SecretSanta.php ${TOP_WEB}/secret_santa/SecretSanta.php install_images: install -d ${TOP_WEB}/secret_santa/images install -m 755 src/images/frosty.gif ${TOP_WEB}/secret_santa/images/frosty.gif install -m 755 src/images/santa.gif ${TOP_WEB}/secret_santa/images/santa.gif install -m 755 src/images/list.gif ${TOP_WEB}/secret_santa/images/list.gif install -m 755 src/images/xmastile48.jpg ${TOP_WEB}/secret_santa/images/xmastile48.jpg install -m 755 src/images/xmastile49.jpg ${TOP_WEB}/secret_santa/images/xmastile49.jpg install -m 755 src/images/xmastile50.jpg ${TOP_WEB}/secret_santa/images/xmastile50.jpg install -m 755 src/images/xmastile52.jpg ${TOP_WEB}/secret_santa/images/xmastile52.jpg install_templates: install -d ${TOP_WEB}/secret_santa/templates install -m 755 src/templates/style_sheets.php ${TOP_WEB}/secret_santa/templates/style_sheets.php install -m 755 build/add_to_group.php ${TOP_WEB}/secret_santa/templates/add_to_group.php install -m 755 build/register.php ${TOP_WEB}/secret_santa/templates/register.php install -m 755 build/login_screen.php ${TOP_WEB}/secret_santa/templates/login_screen.php install -m 755 build/header_footer.php ${TOP_WEB}/secret_santa/templates/header_footer.php install -m 755 build/password_screen.php ${TOP_WEB}/secret_santa/templates/password_screen.php install -m 755 build/relationships.php ${TOP_WEB}/secret_santa/templates/relationships.php install -m 755 build/accounts.php ${TOP_WEB}/secret_santa/templates/accounts.php install -m 755 build/lists.php ${TOP_WEB}/secret_santa/templates/lists.php install -m 755 build/main.php ${TOP_WEB}/secret_santa/templates/main.php install -m 755 build/menu.php ${TOP_WEB}/secret_santa/templates/menu.php finalize_install: ln -s ${TOP_WEB}/secret_santa/SecretSanta.php ${TOP_WEB}/secret_santa/index.php chown -R ${WEBUSER}:${WEBGROUP} ${TOP_WEB}/secret_santa create_db: mysqladmin -u ${DBROOT} -h ${DBHOST} -p${DBROOTPW} create ${DB} mysql -u ${DBROOT} -h ${DBHOST} -p${DBROOTPW} ${DB} < src/secretsanta.sql create_db_user: -${PERL} -p -e "s'@@WEBHOST@@'${WEBHOST}'g; \ s'@@DBHOST@@'${DBHOST}'g; \ s'@@DBUSER@@'${DBUSER}'g; \ s'@@DBUROSER@@'${DBROUSER}'g; \ s'@@DBROPASS@@'${DBROPASS}'g; \ s'@@DB@@'${DB}'g; \ s'@@DBPASS@@'${DBPASS}'g; \ " src/account.sql > build/account.sql mysql -u ${DBROOT} -h ${DBHOST} -p${DBROOTPW} mysql < build/account.sql mysqladmin -u ${DBROOT} -h ${DBHOST} -p${DBROOTPW} reload sql_upgrade: mysql -u ${DBROOT} -h ${DBHOST} -p${DBROOTPW} ${DB} < src/upgrade.sql clean: rm build/*