r74663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74662‎ | r74663 | r74664 >
Date:15:22, 12 October 2010
Author:laner
Status:deferred
Tags:
Comment:
Initial commit of debian files
Modified paths:
  • /trunk/debs/opendj/debian (added) (history)
  • /trunk/debs/opendj/debian/changelog (added) (history)
  • /trunk/debs/opendj/debian/compat (added) (history)
  • /trunk/debs/opendj/debian/control (added) (history)
  • /trunk/debs/opendj/debian/copyright (added) (history)
  • /trunk/debs/opendj/debian/dirs (added) (history)
  • /trunk/debs/opendj/debian/opendj.default (added) (history)
  • /trunk/debs/opendj/debian/opendj.init (added) (history)
  • /trunk/debs/opendj/debian/opendj.postinst (added) (history)
  • /trunk/debs/opendj/debian/opendj.postrm (added) (history)
  • /trunk/debs/opendj/debian/rules (added) (history)

Diff [purge]

Index: trunk/debs/opendj/debian/control
@@ -0,0 +1,13 @@
 2+Source: opendj
 3+Section: net
 4+Priority: extra
 5+Maintainer: Ryan Lane <rlane@wikimedia.org>
 6+Build-Depends: debhelper (>= 4), openjdk-6-jdk
 7+Standards-Version: 3.8.1
 8+Homepage: http://www.opendj.org
 9+
 10+Package: opendj
 11+Architecture: any
 12+Depends: openjdk-6-jre
 13+Description: OpenDJ Java based LDAP server
 14+ OpenDJ is an open source community project building a free and comprehensive next generation directory service, based on LDAP and DSML standards.
Index: trunk/debs/opendj/debian/dirs
@@ -0,0 +1,7 @@
 2+usr/opendj
 3+usr/opendj/tmpl_instance
 4+usr/opendj/tmpl_instance/config/schema
 5+usr/opendj/tmpl_instance/lib/extensions
 6+usr/opendj/tmpl_instance/classes
 7+etc/opendj
 8+var/opendj
