Skip to content

Commit

Permalink
Easier to install rehash work
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Casadevall <mcasadevall@soylentnews.org>
  • Loading branch information
NCommander committed Jul 6, 2015
1 parent fe57748 commit 73b3a80
Show file tree
Hide file tree
Showing 3 changed files with 1,388 additions and 38 deletions.
290 changes: 290 additions & 0 deletions Makefile
Expand Up @@ -37,6 +37,29 @@ INSTALL = install
UNAME = `uname`
MAKE = make -s

# Build stuff
ENVIRONMENT_PREFIX=/opt/rehash-environment

# Apache stuff
APACHE_MIRROR=http://apache.osuosl.org/httpd
APACHE_VER=2.2.29
APACHE_DIR=httpd-$(APACHE_VER)
APACHE_FILE=$(APACHE_DIR).tar.bz2

# Perl stuff
PERL_MIRROR=http://www.cpan.org/src/5.0/
PERL_VER=5.22.0
PERL_DIR=perl-$(PERL_VER)
PERL_FILE=$(PERL_DIR).tar.gz
REHASH_PERL=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER)/bin/perl
REHASH_CPANM=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER)/bin/cpanm

# mod_perl stuff
MOD_PERL_MIRROR=http://mirror.cogentco.com/pub/apache/perl/
MOD_PERL_VER=2.0.8
MOD_PERL_DIR=mod_perl-$(MOD_PERL_VER)
MOD_PERL_FILE=$(MOD_PERL_DIR).tar.gz

# Subdirectories excl. CVS in the current directory (like plugins/ or tagboxes/)
SUBDIRS = `find . -maxdepth 1 -name CVS -prune -o -type d -name [a-zA-Z]\* -print`

Expand Down Expand Up @@ -289,6 +312,9 @@ clean:
(cd plugins; $(MAKE) clean)
find ./ | grep Makefile.old | xargs rm

distclean: clean
rm -r dist build stamp

dist: $(DISTVNAME).tar$(SUFFIX)

$(DISTVNAME).tar$(SUFFIX) : distdir
Expand All @@ -311,3 +337,267 @@ manifest :
rpm :
rpm -ba slash.spec

build-environment: stamp/apache-built stamp/perl-built stamp/mod-perl-built stamp/install-cpamn stamp/install-apache2-upload stamp/install-data-javascript-anon stamp/install-date-calc stamp/install-date-format stamp/install-date-language stamp/install-date-parse stamp/install-datetime-format-mysql stamp/install-dbd-mysql stamp/install-digest-md5 stamp/install-email-valid stamp/install-gd stamp/install-gd-text-align stamp/install-html-entities stamp/install-html-formattext stamp/install-html-tagset stamp/install-html-tokeparser stamp/install-html-treebuilder stamp/install-http-request stamp/install-image-size stamp/install-javascript-minifier stamp/install-json stamp/install-lingua-stem stamp/install-lwp-parallel-useragent stamp/install-lwp-useragent stamp/install-mail-address stamp/install-mail-bulkmail stamp/install-mail-sendmail stamp/install-mime-types stamp/install-mojo-server-daemon stamp/install-net-ip stamp/install-net-server stamp/install-schedule-cron stamp/install-soap-lite stamp/install-sphinx-search stamp/install-template stamp/install-xml-parser stamp/install-xml-parser-expat stamp/install-xml-rss
@echo ""
@echo "Rehash Environment Successfully Installed!"
@echo ""
@echo "If you're reading this, the following software was "
@echo "installed to $(ENVIRONMENT_PREFIX):"
@echo ""
@echo "httpd: $(APACHE_VER)"
@echo "perl: $(PERL_VER)"
@echo "mod_perl: $(MOD_PERL_VER)"
@echo ""
@echo "As well as the latest version of rehash's dependencies"
@echo "from CPAN. It's recommended everytime you upgrade"
@echo "your site, you re-run build-environment to update"
@echo "everything to the latest version."
@echo ""
@echo "If Upgrading:"
@echo "Your old apache/perl directories have been left in"
@echo "place; before switching over to the new versions,"
@echo "make sure you update httpd.conf and migrate"
@echo "DBIx::Password to your new perl directory. See INSTALL"
@echo "for more information."
@echo ""
@echo "For New Installs:"
@echo "Rehash has one final dependency not handled by this"
@echo "script: DBIx::Password. You can install it by running"
@echo "make install-dbi-password, but make sure to check "
@echo "INSTALL for more information before running this"
@echo "this command!"
@echo ""
@echo "Feel free to join us in #dev on irc.soylentnews.org"
@echo "if you need help or have any questions!"
@echo ""
@echo "Thanks for installing Rehash."

