This is an automated email from the ASF dual-hosted git repository.

sekikn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/master by this push:
     new c4b34b297 BIGTOP-4023: Add ranger deb packaging support (#1197)
c4b34b297 is described below

commit c4b34b2972c98e800916ef7bcf4c72412cba7055
Author: jialiang <[email protected]>
AuthorDate: Thu Oct 19 18:26:15 2023 +0800

    BIGTOP-4023: Add ranger deb packaging support (#1197)
    
    * BIGTOP-4023: Add ranger deb packaging support
    
    * add postgresql dependency
    fix copyright and ranger.postinst.tpl file typo
    
    ---------
    
    Co-authored-by: jialiang <[email protected]>
---
 bigtop-packages/src/deb/ranger/changelog           |   1 +
 bigtop-packages/src/deb/ranger/compat              |   1 +
 bigtop-packages/src/deb/ranger/control             | 120 +++++++++++++
 bigtop-packages/src/deb/ranger/copyright           |  11 ++
 bigtop-packages/src/deb/ranger/ranger.postinst.tpl |  37 ++++
 bigtop-packages/src/deb/ranger/ranger.preinst.tpl  |  62 +++++++
 bigtop-packages/src/deb/ranger/ranger.prerm.tpl    |  57 ++++++
 bigtop-packages/src/deb/ranger/rules               | 196 +++++++++++++++++++++
 bigtop-packages/src/deb/ranger/source/format       |   1 +
 bigtop.bom                                         |   1 -
 10 files changed, 486 insertions(+), 1 deletion(-)

diff --git a/bigtop-packages/src/deb/ranger/changelog 
b/bigtop-packages/src/deb/ranger/changelog
new file mode 100644
index 000000000..4ebab339e
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/changelog
@@ -0,0 +1 @@
+-- NOTE: this gets auto-generated
diff --git a/bigtop-packages/src/deb/ranger/compat 
b/bigtop-packages/src/deb/ranger/compat
new file mode 100644
index 000000000..48082f72f
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/compat
@@ -0,0 +1 @@
+12
diff --git a/bigtop-packages/src/deb/ranger/control 
b/bigtop-packages/src/deb/ranger/control
new file mode 100644
index 000000000..cb231198c
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/control
@@ -0,0 +1,120 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+Source: ranger
+Section: misc
+Priority: optional
+Maintainer: Bigtop <[email protected]>
+Build-Depends: debhelper (>= 7.0.50~)
+Standards-Version: 3.9.4
+Homepage: http://ranger.apache.org/
+
+Package: ranger
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Apache Ranger is a framework to enable,
+ monitor and manage comprehensive data security across the Hadoop platform.
+ The vision with Ranger is to provide comprehensive security across the Apache 
Hadoop ecosystem.
+ With the advent of Apache YARN, the Hadoop platform can now support a true 
data lake architecture.
+ Enterprises can potentially run multiple workloads, in a multi tenant 
environment.
+ Data security within Hadoop needs to evolve to support multiple use cases for 
data access,
+ while also providing a framework for central administration of security 
policies and monitoring of user access.
+
+
+Package: ranger-admin
+Architecture: all
+Depends: adduser, postgresql (>= 8.1), bigtop-utils (>= 0.7), python | python2
+Description: Ranger-admin is admin component associated with the Ranger 
framework
+
+Package: ranger-usersync
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger-usersync is user/group synchronization component 
associated with the Ranger framework
+
+Package: ranger-kms
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger-kms is key management server component associated with the 
Ranger framework
+
+
+Package: ranger-tagsync
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger-tagsync is tag synchronizer component associated with the 
Ranger framework
+
+Package: ranger-hdfs-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger HDFS plugin component runs within namenode to provide 
enterprise security using ranger framework
+
+Package: ranger-yarn-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger YARN plugin component runs within resourcemanager to 
provide enterprise security using ranger framework
+
+Package: ranger-hive-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger Hive plugin component runs within hiveserver2 to provide 
enterprise security using ranger framework
+
+Package: ranger-hbase-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger HBASE plugin component runs within master and region 
servers as co-processor to provide enterprise security using ranger framework
+
+Package: ranger-knox-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger KNOX plugin component runs within knox proxy server to 
provide enterprise security using ranger framework
+
+Package: ranger-storm-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger STORM plugin component runs within storm to provide 
enterprise security using ranger framework
+
+Package: ranger-kafka-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger KAFKA plugin component runs within kafka to provide 
enterprise security using ranger framework
+
+Package: ranger-atlas-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger ATLAS plugin component runs within atlas to provide 
enterprise security using ranger framework
+
+Package: ranger-solr-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger SOLR plugin component runs within solr to provide 
enterprise security using ranger framework
+
+Package: ranger-sqoop-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger SQOOP plugin component runs within sqoop to provide 
enterprise security using ranger framework
+
+Package: ranger-kylin-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger KYLIN plugin component runs within kylin to provide 
enterprise security using ranger framework
+
+Package: ranger-elasticsearch-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger ELASTICSEARCH plugin component runs within elasticsearch 
to provide enterprise security using ranger framework
+
+Package: ranger-presto-plugin
+Architecture: all
+Depends: adduser, bigtop-utils (>= 0.7), python | python2
+Description: Ranger PRESTO plugin component runs within presto to provide 
enterprise security using ranger framework
\ No newline at end of file
diff --git a/bigtop-packages/src/deb/ranger/copyright 
b/bigtop-packages/src/deb/ranger/copyright
new file mode 100644
index 000000000..99816224b
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/copyright
@@ -0,0 +1,11 @@
+Format: http://dep.debian.net/deps/dep5
+Source: http://ranger.apache.org/
+Upstream-Name: Apache Ranger
+
+Files: *
+Copyright: 2014-2019, The Apache Software Foundation
+License: Apache-2.0
+
+License: Apache-2.0
+ On Debian systems, the complete text of the Apache 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
diff --git a/bigtop-packages/src/deb/ranger/ranger.postinst.tpl 
b/bigtop-packages/src/deb/ranger/ranger.postinst.tpl
new file mode 100644
index 000000000..b518350ca
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/ranger.postinst.tpl
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# postinst script for ranger
+
+set -e
+
+case "$1" in
+       configure)
+                update-alternatives --install /etc/ranger/conf ranger-conf 
@etc_ranger@/conf.dist 30
+               chown ranger:ranger -R /var/run/ranger /var/log/ranger 
@var_lib_ranger@
+       ;;
+
+       abort-upgrade|abort-remove|abort-deconfigure)
+       ;;
+
+       *)
+               echo "postinst called with unknown argument \`$1'" >&2
+               exit 1
+       ;;
+esac
+
+#DEBHELPER#
diff --git a/bigtop-packages/src/deb/ranger/ranger.preinst.tpl 
b/bigtop-packages/src/deb/ranger/ranger.preinst.tpl
new file mode 100644
index 000000000..49da2ac8c
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/ranger.preinst.tpl
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# preinst script for ranger
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    install|upgrade)
+        getent group ranger >/dev/null || groupadd -r ranger
+        if ! getent passwd ranger >/dev/null; then
+                # Adding system user: ranger.
+                adduser \
+                  --system \
+                  --ingroup ranger \
+                  --home @var_lib_ranger@ \
+                  --gecos "Ranger User" \
+                  --shell /bin/bash \
+                  ranger >/dev/null
+        fi
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/bigtop-packages/src/deb/ranger/ranger.prerm.tpl 
b/bigtop-packages/src/deb/ranger/ranger.prerm.tpl
new file mode 100644
index 000000000..f5ad52e68
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/ranger.prerm.tpl
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# prerm script for ranger
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+      update-alternatives --remove ranger-conf @etc_ranger@/conf.dist || :
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/bigtop-packages/src/deb/ranger/rules 
b/bigtop-packages/src/deb/ranger/rules
new file mode 100755
index 000000000..c9c50ddb5
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/rules
@@ -0,0 +1,196 @@
+#!/usr/bin/make -f
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+ranger_pkg_name=ranger
+
+%:
+       dh $@
+
+ranger_name=ranger
+
+man_dir=/usr/share/man
+bin_dir=/usr/bin
+doc_ranger=/usr/share/doc/${ranger_name}
+usr_lib_ranger=/usr/lib/${ranger_name}
+etc_default=/etc/default
+etc_ranger=/etc/${ranger_name}
+var_lib_ranger=/var/lib/${ranger_name}
+var_run_ranger=/var/run/${ranger_name}
+
+usr_lib_hadoop=/usr/lib/hadoop
+usr_lib_hive=/usr/lib/hive
+usr_lib_knox=/usr/lib/knox
+usr_lib_storm=/usr/lib/storm
+usr_lib_hbase=/usr/lib/hbase
+usr_lib_kafka=/usr/lib/kafka
+usr_lib_atlas=/usr/lib/atlas
+usr_lib_solr=/usr/lib/solr
+usr_lib_sqoop=/usr/lib/sqoop
+usr_lib_kylin=/usr/lib/kylin
+usr_lib_elasticsearch=/usr/lib/elasticsearch
+usr_lib_presto=/usr/lib/presto
+
+
+define ranger_admin_install
+${var_lib_ranger}
+${var_run_ranger}
+${etc_ranger}/admin/conf.dist
+${etc_ranger}/admin
+${usr_lib_ranger}-admin
+endef
+
+define ranger_usersync_install
+${usr_lib_ranger}-usersync
+${usr_lib_ranger}-usersync/native/credValidator.uexe
+${etc_ranger}/usersync/conf.dist
+${etc_ranger}/usersync
+endef
+
+define ranger_kms_install
+${usr_lib_ranger}-kms
+${etc_ranger}/kms/conf.dist
+${etc_ranger}/kms
+endef
+
+define ranger_tagsync_install
+${usr_lib_ranger}-tagsync
+${etc_ranger}/tagsync/conf.dist
+${etc_ranger}/tagsync
+endef
+
+define ranger_hdfs_plugin_install
+${usr_lib_ranger}-hdfs-plugin
+${usr_lib_hadoop}/lib
+endef
+
+define ranger_yarn_plugin_install
+${usr_lib_ranger}-yarn-plugin
+${usr_lib_hadoop}/lib
+endef
+
+define ranger_hive_plugin_install
+${usr_lib_ranger}-hive-plugin
+${usr_lib_hive}/lib
+endef
+
+define ranger_hbase_plugin_install
+${usr_lib_ranger}-hbase-plugin
+${usr_lib_hbase}/lib
+endef
+
+define ranger_knox_plugin_install
+${usr_lib_ranger}-knox-plugin
+${usr_lib_knox}/ext
+endef
+
+define ranger_storm_plugin_install
+${usr_lib_ranger}-storm-plugin
+${usr_lib_storm}/extlib-daemon
+endef
+
+define ranger_kafka_plugin_install
+${usr_lib_ranger}-kafka-plugin
+${usr_lib_kafka}/libs
+endef
+
+define ranger_atlas_plugin_install
+${usr_lib_ranger}-atlas-plugin
+${usr_lib_atlas}/libext
+endef
+
+define ranger_solr_plugin_install
+${usr_lib_ranger}-solr-plugin
+${usr_lib_solr}/server/solr-webapp/webapp/WEB-INF/lib/
+endef
+
+define ranger_sqoop_plugin_install
+${usr_lib_ranger}-sqoop-plugin
+${usr_lib_sqoop}/server/lib
+endef
+
+define ranger_kylin_plugin_install
+${usr_lib_ranger}-kylin-plugin
+${usr_lib_kylin}/tomcat/webapps/kylin/WEB-INF/lib
+endef
+
+define ranger_elasticsearch_plugin_install
+${usr_lib_ranger}-elasticsearch-plugin
+${usr_lib_elasticsearch}/plugins
+endef
+
+define ranger_presto_plugin_install
+${usr_lib_ranger}-presto-plugin
+${usr_lib_presto}/plugin/ranger
+endef
+
+define get_install_name
+$(ranger_$(subst -,_,$(1))_install)
+endef
+
+define gen_install
+$(foreach item,$(call get_install_name,$(1)),echo $(item) >> 
debian/ranger-$(1).install;)
+endef
+
+define gen_rule
+$(foreach item, postinst preinst prerm,\
+       cp debian/ranger.$(item).tpl debian/range-$(1).$(item);\
+       sed -i -e 's:@var_lib_ranger@:${var_lib_ranger}:g' -e 
's:@etc_ranger@:${etc_ranger}:g' debian/range-$(1).$(item);\
+)
+endef
+
+define comp_install
+       env RANGER_VERSION=${RANGER_BASE_VERSION} \
+       bash debian/install_ranger.sh \
+               --prefix=debian/tmp \
+               --build-dir=build \
+               --component=$(1) \
+               --comp-dir=${usr_lib_ranger}-$(1) \
+               --var-ranger=${var_lib_ranger} \
+               --etc-ranger=${etc_ranger} \
+               --doc-dir=${doc_ranger}
+endef
+
+COMPS = admin usersync kms tagsync hdfs-plugin yarn-plugin hive-plugin 
hbase-plugin knox-plugin storm-plugin kafka-plugin atlas-plugin sqoop-plugin 
solr-plugin kylin-plugin elasticsearch-plugin presto-plugin
+
+
+.PHONY: gen_files
+
+
+gen_files:
+       $(foreach item,$(COMPS), $(call gen_install,$(item)))
+       $(foreach item, admin usersync kms tagsync, $(call gen_rule,$(item)))
+
+override_dh_auto_build:
+       bash -x debian/do-component-build 
-Dmaven.repo.local=${HOME}/.m2/repository
+
+override_dh_auto_install: gen_files
+       for comp in $(COMPS); do \
+               $(call comp_install,$$comp); \
+       done
+
+override_dh_install:
+       dh_install
+
+override_dh_strip_nondeterminism:
diff --git a/bigtop-packages/src/deb/ranger/source/format 
b/bigtop-packages/src/deb/ranger/source/format
new file mode 100644
index 000000000..163aaf8d8
--- /dev/null
+++ b/bigtop-packages/src/deb/ranger/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/bigtop.bom b/bigtop.bom
index 70ff2c1da..32103a92f 100644
--- a/bigtop.bom
+++ b/bigtop.bom
@@ -376,7 +376,6 @@ bigtop {
                 source      = destination }
       url     { site = "https://github.com/apache/ranger/archive/refs/tags";
                 archive = site }
-      packaging = 'rpm'
     }
   }
 }

Reply via email to