Skip to content

Commit

Permalink
spksrc: Update master readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
th0ma7 committed Jul 28, 2024
1 parent 17645a4 commit fdcf090
Showing 1 changed file with 20 additions and 50 deletions.
70 changes: 20 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,21 @@ docker run -it --platform=linux/amd64 -v $(pwd):/spksrc -w /spksrc -e TAR_CMD="f


### Virtual machine
A virtual machine based on an 64-bit version of Debian 11 stable OS is recommended. Non-x86 architectures are not supported.
A virtual machine based on an 64-bit version of Debian 12 stable OS is recommended. Non-x86 architectures are not supported.

Install the requirements (in sync with `Dockerfile`):
```bash
sudo dpkg --add-architecture i386 && sudo apt-get update
sudo apt update
sudo apt install autoconf-archive autogen automake autopoint bash bc bison \
sudo apt install autoconf-archive autogen automake autopoint bash bash-completion bc bison \
build-essential check cmake curl cython3 debootstrap ed expect fakeroot flex \
g++-multilib gawk gettext git gperf imagemagick intltool jq libbz2-dev libc6-i386 \
libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev libmount-dev libncurses-dev \
libpcre3-dev libssl-dev libtool libunistring-dev lzip mercurial moreutils ninja-build \
patchelf php pkg-config python2 python3 python3-distutils rename ruby-mustache rsync scons subversion \
swig texinfo unzip xmlto zip zlib1g-dev
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O - | sudo python2
sudo pip2 install wheel httpie
wget https://bootstrap.pypa.io/get-pip.py -O - | sudo python3
sudo pip3 install meson==1.0.0
g++-multilib gawk gettext git gperf httpie imagemagick intltool jq libbz2-dev \
libc6-i386 libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev \
libmount-dev libncurses-dev libpcre3-dev libssl-dev libtool libunistring-dev \
lzip man-db manpages-dev mercurial meson mlocate moreutils ninja-build \
patchelf php pkg-config python3 python3-distutils python3-pip python3-virtualenv \
rename ripgrep ruby-mustache rsync scons subversion \
swig texinfo time tree unzip xmlto zip zlib1g-dev
```
From there, follow the instructions in the [Developers HOW TO].

Expand All @@ -73,35 +71,23 @@ From there, follow the instructions in the [Developers HOW TO].


### LXC
A container based on 64-bit version of Debian 11 stable OS is recommended. Non-x86 architectures are not supported. The following assumes your LXD/LXC environment is already initiated (e.g. `lxc init`) and you have minimal LXD/LXC basic knowledge :
1. Create a new container (will use x86_64/amd64 arch by default): `lxc launch images:debian/11 spksrc`
A container based on 64-bit version of Debian 12 stable OS is recommended. Non-x86 architectures are not supported. The following assumes your LXD/LXC environment is already initiated (e.g. `lxc init`) and you have minimal LXD/LXC basic knowledge :
1. Create a new container (will use x86_64/amd64 arch by default): `lxc launch images:debian/12 spksrc`
2. Enable i386 arch: `lxc exec spksrc -- /usr/bin/dpkg --add-architecture i386`
3. Update apt channels: `lxc exec spksrc -- /usr/bin/apt update`
4. Install all required packages:
```bash
lxc exec spksrc -- /usr/bin/apt install autoconf-archive autogen automake autopoint bash bc bison \
build-essential check cmake curl cython3 debootstrap ed expect fakeroot flex \
g++-multilib gawk gettext git gperf imagemagick intltool jq libbz2-dev libc6-i386 \
libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev libmount-dev libncurses-dev \
libpcre3-dev libssl-dev libtool libunistring-dev lzip mercurial moreutils ninja-build \
patchelf php pkg-config python2 python3 python3-distutils rename rsync ruby-mustache scons subversion \
swig texinfo unzip xmlto zip zlib1g-dev
```
5. Install `python2` wheels:
```bash
lxc exec spksrc -- /bin/bash -c "wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O - | python2"
lxc exec spksrc -- /bin/bash -c "pip2 install virtualenv httpie"
```
6. Install `python3` `pip`:
```bash
lxc exec spksrc -- /bin/bash -c "wget https://bootstrap.pypa.io/get-pip.py -O - | python3"
```
7. Install `meson`:
```bash
lxc exec spksrc -- /bin/bash -c "pip3 install meson==1.0.0"
lxc exec spksrc -- /usr/bin/apt install autoconf-archive autogen automake autopoint bash bash-completion bc bison \
build-essential check cmake curl cython3 debootstrap ed expect fakeroot flex \
g++-multilib gawk gettext git gperf httpie imagemagick intltool jq libbz2-dev \
libc6-i386 libcppunit-dev libffi-dev libgc-dev libgmp3-dev libltdl-dev \
libmount-dev libncurses-dev libpcre3-dev libssl-dev libtool libunistring-dev \
lzip man-db manpages-dev mercurial meson mlocate moreutils ninja-build \
patchelf php pkg-config python3 python3-distutils python3-pip python3-virtualenv \
rename ripgrep ruby-mustache rsync scons subversion \
swig texinfo time tree unzip xmlto zip zlib1g-dev
```


#### LXC: `spksrc` user
8. By default it is assumed that you will be running as `spksrc` user into the LXC container. Such user needs to be created into the default container image:
```bash
Expand All @@ -118,22 +104,6 @@ lxc exec spksrc -- su --login spksrc
spksrc@spksrc:~$
```

#### (OPTIONAL) Install misc base tools:
```bash
lxc exec spksrc -- /usr/bin/apt install bash-completion man-db manpages-dev \
mlocate ripgrep rsync tree time
lxc exec spksrc -- /usr/bin/updatedb
```
Install github client:
```
$ lxc exec spksrc -- su --login root
# curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
# sudo apt update
# sudo apt install gh
# exit
```

#### (OPTIONAL) LXC: Shared `spksrc` user
You can create a shared user between your Debian/Ubuntu host and the LXC Debian container which simplifies greatly file management between the two. The following assumes you already created a user `spksrc` with uid 1001 in your Debian/Ubuntu host environment and that you which to share its `/home` userspace.
1. Create a mapping rule between the hosts and the LXC image:
Expand Down

0 comments on commit fdcf090

Please sign in to comment.