Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGTOP-3904: Introduce bigtop-select deb package to Bigtop #1082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bigtop-packages/src/common/bigtop-select/distro-select
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def checkCommandParameters(cmd, realLen, rightLen):
#
# Start of main

if not os.path.exists(root):
os.makedirs(root)

sanityCheckTables()

parser = optparse.OptionParser(add_help_option=False)
Expand Down
4 changes: 4 additions & 0 deletions bigtop-packages/src/common/bigtop-select/install_select.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ LIB_DIR=${LIB_DIR:-/usr/lib/bigtop-select}
BIN_DIR=${BIN_DIR:-/usr/bin}
CONF_DIR=${CONF_DIR:-/etc/bigtop-select/conf.dist}

if [[ ${PARENT_DIR} == "" ]];then
PARENT_DIR=/usr/bigtop/${BIGTOP_BASE_VERSION}
fi

STACK_ROOT_DIR=$(echo ${PARENT_DIR} | sed -e "s/\/${BIGTOP_BASE_VERSION}$//")
STACK_SELECTOR=distro-select
CONF_SELECTOR=conf-select
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/lib/bigtop-select
5 changes: 5 additions & 0 deletions bigtop-packages/src/deb/bigtop-select/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bigtop-select (3.2.1-1) unstable; urgency=medium

* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>

-- Bigtop <[email protected]> Wed, 01 Feb 2023 12:51:18 +0000
15 changes: 15 additions & 0 deletions bigtop-packages/src/deb/bigtop-select/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Source: bigtop-select
Section: unknown
Priority: optional
Maintainer: Bigtop <[email protected]>
Build-Depends: debhelper-compat (= 12)
Standards-Version: 4.4.1
Homepage: <insert the upstream URL, if relevant>
#Vcs-Browser: https://salsa.debian.org/debian/bigtop-select
#Vcs-Git: https://salsa.debian.org/debian/bigtop-select.git

Package: bigtop-select
Architecture: all
Depends: ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
43 changes: 43 additions & 0 deletions bigtop-packages/src/deb/bigtop-select/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: bigtop-select
Upstream-Contact: <preferred name and address to reach the upstream project>
Source: <url://example.com>

Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>

# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2023 Bigtop <[email protected]>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid picking licenses with terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
#
# If you need, there are some extra license texts available in two places:
# /usr/share/debhelper/dh_make/licenses/
# /usr/share/common-licenses/
40 changes: 40 additions & 0 deletions bigtop-packages/src/deb/bigtop-select/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# 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

%:
dh $@


# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
#override_dh_auto_configure:
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

override_dh_auto_install:
bash -x debian/install_select.sh \
--prefix=debian/tmp \
--distro-dir=debian \
--build-dir=`pwd` \
--parent-dir=$(PARENT_DIR) \
--bigtop-base-version=$(BIGTOP_BASE_VERSION)

rm -f debian/distro-select
rm -f debian/conf-select
1 change: 1 addition & 0 deletions bigtop-packages/src/deb/bigtop-select/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

%define lib_dir /usr/lib/bigtop-select
%define bin_dir /usr/bin
%define default_parent_dir /usr/bigtop/%{bigtop_base_version}
%if "%{parent_dir}" != ""
%define default_parent_dir %{parent_dir}
%endif

Name: bigtop-select
Version: %{bigtop_select_version}
Expand Down Expand Up @@ -64,7 +60,7 @@ bash %{SOURCE0} \
--distro-dir=${RPM_SOURCE_DIR} \
--build-dir=${PWD} \
--prefix=${RPM_BUILD_ROOT} \
--parent-dir=%{default_parent_dir} \
--parent-dir=%{parent_dir} \
--bigtop-base-version=%{bigtop_base_version}

%clean
Expand All @@ -76,7 +72,6 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE

%{lib_dir}
%{default_parent_dir}

%changelog

1 change: 0 additions & 1 deletion bigtop.bom
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ bigtop {
relNotes = "Service package for Apache Bigtop information to use Ambari"
version { base = bigtop.version; pkg = base-"-SNAPSHOT"; release = 1 }
tarball { destination = "bigtop-select-${version.base}.tar.gz" }
packaging = 'rpm'
}
'bigtop-jsvc' {
name = "bigtop-jsvc"
Expand Down
9 changes: 9 additions & 0 deletions packages.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ def genTasks = { target ->
def final SRCDEB = "${PKG_NAME}_$PKG_VERSION-${BIGTOP_BUILD_STAMP}.dsc"
def final HADOOP_VERSION = config.bigtop.components["hadoop"].version.pkg

def final BIGTOP_BASE_VERSION = "${config.bigtop.base_version}"
def final PARENT_DIR = project.hasProperty("parentDir") ? project.property('parentDir') : ""
def FULL_PARENT_DIR = "${PARENT_DIR}"
if (PARENT_DIR != "") {
FULL_PARENT_DIR = "${PARENT_DIR}/${BIGTOP_BASE_VERSION}"
}

exec {
workingDir PKG_OUTPUT_DIR
commandLine "dpkg-source -x $SRCDEB".split(' ')
Expand All @@ -352,6 +359,8 @@ def genTasks = { target ->
--set-envvar=${toOldStyleName(target)}_BASE_VERSION=$BASE_VERSION \
--set-envvar=${toOldStyleName(target)}_VERSION=$PKG_VERSION \
--set-envvar=${toOldStyleName(target)}_RELEASE=$BIGTOP_BUILD_STAMP \
--set-envvar=PARENT_DIR=$FULL_PARENT_DIR \
--set-envvar=BIGTOP_BASE_VERSION=$BIGTOP_BASE_VERSION \
-uc -us -b
"""
exec {
Expand Down