Index: trunk/debs/opendj/debian/opendj.init
@@ -0,0 +1,163 @@
 2+#! /bin/sh
 3+### BEGIN INIT INFO
 4+# Provides: ldap-server
 5+# Required-Start: $remote_fs $syslog
 6+# Required-Stop: $remote_fs $syslog
 7+# Default-Start: 2 3 4 5
 8+# Default-Stop: 0 1 6
 9+# Short-Description: OpenDJ LDAP server
 10+# Description: OpenDJ LDAP server
 11+### END INIT INFO
 12+
 13+# Author: Ryan Lane <rlane@wikimedia.org>
 14+#
 15+# Do NOT "set -e"
 16+
 17+PATH=/sbin:/usr/sbin:/bin:/usr/bin
 18+DESC="OpenDJ LDAP server"
 19+START="/usr/opendj/bin/start-ds"
 20+STOP="/usr/opendj/bin/stop-ds"
 21+USER="opendj"
 22+SCRIPTNAME=/etc/init.d/opendj
 23+
 24+# Exit if the package is not installed
 25+[ -x "$START" ] || exit 0
 26+
 27+# Default to all configured interfaces
 28+BINDADDRS=`/sbin/ifconfig | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1 }'`
 29+
 30+# Read configuration variable file if it is present
 31+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 32+
 33+# Load the VERBOSE setting and other rcS variables
 34+. /lib/init/vars.sh
 35+
 36+# Define LSB log_* functions.
 37+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 38+. /lib/lsb/init-functions
 39+
 40+#
 41+# Function that starts the daemon/service
 42+#
 43+do_start()
 44+{
 45+ for addr in ${BINDADDRS}
 46+ do
 47+ # Set forwarding rules for 389 and 636
 48+ iptables -t nat -A PREROUTING -p tcp --dport 389 --jump REDIRECT --to-port 1389 -d ${addr}
 49+ iptables -t nat -A PREROUTING -p tcp --dport 636 --jump REDIRECT --to-port 1636 -d ${addr}
 50+ iptables -t nat -A OUTPUT -p tcp --dport 389 -j DNAT --to :1389 -d ${addr}
 51+ iptables -t nat -A OUTPUT -p tcp --dport 636 -j DNAT --to :1636 -d ${addr}
 52+ done
 53+
 54+ # Return
 55+ # 0 if daemon has been started
 56+ # 1 if daemon was already running
 57+ # 2 if daemon could not be started
 58+ start-stop-daemon --start --quiet -c $USER --exec $START --test > /dev/null \
 59+ || return 1
 60+ start-stop-daemon --start --quiet -c $USER --exec $START \
 61+ || return 2
 62+ # Add code here, if necessary, that waits for the process to be ready
 63+ # to handle requests from services started subsequently which depend
 64+ # on this one. As a last resort, sleep for some time.
 65+}
 66+
 67+#
 68+# Function that stops the daemon/service
 69+#
 70+do_stop()
 71+{
 72+ for addr in ${BINDADDRS}
 73+ do
 74+ # Removing forwarding rules
 75+ iptables -t nat -D PREROUTING -p tcp --dport 389 --jump REDIRECT --to-port 1389 -d ${addr}
 76+ iptables -t nat -D PREROUTING -p tcp --dport 636 --jump REDIRECT --to-port 1636 -d ${addr}
 77+ iptables -t nat -D OUTPUT -p tcp --dport 389 -j DNAT --to :1389 -d ${addr}
 78+ iptables -t nat -D OUTPUT -p tcp --dport 636 -j DNAT --to :1636 -d ${addr}
 79+ done
 80+
 81+ # Return
 82+ # 0 if daemon has been stopped
 83+ # 1 if daemon was already stopped
 84+ # 2 if daemon could not be stopped
 85+ # other if a failure occurred
 86+ start-stop-daemon --start --quiet -c $USER --exec $STOP
 87+ RETVAL="$?"
 88+ [ "$RETVAL" = 2 ] && return 2
 89+ return "$RETVAL"
 90+}
 91+
 92+#
 93+# Function that sends a SIGHUP to the daemon/service
 94+#
 95+do_reload() {
 96+ #
 97+ # If the daemon can reload its configuration without
 98+ # restarting (for example, when it is sent a SIGHUP),
 99+ # then implement that here.
 100+ #
 101+ do_stop
 102+ do_start
 103+ return 0
 104+}
 105+
 106+case "$1" in
 107+ start)
 108+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
 109+ do_start
 110+ case "$?" in
 111+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 112+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 113+ esac
 114+ ;;
 115+ stop)
 116+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
 117+ do_stop
 118+ case "$?" in
 119+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 120+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 121+ esac
 122+ ;;
 123+ status)
 124+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
 125+ ;;
 126+ #reload|force-reload)
 127+ #
 128+ # If do_reload() is not implemented then leave this commented out
 129+ # and leave 'force-reload' as an alias for 'restart'.
 130+ #
 131+ #log_daemon_msg "Reloading $DESC" "$NAME"
 132+ #do_reload
 133+ #log_end_msg $?
 134+ #;;
 135+ restart|force-reload)
 136+ #
 137+ # If the "reload" option is implemented then remove the
 138+ # 'force-reload' alias
 139+ #
 140+ log_daemon_msg "Restarting $DESC" "$NAME"
 141+ do_stop
 142+ case "$?" in
 143+ 0|1)
 144+ do_start
 145+ case "$?" in
 146+ 0) log_end_msg 0 ;;
 147+ 1) log_end_msg 1 ;; # Old process is still running
 148+ *) log_end_msg 1 ;; # Failed to start
 149+ esac
 150+ ;;
 151+ *)
 152+ # Failed to stop
 153+ log_end_msg 1
 154+ ;;
 155+ esac
 156+ ;;
 157+ *)
 158+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
 159+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
 160+ exit 3
 161+ ;;
 162+esac
 163+
 164+:
Index: trunk/debs/opendj/debian/opendj.postinst
@@ -0,0 +1,28 @@
 2+#!/bin/sh
 3+set -e
 4+
 5+if ! getent group opendj >/dev/null; then
 6+ echo Adding group: opendj.
 7+ addgroup --system opendj
 8+fi
 9+
 10+if ! getent passwd opendj >/dev/null; then
 11+ echo Adding system user: opendj.
 12+ adduser --system --ingroup opendj --home /var/opendj --shell /bin/bash --no-create-home opendj
 13+ usermod -c "OpenDJ LDAP Server" opendj
 14+ cp /etc/skel/.[bp]* /var/opendj
 15+ echo "" >> /var/opendj/.bashrc
 16+ echo "export PATH=$PATH:/usr/opendj/bin" >> /var/opendj/.bashrc
 17+fi
 18+
 19+if [ ! -d /var/opendj/instance ]; then
 20+ cp -R /usr/opendj/tmpl_instance /var/opendj/instance
 21+fi
 22+
 23+if [ -d /var/opendj ]; then
 24+ chown -R opendj:opendj /var/opendj
 25+fi
 26+
 27+#DEBHELPER#
 28+
 29+exit 0