get-rehash-dependencies: dist/$(APACHE_FILE) dist/$(PERL_FILE) dist/$(MOD_PERL_FILE)

dist/$(APACHE_FILE):
-mkdir dist
cd dist; wget $(APACHE_MIRROR)/$(APACHE_FILE)

stamp/apache-built: dist/$(APACHE_FILE)
-mkdir build stamp
-rm -rf build/$(APACHE_DIR)
cd build && tar jxf ../dist/$(APACHE_FILE); cd $(APACHE_DIR) && ./configure --prefix=$(ENVIRONMENT_PREFIX)/apache-$(APACHE_VER) --enable-mods-shared=most && make && make install
touch stamp/apache-built

dist/$(PERL_FILE):
-mkdir dist
cd dist; wget $(PERL_MIRROR)/$(PERL_FILE)

stamp/perl-built: dist/$(PERL_FILE)
-mkdir build stamp
-rm -rf build/$(PERL_DIR)
cd build && tar zxf ../dist/$(PERL_FILE) && cd $(PERL_DIR) && ./Configure -des -Dprefix=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER) -Duseshrplib -Dusethreads && make && make check && make install
touch stamp/perl-built

dist/$(MOD_PERL_FILE):
-mkdir dist
cd dist; wget $(MOD_PERL_MIRROR)/$(MOD_PERL_FILE)

stamp/mod-perl-built: dist/$(MOD_PERL_FILE)
-mkdir build stamp
-rm -rf build/$(MOD_PERL_DIR)
cd build && tar xvf ../dist/$(MOD_PERL_FILE) && cd $(MOD_PERL_DIR) && $(REHASH_PERL) Makefile.PL MP_APXS=$(ENVIRONMENT_PREFIX)/apache-$(APACHE_VER)/bin/apxs && make && make test && make install
touch stamp/mod-perl-built

stamp/install-cpamn:
-mkdir stamp
$(REHASH_PERL) utils/cpanm App::cpanminus
touch stamp/install-cpamn

stamp/install-apache2-upload:
-mkdir stamp
$(REHASH_CPANM) Apache2::Upload
touch stamp/install-apache2-upload

stamp/install-data-javascript-anon:
-mkdir stamp
$(REHASH_CPANM) Data::JavaScript::Anon
touch stamp/install-data-javascript-anon

stamp/install-date-calc:
-mkdir stamp
$(REHASH_CPANM) Date::Calc
touch stamp/install-date-calc

stamp/install-date-format:
-mkdir stamp
$(REHASH_CPANM) Date::Format
touch stamp/install-date-format

stamp/install-date-language:
-mkdir stamp
$(REHASH_CPANM) Date::Language
touch stamp/install-date-language

stamp/install-date-parse:
-mkdir stamp
$(REHASH_CPANM) Date::Parse
touch stamp/install-date-parse

stamp/install-datetime-format-mysql:
-mkdir stamp
$(REHASH_CPANM) DateTime::Format::MySQL
touch stamp/install-datetime-format-mysql

stamp/install-dbd-mysql:
-mkdir stamp
$(REHASH_CPANM) DBD::mysql
touch stamp/install-dbd-mysql

stamp/install-digest-md5:
-mkdir stamp
$(REHASH_CPANM) Digest::MD5
touch stamp/install-digest-md5

stamp/install-email-valid:
-mkdir stamp
$(REHASH_CPANM) Email::Valid
touch stamp/install-email-valid

stamp/install-gd:
-mkdir stamp
$(REHASH_CPANM) GD
touch stamp/install-gd

