From fe1ae0a24082f390fca3aaf0e9d0a8243131fafa Mon Sep 17 00:00:00 2001 From: barnold Date: Sat, 15 Oct 2022 14:35:53 +0100 Subject: [PATCH] Drop Makefile.PL, simpler without. --- INSTALL | 22 ++++++++++------------ Makefile.orig => Makefile | 10 ++++++++-- Makefile.PL | 6 ------ 3 files changed, 18 insertions(+), 20 deletions(-) rename Makefile.orig => Makefile (71%) delete mode 100644 Makefile.PL diff --git a/INSTALL b/INSTALL index a9de3f6..a83aa87 100644 --- a/INSTALL +++ b/INSTALL @@ -63,26 +63,24 @@ as postgres, run use any of the targets in Makefile.orig to create and load the catalog database. - $ make -f Makefile.orig PGC_DANGEROUS=1 rebuild-db - $ make -f Makefile.orig load-catalog + $ make PGC_DANGEROUS=1 rebuild-db + $ make load-catalog At this point, "irulan" should be able to run the tests successfully with e.g. $ prove -l -3. To install the perl modules, run (for example) +3. To install the perl modules, run - perl Makefile.PL INSTALL_BASE=~/.local - make test - make install + sudo make install-modules -4. To use these modules from your program, assuming the INSTALL_BASE - suggested above, +which installs under /usr/local/lib/site_perl. Alternatively do e.g. - declare -x PERL5LIB="$HOME/.local/lib/perl5" + make PGC_PERL5LIB=~/.local/lib/perl5 install-modules - and run your program (e.g. pgc-www, - ). +though you'll probably need to set PER5LIB in this case before using +the modules in your perl code. + +Comments and questions welcome at . - diff --git a/Makefile.orig b/Makefile similarity index 71% rename from Makefile.orig rename to Makefile index 76ad4ce..33628cb 100644 --- a/Makefile.orig +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: dangerous drop-db rebuild-db +.PHONY: dangerous drop-db rebuild-db load-catalog install-modules dangerous: ifndef PGC_DANGEROUS @@ -18,6 +18,12 @@ rebuild-db: drop-db --command="COMMIT;" load-catalog: - psql --username="pgc_owner" pg_book_catalog \ + psql --username="pgc_owner" pg_book_catalog \ --command="TRUNCATE TABLE book, author;" bin/load-gutenberg.pl pg_catalog.csv + +PGC_PERL5LIB ?= "/usr/local/lib/site_perl" + +install-modules: + install --directory $(PGC_PERL5LIB) + cp --recursive lib/Book $(PGC_PERL5LIB) diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index b0e8f1d..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,6 +0,0 @@ -use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'Book', - VERSION_FROM => 'lib/Book/Schema.pm' -);