summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /www-apps/redmine
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'www-apps/redmine')
-rw-r--r--www-apps/redmine/Manifest1
-rw-r--r--www-apps/redmine/files/10_redmine_vhost.conf12
-rw-r--r--www-apps/redmine/files/redmine-2.initd49
-rw-r--r--www-apps/redmine/files/redmine.confd13
-rw-r--r--www-apps/redmine/metadata.xml17
-rw-r--r--www-apps/redmine/redmine-2.4.6.ebuild198
6 files changed, 290 insertions, 0 deletions
diff --git a/www-apps/redmine/Manifest b/www-apps/redmine/Manifest
new file mode 100644
index 000000000000..a006b5e975af
--- /dev/null
+++ b/www-apps/redmine/Manifest
@@ -0,0 +1 @@
+DIST redmine-2.4.6.tar.gz 3885107 SHA256 9dd35c9f50fcd20724c328860253c78fe0155a5f58bbf90357d72d44900a7601 SHA512 722bdb4e5dd5246dfdee2819c65d024c34368d4cbb34d27a2832909b2b82f6e677e7312fa085971c6fb78c2aa4d06552d06e2314e19c4e3d0b211fcc1ec4d911 WHIRLPOOL e1b4213f7aef6d97afadde194e6f99f6d7f61a5cc9775fb8619cda6fbe2b42a3b783039fdacfa80b40d0c86fa235d397f39f0d3d37b5a7626facfd70fe058f06
diff --git a/www-apps/redmine/files/10_redmine_vhost.conf b/www-apps/redmine/files/10_redmine_vhost.conf
new file mode 100644
index 000000000000..33a117a91e52
--- /dev/null
+++ b/www-apps/redmine/files/10_redmine_vhost.conf
@@ -0,0 +1,12 @@
+<IfModule passenger_module>
+Listen 3000
+<VirtualHost *:3000>
+ DocumentRoot /var/lib/redmine/public
+# RailsEnv production
+ <Directory "/var/lib/redmine/public">
+ Options FollowSymLinks
+ Order allow,deny
+ Allow from all
+ </Directory>
+</VirtualHost>
+</IfModule>
diff --git a/www-apps/redmine/files/redmine-2.initd b/www-apps/redmine/files/redmine-2.initd
new file mode 100644
index 000000000000..f81d1d395cb9
--- /dev/null
+++ b/www-apps/redmine/files/redmine-2.initd
@@ -0,0 +1,49 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+RAILS_ENV=${RAILS_ENV:-production}
+REDMINE_DIR=${REDMINE_DIR:-/var/lib/redmine}
+REDMINE_ADDRESS=${REDMINE_ADDRESS:-localhost}
+REDMINE_PORT=${REDMINE_PORT:-3000}
+REDMINE_USER=${REDMINE_USER:-redmine}
+REDMINE_GROUP=${REDMINE_GROUP:-redmine}
+REDMINE_PIDFILE="/var/run/redmine/server.pid"
+
+depend() {
+ use apache2 git-daemon mysql net postgresql svnserve
+}
+
+start_pre() {
+ if [ ! -e "${REDMINE_DIR}/config/initializers/secret_token.rb" ] ; then
+ eerror "Execute the following command to initlize environment:"
+ eerror
+ eerror "# emerge --config www-apps/redmine"
+ eerror
+ return 1
+ fi
+ if [ ! -d /var/run/redmine ]; then
+ checkpath -q -d -m 0755 -o redmine:redmine /var/run/redmine
+ fi
+}
+
+start() {
+ ebegin "Starting redmine"
+ cd "${REDMINE_DIR}"
+ start-stop-daemon --start --quiet --user ${REDMINE_USER}:${REDMINE_GROUP} \
+ --pidfile "${REDMINE_PIDFILE}" \
+ --exec /usr/bin/ruby "${REDMINE_DIR}"/script/rails server -- \
+ --daemon --environment=${RAILS_ENV} \
+ --binding=${REDMINE_ADDRESS} --port=${REDMINE_PORT} \
+ --pid="${REDMINE_PIDFILE}" \
+ ${REDMINE_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping redmine"
+ cd "${REDMINE_DIR}"
+ start-stop-daemon --signal INT --quiet --pidfile "${REDMINE_PIDFILE}"
+ eend $?
+}
diff --git a/www-apps/redmine/files/redmine.confd b/www-apps/redmine/files/redmine.confd
new file mode 100644
index 000000000000..1c3830a09b07
--- /dev/null
+++ b/www-apps/redmine/files/redmine.confd
@@ -0,0 +1,13 @@
+# /etc/conf.d/redmine: config file for /etc/init.d/redmine
+# Bind to specified address
+# You can set to 0.0.0.0 to accept requests anywhere
+#REDMINE_ADDRESS="localhost"
+
+# Port
+#REDMINE_PORT=3000
+
+# RAILS_ENV
+#RAILS_ENV=production
+
+# additional opts
+#REDMINE_OPTS=""
diff --git a/www-apps/redmine/metadata.xml b/www-apps/redmine/metadata.xml
new file mode 100644
index 000000000000..3f9c41831008
--- /dev/null
+++ b/www-apps/redmine/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>matsuu@gentoo.org</email>
+</maintainer>
+<maintainer>
+<email>pva@gentoo.org</email>
+<name>Peter Volkov</name>
+</maintainer>
+<longdescription lang="en">
+</longdescription>
+<use>
+ <flag name='passenger'>Enable support for <pkg>www-apache/passenger</pkg></flag>
+</use>
+</pkgmetadata>
+
diff --git a/www-apps/redmine/redmine-2.4.6.ebuild b/www-apps/redmine/redmine-2.4.6.ebuild
new file mode 100644
index 000000000000..216fd62e28f1
--- /dev/null
+++ b/www-apps/redmine/redmine-2.4.6.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+USE_RUBY="ruby19 ruby20"
+inherit eutils depend.apache ruby-ng user
+
+DESCRIPTION="Redmine is a flexible project management web application written using Ruby on Rails framework"
+HOMEPAGE="http://www.redmine.org/"
+SRC_URI="http://www.redmine.org/releases/${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+LICENSE="GPL-2"
+SLOT="0"
+# All db-related USEs are ineffective since we depend on rails
+# which depends on activerecord which depends on all ruby's db bindings
+#IUSE="ldap openid imagemagick postgres sqlite mysql fastcgi passenger"
+IUSE="ldap imagemagick fastcgi passenger"
+
+#RDEPEND="$(ruby_implementation_depend jruby '>=' -1.6.7)[ssl]"
+
+ruby_add_rdepend "virtual/ruby-ssl
+ virtual/rubygems
+ >=dev-ruby/rails-3.2.19:3.2
+ >=dev-ruby/jquery-rails-2.0.2
+ dev-ruby/i18n:0.6
+ >=dev-ruby/coderay-1.0.9
+ dev-ruby/builder:3
+ dev-ruby/rake
+ ldap? ( >=dev-ruby/ruby-net-ldap-0.3.1 )
+ >=dev-ruby/ruby-openid-2.3.0
+ >=dev-ruby/rack-openid-0.2.1
+ imagemagick? ( >=dev-ruby/rmagick-2 )
+ fastcgi? ( dev-ruby/fcgi )
+ passenger? ( www-apache/passenger )"
+# ruby_targets_ruby19? (
+# postgres? ( >=dev-ruby/pg-0.11 )
+# sqlite3? ( dev-ruby/sqlite3 )
+# mysql? ( dev-ruby/mysql2:0.3 )
+# )
+
+#ruby_add_bdepend ">=dev-ruby/rdoc-2.4.2
+# dev-ruby/yard
+# test? (
+# >=dev-ruby/shoulda-3.3.2
+# >=dev-ruby/mocha-0.13.3
+# >=dev-ruby/capybara-2.0.0
+# <dev-ruby/nokogiri-1.6.0
+# )"
+
+REDMINE_DIR="/var/lib/${PN}"
+
+pkg_setup() {
+ enewgroup redmine
+ enewuser redmine -1 -1 "${REDMINE_DIR}" redmine
+}
+
+all_ruby_prepare() {
+ rm -r log files/delete.me || die
+
+ # bug #406605
+ rm .gitignore .hgignore .travis.yml || die
+
+ rm Gemfile config/preinitializer.rb || die
+
+ echo "CONFIG_PROTECT=\"${EPREFIX}${REDMINE_DIR}/config\"" > "${T}/50${PN}"
+ echo "CONFIG_PROTECT_MASK=\"${EPREFIX}${REDMINE_DIR}/config/locales ${EPREFIX}${REDMINE_DIR}/config/settings.yml\"" >> "${T}/50${PN}"
+
+ # remove ldap staff module if disabled to avoid #413779
+ use ldap || rm app/models/auth_source_ldap.rb || die
+}
+
+all_ruby_install() {
+ dodoc doc/{CHANGELOG,INSTALL,README_FOR_APP,RUNNING_TESTS,UPGRADING}
+ rm -r doc || die
+ dodoc README.rdoc
+ rm README.rdoc || die
+
+ keepdir /var/log/${PN}
+ dosym /var/log/${PN}/ "${REDMINE_DIR}/log"
+
+ insinto "${REDMINE_DIR}"
+ doins -r .
+ keepdir "${REDMINE_DIR}/files"
+ keepdir "${REDMINE_DIR}/public/plugin_assets"
+
+ fowners -R redmine:redmine \
+ "${REDMINE_DIR}/config" \
+ "${REDMINE_DIR}/files" \
+ "${REDMINE_DIR}/public/plugin_assets" \
+ "${REDMINE_DIR}/tmp" \
+ /var/log/${PN}
+
+ fowners redmine:redmine "${REDMINE_DIR}"
+
+ # protect sensitive data, see bug #406605
+ fperms -R go-rwx \
+ "${REDMINE_DIR}/config" \
+ "${REDMINE_DIR}/files" \
+ "${REDMINE_DIR}/tmp" \
+ /var/log/${PN}
+
+ if use passenger; then
+ has_apache
+ insinto "${APACHE_VHOSTS_CONFDIR}"
+ doins "${FILESDIR}/10_redmine_vhost.conf"
+ else
+ newconfd "${FILESDIR}/${PN}.confd" ${PN}
+ newinitd "${FILESDIR}/${PN}-2.initd" ${PN}
+ fi
+ doenvd "${T}/50${PN}"
+}
+
+pkg_postinst() {
+ einfo
+ if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/session_store.rb" -o -e "${EPREFIX}${REDMINE_DIR}/config/initializers/secret_token.rb" ]; then
+ elog "Execute the following command to upgrade environment:"
+ elog
+ elog "# emerge --config \"=${CATEGORY}/${PF}\""
+ elog
+ elog "For upgrade instructions take a look at:"
+ elog "http://www.redmine.org/wiki/redmine/RedmineUpgrade"
+ else
+ elog "Execute the following command to initialize environment:"
+ elog
+ elog "# cd ${EPREFIX}${REDMINE_DIR}"
+ elog "# cp config/database.yml.example config/database.yml"
+ elog "# \${EDITOR} config/database.yml"
+ elog "# chown redmine:redmine config/database.yml"
+ elog "# emerge --config \"=${CATEGORY}/${PF}\""
+ elog
+ elog "Installation notes are at official site"
+ elog "http://www.redmine.org/wiki/redmine/RedmineInstall"
+ fi
+ einfo
+}
+
+pkg_config() {
+ if [ ! -e "${EPREFIX}${REDMINE_DIR}/config/database.yml" ]; then
+ eerror "Copy ${EPREFIX}${REDMINE_DIR}/config/database.yml.example to ${EPREFIX}${REDMINE_DIR}/config/database.yml"
+ eerror "then edit this file in order to configure your database settings for \"production\" environment."
+ die
+ fi
+
+ local RAILS_ENV=${RAILS_ENV:-production}
+ if [ ! -L /usr/bin/ruby ]; then
+ eerror "/usr/bin/ruby is not a valid symlink to any ruby implementation."
+ eerror "Please update it via `eselect ruby`"
+ die
+ fi
+ if [[ $RUBY_TARGETS != *$( eselect ruby show | awk 'NR==2' | tr -d ' ' )* ]]; then
+ eerror "/usr/bin/ruby is currently not included in redmine's ruby targets: ${RUBY_TARGETS}."
+ eerror "Please update it via `eselect ruby`"
+ die
+ fi
+ local RUBY=${RUBY:-ruby}
+
+ cd "${EPREFIX}${REDMINE_DIR}" || die
+ if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/session_store.rb" ]; then
+ einfo
+ einfo "Generating secret token."
+ einfo
+ rm config/initializers/session_store.rb || die
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake generate_secret_token || die
+ fi
+ if [ -e "${EPREFIX}${REDMINE_DIR}/config/initializers/secret_token.rb" ]; then
+ einfo
+ einfo "Upgrading database."
+ einfo
+
+ einfo "Migrating database."
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die
+ einfo "Upgrading the plugin migrations."
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:plugins:migrate || die
+ einfo "Clear the cache and the existing sessions."
+ ${RUBY} -S rake tmp:cache:clear || die
+ ${RUBY} -S rake tmp:sessions:clear || die
+ else
+ einfo
+ einfo "Initializing database."
+ einfo
+
+ einfo "Generating a session store secret."
+ ${RUBY} -S rake generate_secret_token || die
+ einfo "Creating the database structure."
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake db:migrate || die
+ einfo "Populating database with default configuration data."
+ RAILS_ENV="${RAILS_ENV}" ${RUBY} -S rake redmine:load_default_data || die
+ chown redmine:redmine "${EPREFIX}${REDMINE_DIR}"/log/production.log
+ einfo
+ einfo "If you use sqlite3, please do not forget to change the ownership of the sqlite files."
+ einfo
+ einfo "# cd \"${EPREFIX}${REDMINE_DIR}\""
+ einfo "# chown redmine:redmine db/ db/*.sqlite3"
+ einfo
+ fi
+}