Index: trunk/debs/opendj/debian/opendj.default
@@ -0,0 +1,11 @@
 2+# Defaults for opendj initscript
 3+# sourced by /etc/init.d/opendj
 4+# installed at /etc/default/opendj by the maintainer scripts
 5+
 6+#
 7+# This is a POSIX shell fragment
 8+#
 9+
 10+# Space separated list of addresses 389 and 636 should forward to, defaults
 11+# to all configured IPs. Used to configure iptables
 12+BINDADDRS=""
Index: trunk/debs/opendj/debian/opendj.postrm
@@ -0,0 +1,13 @@
 2+#!/bin/sh -e
 3+
 4+if [ "$1" = "purge" ] ; then
 5+ # remove opendj user
 6+ if getent passwd opendj >/dev/null; then
 7+ deluser opendj
 8+ fi
 9+ if getent group opendj >/dev/null; then
 10+ delgroup opendj
 11+ fi
 12+fi
 13+
 14+#DEBHELPER#
Index: trunk/debs/opendj/debian/compat
@@ -0,0 +1 @@
 2+6
Index: trunk/debs/opendj/debian/changelog
@@ -0,0 +1,32 @@
 2+opendj (2.4.0-5) unstable; urgency=low
 3+
 4+ * Gave the user a home directory and shell, since all opendj commands must
 5+ be run as the opendj user
 6+
 7+ -- Ryan Lane <rlane@wikimedia.org> Fri, 08 Oct 2010 11:34:00 -0600
 8+
 9+opendj (2.4.0-4) unstable; urgency=low
 10+
 11+ * Ensure init script doesn't get run on package install, and isn't in the
 12+ rc.* directories
 13+
 14+ -- Ryan Lane <rlane@wikimedia.org> Thu, 07 Oct 2010 16:36:00 -0600
 15+
 16+opendj (2.4.0-3) unstable; urgency=low
 17+
 18+ * Model package more closely to that of the solaris package
 19+
 20+ -- Ryan Lane <rlane@wikimedia.org> Wed, 06 Oct 2010 14:00:00 -0600
 21+
 22+opendj (2.4.0-2) unstable; urgency=low
 23+
 24+ * Fix issue with init script
 25+ * Add a check for /usr/opendj/lib/set-java-home in the postinstall
 26+
 27+ -- Ryan Lane <rlane@wikimedia.org> Thu, 30 Sep 2010 20:00:00 +0000
 28+
 29+opendj (2.4.0-1) unstable; urgency=low
 30+
 31+ * Initial release
 32+
 33+ -- Ryan Lane <rlane@wikimedia.org> Thu, 16 Sep 2010 21:00:36 +0000
