forked from kassisol/hbm
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
267 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM oraclelinux:7.9 | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
COPY build /usr/local/src/hbm | ||
|
||
ENV DAPPER_SOURCE /tmp | ||
ENV DAPPER_OUTPUT dist | ||
ENV SHELL /bin/bash | ||
|
||
WORKDIR ${DAPPER_SOURCE} | ||
|
||
ENV RPMBUILD_PATH="/srv/rpmbuild" | ||
|
||
RUN build="rpm-build" \ | ||
&& set -x \ | ||
&& yum -y install $build \ | ||
&& yum -y autoremove \ | ||
&& yum clean all | ||
|
||
RUN mkdir -p ${RPMBUILD_PATH} \ | ||
&& mkdir ${RPMBUILD_PATH}/BUILD \ | ||
&& mkdir ${RPMBUILD_PATH}/RPMS \ | ||
&& mkdir ${RPMBUILD_PATH}/SOURCES \ | ||
&& mkdir ${RPMBUILD_PATH}/SPECS \ | ||
&& mkdir ${RPMBUILD_PATH}/SRPMS \ | ||
&& mkdir ${RPMBUILD_PATH}/tmp \ | ||
&& echo "%_topdir ${RPMBUILD_PATH}" > /root/.rpmmacros \ | ||
&& echo "%_tmppath ${RPMBUILD_PATH}/tmp" >> /root/.rpmmacros | ||
|
||
COPY hbm.spec ${RPMBUILD_PATH}/SPECS/hbm.spec | ||
|
||
RUN set -x \ | ||
&& tar cvzf ${RPMBUILD_PATH}/SOURCES/hbm.tar.gz -C /usr/local/src hbm \ | ||
&& rm -rf /usr/local/src/hbm | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
scripts/packages/centos7/Dockerfile → scripts/packages/rockylinux8/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM centos:7 | ||
FROM rockylinux:8.7 | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
COPY build /usr/local/src/hbm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION=$1 | ||
RELEASE=$2 | ||
|
||
VERSION=${VERSION//-/_} | ||
|
||
cd "${RPMBUILD_PATH}/SPECS" || exit | ||
|
||
rpmbuild -ba \ | ||
--define "_version ${VERSION}" \ | ||
--define "_release ${RELEASE}" \ | ||
--define '_unitdir etc/systemd/system' \ | ||
hbm.spec | ||
|
||
mkdir -p /tmp/dist | ||
cp ${RPMBUILD_PATH}/RPMS/x86_64/*.rpm /tmp/dist/ | ||
|
||
#rpmlint hbm.spec ../SRPMS/hbm* ../RPMS/*/hbm* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Name: hbm | ||
Version: %{_version} | ||
Release: %{_release}%{?dist} | ||
Summary: Docker Engine Access Authorization Plugin | ||
Group: Tools/Docker | ||
|
||
License: GPLv3+ | ||
|
||
URL: https://github.com/kassisol/hbm | ||
Vendor: Kassisol | ||
Packager: Kassisol <support@kassisol.com> | ||
|
||
BuildArch: x86_64 | ||
BuildRoot: %{_tmppath}/%{name}-buildroot | ||
|
||
Source: hbm.tar.gz | ||
|
||
%description | ||
HBM is an authorization plugin for docker commands. | ||
|
||
%prep | ||
%setup -n %{name} | ||
|
||
%install | ||
# install binary | ||
install -d $RPM_BUILD_ROOT/%{_sbindir} | ||
install -p -m 755 hbm $RPM_BUILD_ROOT/%{_sbindir}/ | ||
|
||
# add init scripts | ||
install -d $RPM_BUILD_ROOT/%{_unitdir} | ||
install -p -m 644 hbm.service $RPM_BUILD_ROOT/%{_unitdir}/hbm.service | ||
install -p -m 644 hbm.socket $RPM_BUILD_ROOT/%{_unitdir}/hbm.socket | ||
|
||
# add bash completions | ||
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions | ||
install -p -m 644 shellcompletion/bash $RPM_BUILD_ROOT/usr/share/bash-completion/completions/hbm | ||
|
||
# install manpages | ||
install -d $RPM_BUILD_ROOT/%{_mandir}/man8 | ||
install -p -m 644 man/man8/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ | ||
|
||
%files | ||
#%doc README.md LICENSE | ||
%{_sbindir}/hbm | ||
/%{_unitdir}/hbm.service | ||
/%{_unitdir}/hbm.socket | ||
/usr/share/bash-completion/completions/hbm | ||
/%{_mandir}/man8/* | ||
|
||
%post | ||
%systemd_post hbm.service | ||
%systemd_post hbm.socket | ||
|
||
%preun | ||
%systemd_preun hbm.service | ||
%systemd_preun hbm.socket | ||
|
||
%clean | ||
rm -rf $RPM_BUILD_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
ROOTDIR=$(dirname $0)/../../.. | ||
cd $(dirname $0) | ||
|
||
if [ -d "build" ]; then | ||
rm -rf build | ||
fi | ||
mkdir -p build | ||
|
||
cp ${ROOTDIR}/contrib/init/systemd/hbm.service build/ | ||
cp ${ROOTDIR}/contrib/init/systemd/hbm.socket build/ | ||
cp ${ROOTDIR}/bin/hbm build/ | ||
|
||
go run ${ROOTDIR}/gen/man/genman.go | ||
cp -r /tmp/hbm/man build/ | ||
|
||
go run ${ROOTDIR}/gen/shellcompletion/genshellcompletion.go | ||
cp -r /tmp/hbm/shellcompletion build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM rockylinux:9.1 | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
COPY build /usr/local/src/hbm | ||
|
||
ENV DAPPER_SOURCE /tmp | ||
ENV DAPPER_OUTPUT dist | ||
ENV SHELL /bin/bash | ||
|
||
WORKDIR ${DAPPER_SOURCE} | ||
|
||
ENV RPMBUILD_PATH="/srv/rpmbuild" | ||
|
||
RUN build="rpm-build" \ | ||
&& set -x \ | ||
&& yum -y install $build \ | ||
&& yum -y autoremove \ | ||
&& yum clean all | ||
|
||
RUN mkdir -p ${RPMBUILD_PATH} \ | ||
&& mkdir ${RPMBUILD_PATH}/BUILD \ | ||
&& mkdir ${RPMBUILD_PATH}/RPMS \ | ||
&& mkdir ${RPMBUILD_PATH}/SOURCES \ | ||
&& mkdir ${RPMBUILD_PATH}/SPECS \ | ||
&& mkdir ${RPMBUILD_PATH}/SRPMS \ | ||
&& mkdir ${RPMBUILD_PATH}/tmp \ | ||
&& echo "%_topdir ${RPMBUILD_PATH}" > /root/.rpmmacros \ | ||
&& echo "%_tmppath ${RPMBUILD_PATH}/tmp" >> /root/.rpmmacros | ||
|
||
COPY hbm.spec ${RPMBUILD_PATH}/SPECS/hbm.spec | ||
|
||
RUN set -x \ | ||
&& tar cvzf ${RPMBUILD_PATH}/SOURCES/hbm.tar.gz -C /usr/local/src hbm \ | ||
&& rm -rf /usr/local/src/hbm | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION=$1 | ||
RELEASE=$2 | ||
|
||
VERSION=${VERSION//-/_} | ||
|
||
cd "${RPMBUILD_PATH}/SPECS" || exit | ||
|
||
rpmbuild -ba \ | ||
--define "_version ${VERSION}" \ | ||
--define "_release ${RELEASE}" \ | ||
--define '_unitdir etc/systemd/system' \ | ||
hbm.spec | ||
|
||
mkdir -p /tmp/dist | ||
cp ${RPMBUILD_PATH}/RPMS/x86_64/*.rpm /tmp/dist/ | ||
|
||
#rpmlint hbm.spec ../SRPMS/hbm* ../RPMS/*/hbm* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Name: hbm | ||
Version: %{_version} | ||
Release: %{_release}%{?dist} | ||
Summary: Docker Engine Access Authorization Plugin | ||
Group: Tools/Docker | ||
|
||
License: GPLv3+ | ||
|
||
URL: https://github.com/kassisol/hbm | ||
Vendor: Kassisol | ||
Packager: Kassisol <support@kassisol.com> | ||
|
||
BuildArch: x86_64 | ||
BuildRoot: %{_tmppath}/%{name}-buildroot | ||
|
||
Source: hbm.tar.gz | ||
|
||
%description | ||
HBM is an authorization plugin for docker commands. | ||
|
||
%prep | ||
%setup -n %{name} | ||
|
||
%install | ||
# install binary | ||
install -d $RPM_BUILD_ROOT/%{_sbindir} | ||
install -p -m 755 hbm $RPM_BUILD_ROOT/%{_sbindir}/ | ||
|
||
# add init scripts | ||
install -d $RPM_BUILD_ROOT/%{_unitdir} | ||
install -p -m 644 hbm.service $RPM_BUILD_ROOT/%{_unitdir}/hbm.service | ||
install -p -m 644 hbm.socket $RPM_BUILD_ROOT/%{_unitdir}/hbm.socket | ||
|
||
# add bash completions | ||
install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions | ||
install -p -m 644 shellcompletion/bash $RPM_BUILD_ROOT/usr/share/bash-completion/completions/hbm | ||
|
||
# install manpages | ||
install -d $RPM_BUILD_ROOT/%{_mandir}/man8 | ||
install -p -m 644 man/man8/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8/ | ||
|
||
%files | ||
#%doc README.md LICENSE | ||
%{_sbindir}/hbm | ||
/%{_unitdir}/hbm.service | ||
/%{_unitdir}/hbm.socket | ||
/usr/share/bash-completion/completions/hbm | ||
/%{_mandir}/man8/* | ||
|
||
%post | ||
%systemd_post hbm.service | ||
%systemd_post hbm.socket | ||
|
||
%preun | ||
%systemd_preun hbm.service | ||
%systemd_preun hbm.socket | ||
|
||
%clean | ||
rm -rf $RPM_BUILD_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
ROOTDIR=$(dirname $0)/../../.. | ||
cd $(dirname $0) | ||
|
||
if [ -d "build" ]; then | ||
rm -rf build | ||
fi | ||
mkdir -p build | ||
|
||
cp ${ROOTDIR}/contrib/init/systemd/hbm.service build/ | ||
cp ${ROOTDIR}/contrib/init/systemd/hbm.socket build/ | ||
cp ${ROOTDIR}/bin/hbm build/ | ||
|
||
go run ${ROOTDIR}/gen/man/genman.go | ||
cp -r /tmp/hbm/man build/ | ||
|
||
go run ${ROOTDIR}/gen/shellcompletion/genshellcompletion.go | ||
cp -r /tmp/hbm/shellcompletion build/ |