stamp/install-gd-text-align:
-mkdir stamp
$(REHASH_CPANM) GD::Text::Align
touch stamp/install-gd-text-align

stamp/install-html-entities:
-mkdir stamp
$(REHASH_CPANM) HTML::Entities
touch stamp/install-html-entities

stamp/install-html-formattext:
-mkdir stamp
$(REHASH_CPANM) HTML::FormatText
touch stamp/install-html-formattext

stamp/install-html-tagset:
-mkdir stamp
$(REHASH_CPANM) HTML::Tagset
touch stamp/install-html-tagset

stamp/install-html-tokeparser:
-mkdir stamp
$(REHASH_CPANM) HTML::TokeParser
touch stamp/install-html-tokeparser

stamp/install-html-treebuilder:
-mkdir stamp
$(REHASH_CPANM) HTML::TreeBuilder
touch stamp/install-html-treebuilder

stamp/install-http-request:
-mkdir stamp
$(REHASH_CPANM) HTTP::Request
touch stamp/install-http-request

stamp/install-image-size:
-mkdir stamp
$(REHASH_CPANM) Image::Size
touch stamp/install-image-size

stamp/install-javascript-minifier:
-mkdir stamp
$(REHASH_CPANM) JavaScript::Minifier
touch stamp/install-javascript-minifier

stamp/install-json:
-mkdir stamp
$(REHASH_CPANM) JSON
touch stamp/install-json

stamp/install-lingua-stem:
-mkdir stamp
$(REHASH_CPANM) Lingua::Stem
touch stamp/install-lingua-stem

stamp/install-lwp-parallel-useragent:
-mkdir stamp
$(REHASH_CPANM) LWP::Parallel::UserAgent
touch stamp/install-lwp-parallel-useragent

stamp/install-lwp-useragent:
-mkdir stamp
$(REHASH_CPANM) LWP::UserAgent
touch stamp/install-lwp-useragent

stamp/install-mail-address:
-mkdir stamp
$(REHASH_CPANM) Mail::Address
touch stamp/install-mail-address

stamp/install-mail-bulkmail:
-mkdir stamp
$(REHASH_CPANM) Mail::Bulkmail
touch stamp/install-mail-bulkmail

stamp/install-mail-sendmail:
-mkdir stamp
$(REHASH_CPANM) Mail::Sendmail
touch stamp/install-mail-sendmail

stamp/install-mime-types:
-mkdir stamp
$(REHASH_CPANM) MIME::Types
touch stamp/install-mime-types

stamp/install-mojo-server-daemon:
-mkdir stamp
$(REHASH_CPANM) Mojo::Server::Daemon
touch stamp/install-mojo-server-daemon

stamp/install-net-ip:
-mkdir stamp
$(REHASH_CPANM) Net::IP
touch stamp/install-net-ip

stamp/install-net-server:
-mkdir stamp
$(REHASH_CPANM) Net::Server
touch stamp/install-net-server

stamp/install-schedule-cron:
-mkdir stamp
$(REHASH_CPANM) Schedule::Cron
touch stamp/install-schedule-cron

stamp/install-soap-lite:
-mkdir stamp
$(REHASH_CPANM) SOAP::Lite
touch stamp/install-soap-lite

stamp/install-sphinx-search:
-mkdir stamp
$(REHASH_CPANM) Sphinx::Search
touch stamp/install-sphinx-search

stamp/install-template:
-mkdir stamp
$(REHASH_CPANM) Template
touch stamp/install-template

stamp/install-xml-parser:
-mkdir stamp
$(REHASH_CPANM) XML::Parser
touch stamp/install-xml-parser

stamp/install-xml-parser-expat:
-mkdir stamp
$(REHASH_CPANM) XML::Parser::Expat
touch stamp/install-xml-parser-expat

stamp/install-xml-rss:
-mkdir stamp
$(REHASH_CPANM) XML::RSS
touch stamp/install-xml-rss

install-dbi-password:
$(REHASH_CPANM) DBIx::Password

0 comments on commit 73b3a80

Please sign in to comment.