File tree 9 files changed +177
-0
lines changed
golang-phenix-apps/DEBIAN
9 files changed +177
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+
4
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
5
+
6
+
7
+ echo BUILDING DEB PACKAGE...
8
+
9
+ (cd $SCRIPT_DIR && fakeroot dpkg-deb -b phenix-apps)
10
+
11
+ echo DONE BUILDING DEB PACKAGE
Original file line number Diff line number Diff line change
1
+ Package: phenix-apps
2
+ Version: 0.1
3
+ Section: utils
4
+ Priority: extra
5
+ Architecture: amd64
6
+ Depends: golang-phenix-apps, python3-phenix-apps
7
+ Maintainer: Bryan Richardson <
[email protected] >
8
+ Description:
9
+ some stuff
10
+ .
11
+ and some other stuff
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+
4
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
5
+
6
+
7
+ mkdir -p $SCRIPT_DIR /bin
8
+
9
+ GOBIN=$SCRIPT_DIR /bin go install ./...
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+
4
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
5
+ APPS=$SCRIPT_DIR /..
6
+
7
+
8
+ which docker & > /dev/null
9
+ DOCKER=$?
10
+
11
+ if (( $DOCKER == 0 )) ; then
12
+ echo " Docker detected, so Docker will be used to build golang-phenix-apps."
13
+
14
+ (cd $APPS && $APPS /docker-build.sh)
15
+ else
16
+ echo " Docker not detected, using natively installed Go."
17
+
18
+ (cd $APPS && $APPS /build.sh)
19
+ fi
20
+
21
+
22
+ echo COPYING FILES...
23
+
24
+ DST=$SCRIPT_DIR /golang-phenix-apps/usr
25
+
26
+ mkdir -p $DST
27
+
28
+ cp -r $APPS /bin $DST /
29
+
30
+ echo COPIED FILES
31
+
32
+
33
+ echo BUILDING DEB PACKAGE...
34
+
35
+ (cd $SCRIPT_DIR && fakeroot dpkg-deb -b golang-phenix-apps)
36
+
37
+ echo DONE BUILDING DEB PACKAGE
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
4
+
5
+ rm -r $SCRIPT_DIR /golang-phenix-apps/usr
Original file line number Diff line number Diff line change
1
+ Package: golang-phenix-apps
2
+ Version: 0.1
3
+ Section: utils
4
+ Priority: extra
5
+ Architecture: amd64
6
+ Depends:
7
+ Maintainer: Bryan Richardson <
[email protected] >
8
+ Description:
9
+ some stuff
10
+ .
11
+ and some other stuff
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+
4
+ which docker & > /dev/null
5
+
6
+ if (( $? )) ; then
7
+ echo " Docker must be installed (and in your PATH) to use this build script. Exiting."
8
+ exit 1
9
+ fi
10
+
11
+
12
+ USER_UID=$( id -u)
13
+ USERNAME=builder
14
+
15
+
16
+ docker build -t golang-phenix-apps:builder -f - . << EOF
17
+ FROM golang:1.14
18
+
19
+ RUN groupadd --gid $USER_UID $USERNAME \
20
+ && useradd -s /bin/bash --uid $USER_UID --gid $USER_UID -m $USERNAME
21
+ EOF
22
+
23
+
24
+ echo BUILDING golang-phenix-apps...
25
+
26
+ docker run -it --rm -v $( pwd) :/phenix-apps -w /phenix-apps -u $USERNAME \
27
+ golang-phenix-apps:builder ./build.sh
28
+
29
+ echo DONE BUILDING golang-phenix-apps
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+
4
+ which docker & > /dev/null
5
+
6
+ if (( $? )) ; then
7
+ echo " Docker must be installed (and in your PATH) to use this build script. Exiting."
8
+ exit 1
9
+ fi
10
+
11
+
12
+ USER_UID=$( id -u)
13
+ USERNAME=builder
14
+
15
+
16
+ docker build -t python-phenix-apps:builder -f - . << EOF
17
+ FROM ubuntu:focal
18
+
19
+ RUN groupadd --gid $USER_UID $USERNAME \
20
+ && useradd -s /bin/bash --uid $USER_UID --gid $USER_UID -m $USERNAME
21
+
22
+ ENV TZ=Etc/UTC
23
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
24
+
25
+ RUN apt update && apt install -y \
26
+ apt-file \
27
+ build-essential \
28
+ debhelper \
29
+ devscripts \
30
+ dpkg-dev \
31
+ fakeroot \
32
+ python3 \
33
+ python3-apt \
34
+ python3-distro \
35
+ python3-pip
36
+
37
+ RUN python3 -m pip install wheel2deb
38
+ EOF
39
+
40
+
41
+ echo PACKAGING python-phenix-apps...
42
+
43
+ docker run -it --rm -v $( pwd) :/phenix-apps -w /phenix-apps -u $USERNAME python-phenix-apps:builder ./package.sh
44
+
45
+ echo DONE PACKAGING python-phenix-apps
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ cat > wheel2deb.yml << EOF
4
+ .:
5
+ maintainer_name: Bryan Richardson
6
+ maintainer_email: [email protected]
7
+ EOF
8
+
9
+ # Build wheel for phenix-apps
10
+ python3 -m pip wheel .
11
+
12
+ # Convert all wheels to debian source packages
13
+ wheel2deb --map attrs=attr
14
+
15
+ # Call dpkg-buildpackages for each source package
16
+ wheel2deb build
17
+
18
+ rm -f * .whl
19
+ rm wheel2deb.yml
You can’t perform that action at this time.
0 commit comments