Skip to content

Commit

Permalink
two packages
Browse files Browse the repository at this point in the history
  • Loading branch information
gkostin1966 committed Apr 19, 2024
1 parent 239a747 commit cb15709
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 17 deletions.
22 changes: 10 additions & 12 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,19 @@ COPY ./test-site /lauth/test-site/
COPY ./apache/conf/* /usr/local/apache2/conf/

###
FROM build-base AS package
FROM build-base AS packaging

RUN mkdir -p /lauth/apache/debpkgs/package
COPY ./apache/DEBIAN /lauth/apache/debpkgs/package/DEBIAN
COPY ./apache/libapache2 /lauth/apache/libapache2
WORKDIR /lauth/apache/libapache2

COPY --from=module /usr/local/ /lauth/apache/debpkgs/package/usr/local/
COPY --from=module /lauth/apache/build/http-check /lauth/apache/debpkgs/package/usr/local/bin/
#RUN ldconfig
RUN mkdir -p /lauth/apache/libapache2/mod-authn-remoteuser/usr/local/apache2/modules
COPY --from=module /usr/lib/apache2/modules/mod_authn_remoteuser.so /lauth/apache/libapache2/mod-authn-remoteuser/usr/local/apache2/modules/
RUN ./mod-authn-remoteuser/DEBIAN/package

RUN mkdir -p /lauth/apache/debpkgs/package/usr/lib/apache2/modules
COPY --from=module /usr/lib/apache2/modules/mod_authn_remoteuser.so /lauth/apache/debpkgs/package/usr/local/apache2/modules/
COPY --from=module /usr/lib/apache2/modules/mod_lauth.so /lauth/apache/debpkgs/package/usr/local/apache2/modules/

WORKDIR /lauth/apache/debpkgs
RUN ./package/DEBIAN/package
RUN mkdir -p /lauth/apache/libapache2/mod-lauth/usr/local/apache2/modules
COPY --from=module /usr/lib/apache2/modules/mod_lauth.so /lauth/apache/libapache2/mod-lauth/usr/local/apache2/modules/
RUN ./mod-lauth/DEBIAN/package

COPY ./apache/packages /lauth/apache/packages
WORKDIR /lauth/apache/libapache2
#CMD ["sleep", "infinity"]
8 changes: 8 additions & 0 deletions apache/libapache2/mod-authn-remoteuser/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: mod-authn-remoteuser
Version: 0.0.0
Architecture: amd64
Essential: no
Priority: optional
Depends: http
Maintainer: University of Michigan Library Information Technology
Description: Remote User Authentication Module for Apache2
13 changes: 13 additions & 0 deletions apache/libapache2/mod-authn-remoteuser/DEBIAN/package
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Build Debian Package

# Script directory
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Parse control file to create package directory name
PACKAGE_DIR=$( cat ${SCRIPT_DIR}/control | awk '$1=="Package:" {print $2} $1=="Version:" {print $2} $1=="Architecture:" {print $2}' | tr '\n' '_' | sed 's/.$//' )

# Build package
mv mod-authn-remoteuser ${PACKAGE_DIR}
dpkg --build ${PACKAGE_DIR}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Essential: no
Priority: optional
Depends: http
Maintainer: University of Michigan Library Information Technology
Description: Library Authentication/Authorization Module for Apache HTTP Server
Description: Library Authentication/Authorization Module for Apache2
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
PACKAGE_DIR=$( cat ${SCRIPT_DIR}/control | awk '$1=="Package:" {print $2} $1=="Version:" {print $2} $1=="Architecture:" {print $2}' | tr '\n' '_' | sed 's/.$//' )

# Build package
mv package ${PACKAGE_DIR}
mv mod-lauth ${PACKAGE_DIR}
dpkg --build ${PACKAGE_DIR}
3 changes: 3 additions & 0 deletions apache/libapache2/mod-lauth/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

# Post-Installation Script
3 changes: 3 additions & 0 deletions apache/libapache2/mod-lauth/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

# Pre-Installation Script
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ services:
- ./apache/module:/lauth/apache/module
- build_cache:/lauth/apache/build

package:
profiles: [ "package" ]
packaging:
profiles: [ "packages" ]
build:
context: ./
dockerfile: ./apache/Dockerfile
target: package
target: packaging
restart: "no"
volumes:
- ./apache/packages:/lauth/apache/packages
Expand Down

0 comments on commit cb15709

Please sign in to comment.