]> gitweb.fluxo.info Git - templater.git/commitdiff
Global Makefile
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Nov 2017 12:13:55 +0000 (10:13 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Nov 2017 12:13:55 +0000 (10:13 -0200)
12 files changed:
TODO.md
share/templater/drupal8/files/Makefile.drupal8 [moved from share/templater/drupal8/files/Makefile with 99% similarity]
share/templater/drupal8/setup
share/templater/ikiwiki/files/Makefile.ikiwiki [moved from share/templater/ikiwiki/files/Makefile with 100% similarity]
share/templater/ikiwiki/files/www/Makefile.ikiwiki [moved from share/templater/ikiwiki/files/www/Makefile with 100% similarity]
share/templater/ikiwiki/setup
share/templater/pelican/files/Makefile.pelican [moved from share/templater/pelican/files/Makefile with 100% similarity]
share/templater/pelican/setup
share/templater/sphinx/files/Makefile.sphinx [moved from share/templater/sphinx/files/Makefile with 100% similarity]
share/templater/sphinx/setup
share/templater/templater/files/Makefile [new file with mode: 0644]
share/templater/templater/functions

diff --git a/TODO.md b/TODO.md
index 8628b12599a9879f20fa2f58962bd54257be7d27..fb669c2af480265929349da256183493b2e8e02d 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -28,5 +28,5 @@ TODO
   * Be verbose about the need to review and edit files, adding LICENSE headers into source files, etc
   * Try an alternative command-line format, like "module:option1=value,option2=value with spaces"
   * Git: optionally configure user.signingkey, commit.gpgsign, etc
-  * Makefile
   * Debian package
+  * Update and diff modes to compare/update configs between a project and templater's defaults
similarity index 99%
rename from share/templater/drupal8/files/Makefile
rename to share/templater/drupal8/files/Makefile.drupal8
index f424f3e7f0bbc3e2a0356faf8719038f1125a697..55375a5a64447e56a927c6fd93991076f94b7489 100644 (file)
@@ -15,7 +15,7 @@ DRUSH      = drush -r $(DRUPAL) -l $(PROJECT)
 
 # Include local customizations/overrides, which might be .gitignore'd
 # See https://www.gnu.org/software/make/manual/html_node/Include.html
--include Makefile.local
+#-include Makefile.local
 
 # Setup production environment
 production: submodules post_receive drush settings ownership
index 470bae12ad997575f96f22e9da37c3688cc4b46f..fde815e4ea48b02387a09a8433de56ef8a5a3c80 100755 (executable)
@@ -22,10 +22,6 @@ function templater_drupal8 {
       echo sql               >> .gitignore
     fi
 
-    if ! grep -q "^Makefile.local" .gitignore; then
-      echo Makefile.local >> .gitignore
-    fi
-
     if [ ! -e "settings.dev.php" ]; then
       cp $SHARE/drupal8/files/default.settings.php settings.dev.php
       #cp $SHARE/drupal8/files/default.settings.php .
@@ -40,13 +36,7 @@ function templater_drupal8 {
 
     ln -sf services.dev.yml services.yml
 
-    if [ ! -e "Makefile" ]; then
-      cp $SHARE/drupal8/files/Makefile .
-    #elif ! grep -q ^drupal: Makefile; then
-    #  grep -v '^#' $SHARE/drupal8/files/Makefile >> Makefile
-    else
-      cp $SHARE/drupal8/files/Makefile Makefile.drupal8
-    fi
+    __templater_install_makefile $SHARE/drupal8/files/Makefile.drupal8
 
     if [ ! -e "drupal.make.yml" ]; then
       cp $SHARE/drupal8/files/drupal.make.yml .
index d1e9b68003dfb973053aeb8f2c072b95759dee3c..68fad556ea246b275cb4df484bf8dca1b02fb5a6 100755 (executable)
@@ -26,13 +26,7 @@ function templater_ikiwiki {
       cp $SHARE/ikiwiki/files/ikiwiki.yaml.
     fi
 
-    if [ ! -e "Makefile" ]; then
-      cp $SHARE/ikiwiki/files/Makefile .
-    #elif ! grep -q ^wiki: Makefile; then
-    #  grep -v '^#' $SHARE/ikiwiki/files/Makefile >> Makefile
-    else
-      cp $SHARE/ikiwiki/files/Makefile Makefile.ikiwiki
-    fi
+    __templater_install_makefile $SHARE/ikiwiki/files/Makefile.ikiwiki
 
     if [ ! -d "templates" ]; then
       cp -r $SHARE/ikiwiki/files/templates .
index 93375ada544d90091997842dc1cfe9c47f88fc65..71929e79e7410782c0b8882eff1d0b7b4dbecc95 100755 (executable)
@@ -19,13 +19,7 @@ function templater_pelican {
 
     cp $SHARE/sphinx/files/pelicanconf.py .
 
-    if [ ! -e "Makefile" ]; then
-      cp $SHARE/pelican/files/Makefile .
-    #elif ! grep -q pelican Makefile; then
-    #  grep -v '^#' $SHARE/pelican/files/Makefile >> Makefile
-    else
-      cp $SHARE/ikiwiki/files/Makefile Makefile.pelican
-    fi
+    __templater_install_makefile $SHARE/pelican/files/Makefile.pelican
 
     if [ ! -d "content" ]; then
       cp -r $SHARE/pelican/files/content .
index ec70c1e44393dee45e89554ef73c861e528252f6..b378ac3fcad22690e7bc16668483b7c7f44bc83d 100755 (executable)
@@ -19,13 +19,7 @@ function templater_sphinx {
 
     cp $SHARE/sphinx/files/conf.py .
 
-    if [ ! -e "Makefile" ]; then
-      cp $SHARE/sphinx/files/Makefile .
-    #elif ! grep -q sphinx Makefile; then
-    #  grep -v '^#' $SHARE/sphinx/files/Makefile >> Makefile
-    else
-      cp $SHARE/ikiwiki/files/Makefile Makefile.sphinx
-    fi
+    __templater_install_makefile $SHARE/sphinx/files/Makefile.sphinx
 
     if [ ! -d "_static" ]; then
       cp -r $SHARE/sphinx/files/_static .
diff --git a/share/templater/templater/files/Makefile b/share/templater/templater/files/Makefile
new file mode 100644 (file)
index 0000000..a53fcbb
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Global Makefile - https://templater.fluxo.info
+#
+# This Makefile contains basic, common targets and also includes
+# any Makefile.* available in the current folder.
+#
+
+# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200
+#     http://php.net/manual/en/features.commandline.webserver.php
+serve:
+       python -m SimpleHTTPServer
+       # Or the Python 3 equivalent
+       #python3 -m http.server
+       #php -S localhost:8000
+
+# Process any other Makefile whose filename matches Makefile.*
+# See https://www.gnu.org/software/make/manual/html_node/Include.html
+-include Makefile.*
index af6be08771ad10d9715c220d6f918b1b39dfe984..47c240b1d0e2de8864aca14c4122023baef36fe3 100644 (file)
@@ -81,3 +81,26 @@ function __templater_user_input {
   fi
 }
 
+# Install the global Makefile
+function __templater_install_makefile {
+  if [ -z "$1" ]; then
+    return
+  fi
+
+  local src="$1"
+  local name="`basename $src`"
+
+  # First ensure we have the main Makefile
+  if [ ! -e "Makefile" ]; then
+    cp $SHARE/templater/files/Makefile .
+  fi
+
+  # Then copy the custom Makefile
+  if [ ! -e "$name" ]; then
+    cp $src .
+  fi
+
+  #if ! grep -q "^Makefile.local" .gitignore; then
+  #  echo Makefile.local >> .gitignore
+  #fi
+}