aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/templater/drupal8/files/Makefile.drupal8 (renamed from share/templater/drupal8/files/Makefile)2
-rwxr-xr-xshare/templater/drupal8/setup12
-rw-r--r--share/templater/ikiwiki/files/Makefile.ikiwiki (renamed from share/templater/ikiwiki/files/Makefile)0
-rw-r--r--share/templater/ikiwiki/files/www/Makefile.ikiwiki (renamed from share/templater/ikiwiki/files/www/Makefile)0
-rwxr-xr-xshare/templater/ikiwiki/setup8
-rw-r--r--share/templater/pelican/files/Makefile.pelican (renamed from share/templater/pelican/files/Makefile)0
-rwxr-xr-xshare/templater/pelican/setup8
-rw-r--r--share/templater/sphinx/files/Makefile.sphinx (renamed from share/templater/sphinx/files/Makefile)0
-rwxr-xr-xshare/templater/sphinx/setup8
-rw-r--r--share/templater/templater/files/Makefile18
-rw-r--r--share/templater/templater/functions23
11 files changed, 46 insertions, 33 deletions
diff --git a/share/templater/drupal8/files/Makefile b/share/templater/drupal8/files/Makefile.drupal8
index f424f3e..55375a5 100644
--- a/share/templater/drupal8/files/Makefile
+++ b/share/templater/drupal8/files/Makefile.drupal8
@@ -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
diff --git a/share/templater/drupal8/setup b/share/templater/drupal8/setup
index 470bae1..fde815e 100755
--- a/share/templater/drupal8/setup
+++ b/share/templater/drupal8/setup
@@ -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 .
diff --git a/share/templater/ikiwiki/files/Makefile b/share/templater/ikiwiki/files/Makefile.ikiwiki
index 8dc0c96..8dc0c96 100644
--- a/share/templater/ikiwiki/files/Makefile
+++ b/share/templater/ikiwiki/files/Makefile.ikiwiki
diff --git a/share/templater/ikiwiki/files/www/Makefile b/share/templater/ikiwiki/files/www/Makefile.ikiwiki
index 0db794d..0db794d 100644
--- a/share/templater/ikiwiki/files/www/Makefile
+++ b/share/templater/ikiwiki/files/www/Makefile.ikiwiki
diff --git a/share/templater/ikiwiki/setup b/share/templater/ikiwiki/setup
index d1e9b68..68fad55 100755
--- a/share/templater/ikiwiki/setup
+++ b/share/templater/ikiwiki/setup
@@ -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 .
diff --git a/share/templater/pelican/files/Makefile b/share/templater/pelican/files/Makefile.pelican
index 45fb995..45fb995 100644
--- a/share/templater/pelican/files/Makefile
+++ b/share/templater/pelican/files/Makefile.pelican
diff --git a/share/templater/pelican/setup b/share/templater/pelican/setup
index 93375ad..71929e7 100755
--- a/share/templater/pelican/setup
+++ b/share/templater/pelican/setup
@@ -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 .
diff --git a/share/templater/sphinx/files/Makefile b/share/templater/sphinx/files/Makefile.sphinx
index 6f8ddaa..6f8ddaa 100644
--- a/share/templater/sphinx/files/Makefile
+++ b/share/templater/sphinx/files/Makefile.sphinx
diff --git a/share/templater/sphinx/setup b/share/templater/sphinx/setup
index ec70c1e..b378ac3 100755
--- a/share/templater/sphinx/setup
+++ b/share/templater/sphinx/setup
@@ -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
index 0000000..a53fcbb
--- /dev/null
+++ b/share/templater/templater/files/Makefile
@@ -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.*
diff --git a/share/templater/templater/functions b/share/templater/templater/functions
index af6be08..47c240b 100644
--- a/share/templater/templater/functions
+++ b/share/templater/templater/functions
@@ -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
+}