Permalink
Browse files

initial implementation

  • Loading branch information...
1 parent ccfe38b commit 9ab71f7b9d5a8f805bac53f41c1885c0bb6482dc @jfroche committed Dec 22, 2011
Showing with 169 additions and 0 deletions.
  1. +74 −0 SOURCES/pentaho.init
  2. 0 SOURCES/pentaho.pid
  3. +9 −0 build-pentaho.sh
  4. +86 −0 pentaho.spec
View
74 SOURCES/pentaho.init
@@ -0,0 +1,74 @@
+#!/bin/sh
+# chkconfig: 345 24 76
+
+### BEGIN INIT INFO
+# Provides: pentaho
+# Required-Start: $local_fs $remote_fs $network $time $named
+# Should-Start: $time sendmail
+# Required-Stop: $local_fs $remote_fs $network $time $named
+# Should-Stop: $time sendmail
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Pentaho BI server
+# Description: Start the Pentaho BI server
+### END INIT INFO
+
+PENTAHO_PID_FILE="/var/run/pentaho.pid"
+
+# Source function library.
+. /etc/init.d/functions
+
+# Search usable Java. We do this because various reports indicated
+# that /usr/bin/java may not always point to Java 1.5
+# see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
+
+RETVAL=0
+
+case "$1" in
+ start)
+echo -n "Starting Pentaho "
+export CATALINA_PID=$PENTAHO_PID_FILE
+daemon --user "pentaho" /opt/pentaho-biserver/start.sh > /dev/null
+RETVAL=$?
+if [ $RETVAL = 0 ]; then
+success
+fi
+;;
+ stop)
+echo -n "Shutting down Pentaho "
+/opt/pentaho-biserver/stop.sh > /dev/null
+RETVAL=$?
+echo
+;;
+ try-restart|condrestart)
+if test "$1" = "condrestart"; then
+echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+fi
+$0 status
+if test $? = 0; then
+$0 restart
+else
+: # Not running is not a failure.
+fi
+;;
+ restart)
+$0 stop
+$0 start
+;;
+ force-reload)
+echo -n "Reload service Jenkins "
+$0 try-restart
+;;
+ reload)
+ $0 restart
+;;
+ status)
+ status pentaho
+RETVAL=$?
+;;
+ *)
+echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+exit 1
+;;
+esac
+exit $RETVAL
View
0 SOURCES/pentaho.pid
No changes.
View
9 build-pentaho.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+version="3.10.0"
+if [ ! -f SOURCES/biserver-ce-3.10.0-stable.tar.gz ];
+then
+ wget "http://sourceforge.net/projects/pentaho/files/Business%20Intelligence%20Server/$version-stable/biserver-ce-$version-stable.tar.gz" -O SOURCES/biserver-ce-$version-stable.tar.gz
+fi
+rm -rf BUILD RPMS SRPMS tmp || true
+mkdir -p BUILD RPMS SRPMS
+rpmbuild -ba --define="_topdir $PWD" --define="_tmppath $PWD/tmp" --define="ver $version" pentaho.spec
View
86 pentaho.spec
@@ -0,0 +1,86 @@
+%define _prefix /opt/pentaho-biserver
+
+Name: pentaho-biserver
+Version: %{ver}
+Release: 1%{?dist}
+Summary: Pentaho BI server
+License: GPL
+URL: http://www.pentaho.com
+Source: http://downloads.sourceforge.net/project/pentaho/BusinessIntelligenceServer/%{version}-stable/biserver-ce-%{version}-stable.tar.gz
+Source1: pentaho.init
+Source2: pentaho.pid
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Requires: /usr/sbin/groupadd /usr/sbin/useradd
+Requires: java >= 1:1.6.0
+BuildArch: noarch
+
+%description
+
+
+%prep
+%setup -q -n biserver-ce
+
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%__install -d "%{buildroot}%{_prefix}"
+%__install -D -m0755 "%{SOURCE1}" "%{buildroot}/etc/init.d/pentaho"
+%__install -D -m0600 "%{SOURCE2}" "%{buildroot}/var/run/pentaho.pid"
+%__install -D -m0755 "start-pentaho.sh" "%{buildroot}%{_prefix}/start.sh"
+%__install -D -m0755 "stop-pentaho.sh" "%{buildroot}%{_prefix}/stop.sh"
+%__install -D -m0755 "set-pentaho-env.sh" "%{buildroot}%{_prefix}/set-pentaho-env.sh"
+
+cp -pr tomcat "%{buildroot}%{_prefix}"
+cp -pr pentaho-solutions "%{buildroot}%{_prefix}"
+cp -pr data "%{buildroot}%{_prefix}"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,pentaho,pentaho,-)
+%attr(0755,pentaho,pentaho) %dir %{_prefix}
+%doc
+%dir %{_prefix}
+%{_prefix}/start.sh
+%{_prefix}/stop.sh
+%{_prefix}/set-pentaho-env.sh
+%{_prefix}/tomcat
+%{_prefix}/pentaho-solutions
+%{_prefix}/data
+/etc/init.d/pentaho
+/var/run/pentaho.pid
+%exclude %{_prefix}/tomcat/bin/*.bat
+%exclude %{_prefix}/tomcat/bin/*.exe
+%exclude %{_prefix}/tomcat/bin/*.tar.gz
+%exclude %{_prefix}/tomcat/bin/*.dll
+
+%pre
+/usr/sbin/groupadd -r pentaho &>/dev/null || :
+/usr/sbin/useradd -g pentaho -s /bin/false -r -c "pentaho bi" \
+-d "%{_prefix}" pentaho &>/dev/null || :
+
+%post
+/sbin/chkconfig --add pentaho
+
+%preun
+if [ "$1" = 0 ] ; then
+ # if this is uninstallation as opposed to upgrade, delete the service
+ /sbin/service pentaho stop > /dev/null 2>&1
+ /sbin/chkconfig --del pentaho
+fi
+exit 0
+
+%postun
+if [ "$1" -ge 1 ]; then
+ /sbin/service pentaho condrestart > /dev/null 2>&1
+fi
+exit 0
+
+%changelog
+* Tue Dec 20 2011 Jean-Francois Roche <jfroche@affinitic.be>
+- Initial implementation
+

0 comments on commit 9ab71f7

Please sign in to comment.