Summary: osgi-runner - The OSGi service packaging of clazzes.org Name: osgi-runner-pkg Packager: Wolfgang Glas BuildRequires: tar wget BuildArch: noarch Version: 3.3.0 Release: 0beta2 License: APL2/clazzes.org Group: Applications/Internet Source: osgi-runner-pkg-%{version}.tar.gz BuildRoot: /var/tmp/%{name}-buildroot ###XBCS-PBA-Category: osgi-runner ###XBCS-PBA-Generation: 3 ###XBCS-PBA-Distributions: centos7 ###XBCS-PBA-Repository: rpm.clazzes.org %define __jar_repack 0 %description osgi-runner meta-package depending on server and client packages. %package -n osgi-runner-log4j2 Summary: Provides new-style log4j2 logging to osgi-runner Provides: osgi-runner-logging Conflicts: osgi-runner-log4j %description -n osgi-runner-log4j2 Provides new-style log4j2 logging to osgi-runner, alternative package. %package -n osgi-runner-logstash Summary: Provides logstash-gelf plugin to allow logging to GELF backends, i.e. Graylog servers. Requires: osgi-runner-log4j2 %description -n osgi-runner-logstash Provides logstash-gelf plugin to allow logging to GELF backends, i.e. Graylog servers. %package -n osgi-runner-server Summary: The server part of osgi-runner Requires: jre-headless osgi-runner-logging Requires: osgi-runner-systemd %description -n osgi-runner-server osgi-runner is a server, which runs the apache felix OSGi container %package -n osgi-runner-systemd Summary: SystemD integration of osgi-runner-server Requires: osgi-runner-server %description -n osgi-runner-systemd This is the systemd integration of the OSGi runner server. %package -n osgi-runner-client Summary: ssh wrapper scripts for accessing an osgi-runner server Requires: openssh-clients %description -n osgi-runner-client Client tools to conenct to osgi-runner via ssh. %package -n osgi-runner Summary: osgi-runner meta package depending on client and server. Requires: osgi-runner-server osgi-runner-client %description -n osgi-runner osgi-runner is a metapackage, which runs the apache felix OSGi container %package -n osgi-runner-test Summary: Helper scripts for setting up and running osgi-runner test setups. Requires: osgi-runner-server %description -n osgi-runner-test Scripts to set up and run standalone OSGi runner test installations. %prep %setup -q ./fetch_bundles.sh %install OSGI_HOME=/usr/share/osgi-runner OSGI_ETC=/etc/osgi-runner rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT$OSGI_HOME/sh mkdir -p $RPM_BUILD_ROOT/etc mkdir -p $RPM_BUILD_ROOT/lib # collect systemd mkdir -p $RPM_BUILD_ROOT/usr/sbin (cd lib; tar --exclude=.svn --exclude='*~' -c -f - systemd) | (cd $RPM_BUILD_ROOT/lib; tar xf -) install -m 755 unix/osgi-runner-dump.sh $RPM_BUILD_ROOT/usr/sbin/osgi-runner-dump install -m 755 unix/osgi-runner-debug.sh $RPM_BUILD_ROOT/usr/sbin/osgi-runner-debug install -m 755 unix/osgi-runner-run.sh $RPM_BUILD_ROOT/usr/sbin/osgi-runner-run # collect srv (cd etc; tar --exclude=.svn --exclude='*~' -c -f - default osgi-runner) | (cd $RPM_BUILD_ROOT/etc; tar xf -) mkdir -p $RPM_BUILD_ROOT$OSGI_ETC/sshd.d chmod 750 $RPM_BUILD_ROOT$OSGI_ETC/sshd.d chmod 750 $RPM_BUILD_ROOT$OSGI_ETC/htpasswd.d cp unix/unix.properties $RPM_BUILD_ROOT$OSGI_ETC/conf.d mkdir $RPM_BUILD_ROOT$OSGI_HOME/drivers install -m 755 unix/check-dirs.sh $RPM_BUILD_ROOT$OSGI_HOME/sh install -m 755 unix/check-or-create-hostkey.sh $RPM_BUILD_ROOT$OSGI_HOME/sh install -m 755 unix/create-osgi-user.sh $RPM_BUILD_ROOT$OSGI_HOME/sh install -m 755 unix/migrate-keys-properties.sh $RPM_BUILD_ROOT$OSGI_HOME/sh install -m 644 unix/load-config-include.sh $RPM_BUILD_ROOT$OSGI_HOME/sh cp -pr downloads/lib $RPM_BUILD_ROOT$OSGI_HOME cp -pr downloads/bundle1 $RPM_BUILD_ROOT$OSGI_HOME cp -pr downloads/bundle2 $RPM_BUILD_ROOT$OSGI_HOME cp -pr downloads/bundle3 $RPM_BUILD_ROOT$OSGI_HOME cp -pr downloads/bundle4 $RPM_BUILD_ROOT$OSGI_HOME cp -pr downloads/bundle5 $RPM_BUILD_ROOT$OSGI_HOME cp -pr downloads/aux $RPM_BUILD_ROOT$OSGI_HOME cp -p downloads/bundle2-log4j2/*.jar $RPM_BUILD_ROOT$OSGI_HOME/bundle2 cp -p downloads/bundle2-logstash/*.jar $RPM_BUILD_ROOT$OSGI_HOME/bundle2 # collect client mkdir -p $RPM_BUILD_ROOT/usr/bin install -m 755 unix/osgi-cmd.sh $RPM_BUILD_ROOT/usr/bin/osgi-cmd install -m 755 unix/osgi-install.sh $RPM_BUILD_ROOT/usr/bin/osgi-install install -m 755 unix/osgi-shell.sh $RPM_BUILD_ROOT/usr/bin/osgi-shell # collect adm.d.examples mkdir -p $RPM_BUILD_ROOT$OSGI_ETC/adm.d.examples/log4j2 install -m 755 etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-cfg $RPM_BUILD_ROOT$OSGI_ETC/adm.d.examples/log4j2/org.ops4j.pax.logging.cfg mkdir -p $RPM_BUILD_ROOT$OSGI_ETC/adm.d.examples/log4j2-gelf install -m 755 etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-gelf-cfg $RPM_BUILD_ROOT$OSGI_ETC/adm.d.examples/log4j2-gelf/org.ops4j.pax.logging.cfg mkdir -p $RPM_BUILD_ROOT$OSGI_HOME/test (cd test; tar --exclude=.svn --exclude='*~' -c -f - etc) | (cd $RPM_BUILD_ROOT$OSGI_HOME/test; tar xf -) install -m 755 unix/osgi-runner-test-setup.sh $RPM_BUILD_ROOT/usr/bin/osgi-runner-test-setup install -m 755 unix/osgi-runner-test.sh $RPM_BUILD_ROOT/usr/bin/osgi-runner-test %clean rm -rf $RPM_BUILD_ROOT rm -rf downloads %pretrans -n osgi-runner-systemd service osgi-runner status >/dev/null && service osgi-runner stop || /bin/true %preun -n osgi-runner-systemd service osgi-runner status >/dev/null && service osgi-runner stop || /bin/true %preun -n osgi-runner-server service osgi-runner status >/dev/null && service osgi-runner stop || /bin/true if test -d /var/cache/osgi-runner/felix-cache then echo "Cleaning /var/cache/osgi-runner/felix-cache upon removal of osgi-runner." /bin/rm -rf /var/cache/osgi-runner/felix-cache fi %pre -n osgi-runner-systemd service osgi-runner status >/dev/null && service osgi-runner stop || /bin/true %pre -n osgi-runner-server service osgi-runner status >/dev/null && service osgi-runner stop || /bin/true if test -d /var/cache/osgi-runner/felix-cache then echo "Cleaning /var/cache/osgi-runner/felix-cache upon removal of osgi-runner." /bin/rm -rf /var/cache/osgi-runner/felix-cache fi %post -n osgi-runner-server /usr/share/osgi-runner/sh/create-osgi-user.sh /usr/share/osgi-runner/sh/migrate-keys-properties.sh %post -n osgi-runner-log4j2 grep -q '^log4j2\.' /etc/osgi-runner/adm.d/org.ops4j.pax.logging.cfg 2> /dev/null || cp /etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-cfg /etc/osgi-runner/adm.d/org.ops4j.pax.logging.cfg %post -n osgi-runner-logstash # nothing %posttrans -n osgi-runner-systemd /usr/bin/systemctl daemon-reload if systemctl is-enabled osgi-runner.service then systemctl is-active osgi-runner.service || systemctl start osgi-runner.service || /bin/true else echo "Not automatically starting disabled osgi-runner.service." echo "Please run systemctl enable osgi-runner and/or systemctl start osgi-runner" fi %files -n osgi-runner-server %defattr(-,root,root) /usr/share/osgi-runner/sh /usr/share/osgi-runner/lib /usr/share/osgi-runner/drivers /usr/share/osgi-runner/bundle1 /usr/share/osgi-runner/bundle2/pax-logging-api-*.jar /usr/share/osgi-runner/bundle3 /usr/share/osgi-runner/bundle4 /usr/share/osgi-runner/bundle5 /usr/share/osgi-runner/aux %config(noreplace) /etc/default/osgi-runner %config(noreplace) /etc/osgi-runner/system.properties %config(noreplace) /etc/osgi-runner/conf.d %config(noreplace) /etc/osgi-runner/sshd.d %config(noreplace) /etc/osgi-runner/htpasswd.d %config(noreplace) /etc/osgi-runner/adm.d/*.cfg %files -n osgi-runner-systemd %defattr(-,root,root) /lib/systemd/system/osgi-runner.service /usr/sbin/osgi-runner-dump /usr/sbin/osgi-runner-debug /usr/sbin/osgi-runner-run %files -n osgi-runner-log4j2 %defattr(-,root,root) /usr/share/osgi-runner/bundle2/pax-logging-log4j2-*.jar /etc/osgi-runner/adm.d.examples/log4j2/org.ops4j.pax.logging.cfg %config /etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-cfg %files -n osgi-runner-logstash %defattr(-,root,root) /usr/share/osgi-runner/bundle2/pax-logstash-*.jar /etc/osgi-runner/adm.d.examples/log4j2-gelf/org.ops4j.pax.logging.cfg %config /etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-gelf-cfg %files -n osgi-runner-client %defattr(-,root,root) /usr/bin/osgi-cmd /usr/bin/osgi-install /usr/bin/osgi-shell %files -n osgi-runner %defattr(-,root,root) %files -n osgi-runner-test %defattr(-,root,root) /usr/share/osgi-runner/test /usr/bin/osgi-runner-test-setup /usr/bin/osgi-runner-test %changelog