summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaichi Shinozaki2015-06-09 18:34:27 +0900
committerDaichi Shinozaki2015-06-09 18:34:27 +0900
commit4167fadda4788f68b7c3de258f1619440ae2f5ec (patch)
treee901701ae062099a485453b59c3abd54ee5f8c6f
downloadaur-4167fadda4788f68b7c3de258f1619440ae2f5ec.tar.gz
Initial import
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD58
-rw-r--r--config96
-rw-r--r--erlang.config17
-rw-r--r--zotonic.install28
-rw-r--r--zotonic.service14
6 files changed, 244 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..91ab49833045
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = zotonic
+ pkgdesc = Content management system (web-CMS) server written in Erlang
+ pkgver = 0.12.4
+ pkgrel = 1
+ url = http://zotonic.com/
+ install = zotonic.install
+ arch = any
+ license = Apache
+ depends = erlang-nox
+ depends = postgresql
+ depends = imagemagick
+ optdepends = perl-image-exiftool: Enable image autorotation
+ optdepends = nginx: Proxy Zotonic with nginx
+ optdepends = varnish: Speed up Zotonic with Varnish
+ backup = etc/zotonic/config
+ backup = etc/zotonic/erlang.config
+ source = https://github.com/zotonic/zotonic/archive/release-0.12.4.zip
+ source = zotonic.service
+ source = config
+ source = erlang.config
+ md5sums = 25b8d070d516fb6c276b5fe7ee3f57f2
+ md5sums = a6f0f70d2a2af5ff0d0cfaf1531f6ed0
+ md5sums = 7904af22bf674471c212bde82a2cdcb6
+ md5sums = 4f09c0c994f5a17844b8ed999d3e7e39
+ sha512sums = 6ecfe709631ffb471949ea1519cbfc0077214e97e20b58451f99fd70b571c8dc7b0a1314ee77b4f21f65035b881bf48b3227e5793045822c74ba46a6b62d3ac2
+ sha512sums = 0768bbbf07a3448429ae06e30a13751fc8060b3a7c626623731931d962664f542f13c93967b35303e3f0d8afdf848b4b83d310879d6deb1a7303cdc04f909953
+ sha512sums = 62213581acaadcefacf15253175e27135bcc964768a061624a04ebcb3dc6e761ce3629017ce01286b741884fb0b23c4ebfcb6508f14200d99ecdb4f4860bd000
+ sha512sums = a6e5069e087a314053dab3774ecb123b5d5888c561430ecf02be34b72b3917c513d076323667188fde0ee6c2014e44f41b3a0a4b8fd79dd17c5523425f6979d8
+
+pkgname = zotonic
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e51ed3e85ea2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Daichi Shinozaki <dsdseg@gmail.com>
+# Contributor: jdarch <jda -dot- cloud -plus- archlinux -at- gmail -dot- com>
+
+pkgname=zotonic
+pkgver=0.12.4
+pkgrel=1
+pkgdesc="Content management system (web-CMS) server written in Erlang"
+arch=('any')
+url="http://zotonic.com/"
+license=("Apache")
+depends=('erlang-nox'
+ 'postgresql'
+ 'imagemagick')
+optdepends=('perl-image-exiftool: Enable image autorotation'
+ 'nginx: Proxy Zotonic with nginx'
+ 'varnish: Speed up Zotonic with Varnish')
+backup=('etc/zotonic/config'
+ 'etc/zotonic/erlang.config')
+install=${pkgname}.install
+
+source=("https://github.com/zotonic/zotonic/archive/release-${pkgver}.zip"
+ "${pkgname}.service"
+ "config"
+ "erlang.config")
+md5sums=('25b8d070d516fb6c276b5fe7ee3f57f2'
+ 'a6f0f70d2a2af5ff0d0cfaf1531f6ed0'
+ '7904af22bf674471c212bde82a2cdcb6'
+ '4f09c0c994f5a17844b8ed999d3e7e39')
+sha512sums=('6ecfe709631ffb471949ea1519cbfc0077214e97e20b58451f99fd70b571c8dc7b0a1314ee77b4f21f65035b881bf48b3227e5793045822c74ba46a6b62d3ac2'
+ '0768bbbf07a3448429ae06e30a13751fc8060b3a7c626623731931d962664f542f13c93967b35303e3f0d8afdf848b4b83d310879d6deb1a7303cdc04f909953'
+ '62213581acaadcefacf15253175e27135bcc964768a061624a04ebcb3dc6e761ce3629017ce01286b741884fb0b23c4ebfcb6508f14200d99ecdb4f4860bd000'
+ 'a6e5069e087a314053dab3774ecb123b5d5888c561430ecf02be34b72b3917c513d076323667188fde0ee6c2014e44f41b3a0a4b8fd79dd17c5523425f6979d8')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-release-${pkgver}"
+ sed -ie 's/python/python2/' src/scripts/zotonic-modules bin/zotonic
+}
+
+# Zotonic will build binary-code on startup
+#build() {
+# cd "${srcdir}/${pkgname}-release-${pkgver}"
+# make
+#}
+
+package() {
+ mkdir -p "${pkgdir}/etc/${pkgname}"
+ mkdir -p "${pkgdir}/usr/lib/systemd/system"
+ mkdir -p "${pkgdir}/var/lib/${pkgname}/${pkgname}"
+ mkdir -p "${pkgdir}/var/log/${pkgname}"
+
+ cp -r -t "${pkgdir}/var/lib/${pkgname}/${pkgname}" "${srcdir}/${pkgname}-release-${pkgver}/"*
+ install -m 660 "${srcdir}/config" "${pkgdir}/etc/${pkgname}"
+ install -m 660 "${srcdir}/erlang.config" "${pkgdir}/etc/${pkgname}"
+ install -m 644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system"
+
+ ln -s "/etc/${pkgname}/config" "${pkgdir}/var/lib/${pkgname}/${pkgname}/priv/config"
+ ln -s "/etc/${pkgname}/erlang.config" "${pkgdir}/var/lib/${pkgname}/${pkgname}/priv/erlang.config"
+}
diff --git a/config b/config
new file mode 100644
index 000000000000..f9b7170d9ecc
--- /dev/null
+++ b/config
@@ -0,0 +1,96 @@
+%% This is a sample config file for Zotonic.
+%%
+%% The configurations are for the Zotonic system itself.
+%% Site configuration is found in each site's config file.
+%% The site config files are in the subdirectories of priv/sites/.
+%%
+%% To use this configuration file:
+%% 1. Make sure Zotonic is NOT running
+%% 2. Copy this file to "config" (in this "priv" directory)
+%% 3. Change (and uncomment) any setting you want to modify
+%% 4. Start Zotonic.
+%% 5. Check if Zotonic is using your new settings.
+%% - When not then you have made a configuration error, start Zotonic
+%% in debug mode with "./start.sh" or "zotonic.sh debug"
+%%
+%%
+%% Zotonic will rewrite the file when settings are changed by Zotonic.
+%% Zotonic will ensure that there is a 'password' entry, adding it when necessary.
+%%
+%% Rarely used configurations are commented out, change at your own risk.
+%% The given values are the defaults for the options.
+%%
+%% Be careful with the comma after each option, exclude it after the last option.
+
+[
+
+ %% PostgeSQL database defaults.
+ %% These are the defaults for the equally named options in your site's config file.
+ {dbschema,"public"},
+ {dbpassword,[]},
+ {dbuser,"zotonic"},
+ {dbport,5432},
+ {dbhost,"localhost"},
+
+ %% IP address Zotonic will listen on for HTTP requests
+ %% Always overruled by the environment variable ZOTONIC_IP
+ %% Use 'any' for all IP addresses
+ {listen_ip,any},
+
+ %% Port Zotonic will listen on for HTTP requests.
+ %% Always overruled by the environment variable ZOTONIC_PORT
+ {listen_port,8000},
+
+ %% SMTP outbound relay configuration
+ % {smtp_relay, true},
+ % {smtp_host, "localhost"},
+ % {smtp_port, 2525},
+ % {smtp_ssl, true},
+
+ %% SMTP extra relay options:
+ %% some picky/buggy/misconfigured relays might need one of these to be enabled
+ % {smtp_no_mx_lookups, false},
+ % {smtp_verp_as_from, false},
+ % {smtp_bounce_email_override, "me@example.com"},
+
+ %% SMTP mail queue
+ %% How long to keep sent messages in the mail queue (in minutes)
+ %% Leave it long enough to receive any bounce message
+ % {smtp_delete_sent_after, 240},
+
+ %% SMTP debug options
+ %% Send a copy of outgoing mail to this address
+ % {smtp_bcc, "bcc@localhost"},
+ %% Send all mail to this address instead of the original recipient
+ % {email_override, "override@localhost"},
+
+ %% SMTP Inbound Server Options
+ %% Always overruled by the environment variables ZOTONIC_SMTP_LISTEN_DOMAIN, ZOTONIC_SMTP_LISTEN_IP and ZOTONIC_SMTP_LISTEN_PORT
+ % {smtp_listen_domain, undefined},
+ % {smtp_listen_ip, "127.0.0.1"},
+ % {smtp_listen_port, 2525},
+
+ %% Password for the sites administration site (zotonic_status)
+ %% Zotonic will generate a secure password for you, so you don't need to enable this.
+ %% When you enable this you MUST select a secure password!!!
+ % {password, ""},
+
+ %% inet request backlog, enlarge when requests are dropped
+ % {inet_backlog,500},
+
+ %% Directory where log files are written
+ % {log_dir,"priv/log"},
+ {log_dir,"/var/log/zotonic"},
+
+ %% Enable performance logging (in addition to request logging)
+ % {enable_perf_logger, true},
+
+ %% Webmachine error handler, you can use your own.
+ % {webmachine_error_handler,z_webmachine_error_handler},
+
+ %% Default ImageMagick color space. Some ImageMagick versions (like 6.7.0 and above) use the RGB colorspace, so all images are darker then the original. <br />Possible Values: CMY, CMYK, Grey, HCL, HSB, HSL, HWB, Lab, LCH, LMS, Log, Luv, OHTA, Rec601Luma, Rec601YCbCr, Rec709Luma, Rec709YCbCr, RGB, sRGB, Transparent, XYZ, YCbCr, YCC, YIQ, YCbCr, YUV
+ % {default_colorspace, "sRGB"},
+
+ % Date this file was created/updated
+ {modify_date, {{2010,7,12},{12,28,30}}}
+].
diff --git a/erlang.config b/erlang.config
new file mode 100644
index 000000000000..73a0fcd8add7
--- /dev/null
+++ b/erlang.config
@@ -0,0 +1,17 @@
+%% -*- mode: erlang -*-
+[{lager,
+ [{handlers,
+ [{lager_console_backend, info},
+ {lager_file_backend,
+ [{"/var/log/zotonic/error.log", error, 10485760, "$D0", 5},
+ {"/var/log/zotonic/console.log", info, 10485760, "$D0", 5}
+ ]}
+ ]},
+ {crash_log, "/var/log/zotonic/crash.log"}
+ ]},
+
+ {webzmachine,
+ [{wmtrace_dir, "priv/wmtrace"},
+ {silent_console, true}
+ ]}
+].
diff --git a/zotonic.install b/zotonic.install
new file mode 100644
index 000000000000..792c4ebdc313
--- /dev/null
+++ b/zotonic.install
@@ -0,0 +1,28 @@
+post_install() {
+ groupadd zotonic
+ useradd -r -g zotonic -d /var/lib/zotonic zotonic
+ chown -R root:zotonic /etc/zotonic
+ chown -R zotonic:zotonic /var/lib/zotonic
+ chown -R zotonic:zotonic /var/log/zotonic
+ echo "###########################################"
+ echo "# - Edit /etc/zotonic/config to configure #"
+ echo "# Zotonic. #"
+ echo "# - Setup sites in /var/lib/zotonic/priv. #"
+ echo "# - Apply necessary modifications to #"
+ echo "# Postgresql's configuration and any #"
+ echo "# other package you want to interact #"
+ echo "# with Zotonic. #"
+ echo "# - Visit to http://zotonic.com for more #"
+ echo "# details on these tasks. #"
+ echo "###########################################"
+ echo "# Zotonic might take a lot of time on its #"
+ echo "# first run, as it will generate the #"
+ echo "# Erlang byte-code from source. #"
+ echo "###########################################"
+}
+
+post_remove() {
+ rm -rf /var/{lib,log}/zotonic
+ userdel zotonic
+ groupdel zotonic
+}
diff --git a/zotonic.service b/zotonic.service
new file mode 100644
index 000000000000..a21c900389ad
--- /dev/null
+++ b/zotonic.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Zotonic, a Web-CMS written in Erlang
+After=network.target postgresql.service
+Requires=network.target postgresql.service
+
+[Service]
+Type=forking
+User=zotonic
+TimeoutStartSec=600
+ExecStart=/var/lib/zotonic/zotonic/bin/zotonic start
+ExecStop=/var/lib/zotonic/zotonic/bin/zotonic stop
+
+[Install]
+WantedBy=multi-user.target