From c101c697db43e4a90c7cf4f740ffef834a912476 Mon Sep 17 00:00:00 2001 From: Wayne Schneider Date: Thu, 4 Aug 2016 15:05:36 -0500 Subject: [PATCH] Debian packaging for Solr 6 [SOLR-26] --- README | 2 ++ debian/control | 12 +++++++++++- debian/links | 1 - debian/masterkey-lui-solr5.links | 1 + debian/masterkey-lui-solr5.postrm | 17 +++++++++++++++++ debian/masterkey-lui-solr5.prerm | 19 +++++++++++++++++++ debian/masterkey-lui-solr6.dirs | 6 ++++++ debian/masterkey-lui-solr6.install | 6 ++++++ debian/masterkey-lui-solr6.links | 1 + debian/masterkey-lui-solr6.postinst | 28 ++++++++++++++++++++++++++++ debian/masterkey-lui-solr6.postrm | 17 +++++++++++++++++ debian/masterkey-lui-solr6.prerm | 19 +++++++++++++++++++ debian/postrm | 17 ----------------- 13 files changed, 127 insertions(+), 19 deletions(-) delete mode 100644 debian/links create mode 100644 debian/masterkey-lui-solr5.links create mode 100755 debian/masterkey-lui-solr5.postrm create mode 100755 debian/masterkey-lui-solr5.prerm create mode 100644 debian/masterkey-lui-solr6.dirs create mode 100644 debian/masterkey-lui-solr6.install create mode 100644 debian/masterkey-lui-solr6.links create mode 100755 debian/masterkey-lui-solr6.postinst create mode 100755 debian/masterkey-lui-solr6.postrm create mode 100755 debian/masterkey-lui-solr6.prerm delete mode 100755 debian/postrm diff --git a/README b/README index 7d7a9c5..e304563 100644 --- a/README +++ b/README @@ -22,4 +22,6 @@ $ ../git-tools/id-deb-build/id-mk-deb-changelog.sh && dpkg-buildpackage -us -uc And to install LUI Solr: $ cd .. $ sudo dpkg -i masterkey-lui-solr5_*.indexdata_all.deb + OR +$ sudo dpkg -i masterkey-lui-solr6_*.indexdata_all.deb diff --git a/debian/control b/debian/control index c3e2c51..14aa8b5 100644 --- a/debian/control +++ b/debian/control @@ -8,10 +8,20 @@ Homepage: http://www.indexdata.com/masterkey Package: masterkey-lui-solr5 Architecture: all -Depends: openjdk-7-jdk, ${misc:Depends} +Depends: openjdk-7-jdk | openjdk-8-jdk, ${misc:Depends} Conflicts: masterkey-lui-solr4-common, masterkey-lui-solr4-master, masterkey-lui-solr4-slave, masterkey-lui-solr4-zookeeper, masterkey-lui-solr4-common-tomcat6, masterkey-lui-solr4-master-tomcat6, masterkey-lui-solr4-slave-tomcat6, masterkey-lui-solr4-common-tomcat8, masterkey-lui-solr4-master-tomcat8, masterkey-lui-solr4-slave-tomcat8 Replaces: masterkey-lui-solr4-common, masterkey-lui-solr4-master, masterkey-lui-solr4-slave, masterkey-lui-solr4-zookeeper, masterkey-lui-solr4-common-tomcat6, masterkey-lui-solr4-master-tomcat6, masterkey-lui-solr4-slave-tomcat6, masterkey-lui-solr4-common-tomcat8, masterkey-lui-solr4-master-tomcat8, masterkey-lui-solr4-slave-tomcat8 Description: Local Unified Index (Solr) The Local Unified Index is a index that contains multiple logical indexes (subdatabases). The underlying index is a Solr/Lucene 5 index configured to use a specific LUI schema. + +Package: masterkey-lui-solr6 +Architecture: all +Depends: openjdk-8-jdk, ${misc:Depends} +Conflicts: masterkey-lui-solr4-common, masterkey-lui-solr4-master, masterkey-lui-solr4-slave, masterkey-lui-solr4-zookeeper, masterkey-lui-solr4-common-tomcat6, masterkey-lui-solr4-master-tomcat6, masterkey-lui-solr4-slave-tomcat6, masterkey-lui-solr4-common-tomcat8, masterkey-lui-solr4-master-tomcat8, masterkey-lui-solr4-slave-tomcat8, masterkey-lui-solr5 +Replaces: masterkey-lui-solr4-common, masterkey-lui-solr4-master, masterkey-lui-solr4-slave, masterkey-lui-solr4-zookeeper, masterkey-lui-solr4-common-tomcat6, masterkey-lui-solr4-master-tomcat6, masterkey-lui-solr4-slave-tomcat6, masterkey-lui-solr4-common-tomcat8, masterkey-lui-solr4-master-tomcat8, masterkey-lui-solr4-slave-tomcat8, masterkey-lui-solr5 +Description: Local Unified Index (Solr) + The Local Unified Index is a index that contains multiple logical indexes + (subdatabases). The underlying index is a Solr/Lucene 6 index configured + to use a specific LUI schema. diff --git a/debian/links b/debian/links deleted file mode 100644 index 1d33fc4..0000000 --- a/debian/links +++ /dev/null @@ -1 +0,0 @@ -etc/masterkey/lui/solr/lui-solr.in.sh etc/default/lui-solr.in.sh \ No newline at end of file diff --git a/debian/masterkey-lui-solr5.links b/debian/masterkey-lui-solr5.links new file mode 100644 index 0000000..1d33fc4 --- /dev/null +++ b/debian/masterkey-lui-solr5.links @@ -0,0 +1 @@ +etc/masterkey/lui/solr/lui-solr.in.sh etc/default/lui-solr.in.sh \ No newline at end of file diff --git a/debian/masterkey-lui-solr5.postrm b/debian/masterkey-lui-solr5.postrm new file mode 100755 index 0000000..b11b87e --- /dev/null +++ b/debian/masterkey-lui-solr5.postrm @@ -0,0 +1,17 @@ +#!/bin/sh -e + +case "$1" in + purge|remove) + # Remove Solr installation + rm -f /usr/share/masterkey/lui/lui-solr + rm -rf /usr/share/masterkey/lui/solr-* + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 +esac + +exit 0 diff --git a/debian/masterkey-lui-solr5.prerm b/debian/masterkey-lui-solr5.prerm new file mode 100755 index 0000000..5d3cdbf --- /dev/null +++ b/debian/masterkey-lui-solr5.prerm @@ -0,0 +1,19 @@ +#!/bin/sh -e + +case "$1" in + remove|upgrade|remove|deconfigure) + # Stop lui-solr service + if [ -x "/etc/init.d/lui-solr" ]; then + invoke-rc.d lui-solr stop || exit $? + fi + + ;; + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 +esac + +exit 0 diff --git a/debian/masterkey-lui-solr6.dirs b/debian/masterkey-lui-solr6.dirs new file mode 100644 index 0000000..efa7cc4 --- /dev/null +++ b/debian/masterkey-lui-solr6.dirs @@ -0,0 +1,6 @@ +etc/default +usr/share/masterkey/lui/dist +usr/share/doc/masterkey-lui-solr6 +etc/masterkey/lui/solr +var/log/masterkey/lui +var/lib/masterkey/lui/solr/lui diff --git a/debian/masterkey-lui-solr6.install b/debian/masterkey-lui-solr6.install new file mode 100644 index 0000000..3424ccd --- /dev/null +++ b/debian/masterkey-lui-solr6.install @@ -0,0 +1,6 @@ +dist/solr-6*.tgz usr/share/masterkey/lui/dist +dist/install_solr6_service.sh usr/share/masterkey/lui/dist +conf/solr/* etc/masterkey/lui/solr +doc/apache-solr-ref-guide-6*.pdf usr/share/doc/masterkey-lui-solr6 +doc/debian-install.md usr/share/doc/masterkey-lui-solr6 +doc/upgrade.md usr/share/doc/masterkey-lui-solr6 diff --git a/debian/masterkey-lui-solr6.links b/debian/masterkey-lui-solr6.links new file mode 100644 index 0000000..1d33fc4 --- /dev/null +++ b/debian/masterkey-lui-solr6.links @@ -0,0 +1 @@ +etc/masterkey/lui/solr/lui-solr.in.sh etc/default/lui-solr.in.sh \ No newline at end of file diff --git a/debian/masterkey-lui-solr6.postinst b/debian/masterkey-lui-solr6.postinst new file mode 100755 index 0000000..b93590c --- /dev/null +++ b/debian/masterkey-lui-solr6.postinst @@ -0,0 +1,28 @@ +#!/bin/sh -e + +case "$1" in + configure|upgrade) + # Create the solr user + adduser --system --shell /bin/bash --group --disabled-password --home /var/lib/masterkey/lui lui-solr + # Set directory permissions + chown -R lui-solr /var/lib/masterkey/lui + chown -R lui-solr /var/log/masterkey/lui + chown -R lui-solr /etc/masterkey/lui/solr/solr-home + # Run Solr installation script + /usr/share/masterkey/lui/dist/install_solr6_service.sh /usr/share/masterkey/lui/dist/solr-6.1.0.tgz -d /var/lib/masterkey/lui -i /usr/share/masterkey/lui -s lui-solr -u lui-solr -f + # Remove extra files created by Solr installation + rm -f /var/lib/masterkey/lui/log4j.properties + rm -rf /var/lib/masterkey/lui/logs + rm -rf /var/lib/masterkey/lui/data + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument '$1'" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/masterkey-lui-solr6.postrm b/debian/masterkey-lui-solr6.postrm new file mode 100755 index 0000000..b11b87e --- /dev/null +++ b/debian/masterkey-lui-solr6.postrm @@ -0,0 +1,17 @@ +#!/bin/sh -e + +case "$1" in + purge|remove) + # Remove Solr installation + rm -f /usr/share/masterkey/lui/lui-solr + rm -rf /usr/share/masterkey/lui/solr-* + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 +esac + +exit 0 diff --git a/debian/masterkey-lui-solr6.prerm b/debian/masterkey-lui-solr6.prerm new file mode 100755 index 0000000..5d3cdbf --- /dev/null +++ b/debian/masterkey-lui-solr6.prerm @@ -0,0 +1,19 @@ +#!/bin/sh -e + +case "$1" in + remove|upgrade|remove|deconfigure) + # Stop lui-solr service + if [ -x "/etc/init.d/lui-solr" ]; then + invoke-rc.d lui-solr stop || exit $? + fi + + ;; + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 +esac + +exit 0 diff --git a/debian/postrm b/debian/postrm deleted file mode 100755 index b11b87e..0000000 --- a/debian/postrm +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -e - -case "$1" in - purge|remove) - # Remove Solr installation - rm -f /usr/share/masterkey/lui/lui-solr - rm -rf /usr/share/masterkey/lui/solr-* - ;; - upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 -esac - -exit 0 -- 1.7.10.4