Index: trunk/debs/opendj/debian/copyright
@@ -0,0 +1,26 @@
 2+This package was debianized by Ryan Lane <rlane@wikimedia.org> on
 3+Thu, 16 Sep 2010 21:00:36 +0000.
 4+
 5+It was downloaded from http://www.forgerock.com
 6+
 7+Upstream Author(s):
 8+
 9+ info@forgerock.com
 10+
 11+Copyright:
 12+
 13+ Copyright (C) 2010 ForgeRock.
 14+
 15+License:
 16+
 17+ CDDL
 18+
 19+The Debian packaging is:
 20+
 21+ Copyright (C) 2010 Ryan Lane <rlane@wikimedia.org>
 22+
 23+and is licensed under the GPL version 3,
 24+see `/usr/share/common-licenses/GPL-3'.
 25+
 26+# Please also look if there are files or directories which have a
 27+# different copyright/license attached and list them here.
Index: trunk/debs/opendj/debian/rules
@@ -0,0 +1,123 @@
 2+#!/usr/bin/make -f
 3+# -*- makefile -*-
 4+# Sample debian/rules that uses debhelper.
 5+# This file was originally written by Joey Hess and Craig Small.
 6+# As a special exception, when this file is copied by dh-make into a
 7+# dh-make output file, you may use that output file without restriction.
 8+# This special exception was added by Craig Small in version 0.37 of dh-make.
 9+
 10+# Uncomment this to turn on verbose mode.
 11+export DH_VERBOSE=1
 12+
 13+
 14+
 15+
 16+
 17+configure: configure-stamp
 18+configure-stamp:
 19+ dh_testdir
 20+ # Add here commands to configure the package.
 21+
 22+ touch configure-stamp
 23+
 24+
 25+build: build-stamp
 26+
 27+build-stamp: configure-stamp
 28+ dh_testdir
 29+
 30+ # Add here commands to compile the package.
 31+ ./build.sh -DMEM=512M
 32+
 33+ touch $@
 34+
 35+clean:
 36+ dh_testdir
 37+ dh_testroot
 38+ rm -f build-stamp configure-stamp
 39+
 40+ # Add here commands to clean up after the build process.
 41+ rm -rf build
 42+
 43+ dh_clean
 44+
 45+install: build
 46+ dh_testdir
 47+ dh_testroot
 48+ #dh_prep
 49+ dh_installdirs
 50+
 51+# Build architecture-independent files here.
 52+binary-indep: install
 53+ dh_testdir
 54+ dh_testroot
 55+ dh_installinit -n
 56+
 57+ mv ${CURDIR}/build/package/OpenDJ-2.4.0BETA1 ${CURDIR}/build/package/OpenDJ
 58+
 59+ # Remove Windows and OS X specific content
 60+ find ${CURDIR}/build/package/OpenDJ -name "*.bat" -exec rm -f {} \;
 61+ rmdir ${CURDIR}/build/package/OpenDJ/bat
 62+ rm ${CURDIR}/build/package/OpenDJ/bin/README_WINDOWS.txt
 63+ find ${CURDIR}/build/package/OpenDJ -name "*.exe" -exec rm -f {} \;
 64+ rm -Rf ${CURDIR}/build/package/OpenDJ/Uninstall.app
 65+ rm -Rf ${CURDIR}/build/package/OpenDJ/QuickSetup.app
 66+ rm -Rf ${CURDIR}/build/package/OpenDJ/bin/ControlPanel.app
 67+
 68+ # Ensure the instance.loc file is kept in /etc
 69+ mv ${CURDIR}/instance.loc $(CURDIR)/debian/opendj/etc/opendj
 70+
 71+ # Create the template instance
 72+ mv ${CURDIR}/build/package/OpenDJ/bak $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 73+ mv ${CURDIR}/build/package/OpenDJ/ldif $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 74+ mv ${CURDIR}/build/package/OpenDJ/locks $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 75+ mv ${CURDIR}/build/package/OpenDJ/logs $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 76+ mv ${CURDIR}/build/package/OpenDJ/db $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 77+ mv ${CURDIR}/build/package/OpenDJ/changelogDb $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 78+ mv ${CURDIR}/build/package/OpenDJ/import-tmp $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance
 79+ mv ${CURDIR}/build/package/OpenDJ/config/schema $(CURDIR)/debian/schema-tmp
 80+ mv ${CURDIR}/build/package/OpenDJ/config/* $(CURDIR)/debian/opendj/usr/opendj/tmpl_instance/config
 81+
 82+ # Move the binaries into usr
 83+ mv ${CURDIR}/build/package/OpenDJ/* $(CURDIR)/debian/opendj/usr/opendj
 84+
 85+ # Ensure the resource file created by the build is gone, and we link to etc for it
 86+ rm -f $(CURDIR)/debian/opendj/usr/opendj/instance.loc
 87+ ln -s /etc/opendj/instance.loc $(CURDIR)/debian/opendj/usr/opendj/instance.loc
 88+
 89+ # Move our schema directory back to the binary install
 90+ mv ${CURDIR}/debian/schema-tmp $(CURDIR)/debian/opendj/usr/opendj/config/schema
 91+
 92+# Build architecture-dependent files here.
 93+binary-arch: install
 94+ dh_testdir
 95+ dh_testroot
 96+# dh_installchangelogs
 97+# dh_installdocs
 98+# dh_installexamples
 99+# dh_install
 100+# dh_installmenu
 101+# dh_installdebconf
 102+# dh_installlogrotate
 103+# dh_installemacsen
 104+# dh_installpam
 105+# dh_installmime
 106+# dh_python
 107+# dh_installinit
 108+# dh_installcron
 109+# dh_installinfo
 110+# dh_installman
 111+ dh_link
 112+ dh_strip
 113+ dh_compress
 114+ dh_fixperms
 115+# dh_perl
 116+# dh_makeshlibs
 117+ dh_installdeb
 118+ dh_shlibdeps
 119+ dh_gencontrol
 120+ dh_md5sums
 121+ dh_builddeb
 122+
 123+binary: binary-indep binary-arch
 124+.PHONY: build clean binary-indep binary-arch binary install configure
Property changes on: trunk/debs/opendj/debian/rules
___________________________________________________________________
Added: svn:executable
1125 + *

Status & tagging log